YAFLogo

exhumed
  • exhumed
  • 54.4% (Neutral)
  • YAF Camper Topic Starter
10 years ago
Hi All,

I have been playing around with the sample web application, and I have set up a bootstrap carousel to display the newest 5 posts from a specific forum, basically acting as a "latest news" slider on the front page.

Currently i use a regexp to get the url for the background image from with the first [img=.....][/img] tags, and also use the topic title and description overlaid on the image, however I was wondering what would be the best way to generate a link to the topics themselves from within asp.net so that when a user clicks the carousel it redirects to the actual forum topic? Is there an existing method that takes a topic or post id and generates a URL that I can use by any chance?

Does that make sense at all?

Thanks in advance

Exhumed

Sponsor
exhumed
  • exhumed
  • 54.4% (Neutral)
  • YAF Camper Topic Starter
10 years ago
Sorted now, used the below to build the link

  '<%# YafBuildLink.GetLink(YAF.Types.Constants.ForumPages.posts, "t={0}", Eval("TopicID")) %>' 

thought i'd reply here incase this helps somebody else 🙂

Zero2Cool
  • Zero2Cool
  • 100% (Exalted)
  • YAF Leader YAF Version: YAF 3.1.16
10 years ago
Sounds interesting. Do you have a live demo of this and also the source code? I'd be interesting replicating it.
exhumed
  • exhumed
  • 54.4% (Neutral)
  • YAF Camper Topic Starter
10 years ago
Hi Zero,

I don't have a live demo sorry, but i'll happy share any code etc with you.

Basically, it consists of a database view, bootstrap carousel, and an asp repeater to repeat the inner items of the carousel per row returned to the repeater.

PM me if you would like more info/source code

Cheers

Exhumed