Developer forum

Forum » CMS - Standard features » RE: Previous/Next on an item - Newslist

RE: Previous/Next on an item - Newslist

Jan Sangill
Reply

Hi,

I am using items to display a newslist. When i goto the item(page),k then I need previous/next links to access them fast,

Any standard way of doing this?

Or would the solution to be to make a DB call into pages myself, and locate the next/prev page from the currentPageId and sort?

//jan


Replies

 
Nicolai Høeg Pedersen
Reply

Hi Jan

The only way to do that is to have the list 2 times. One showing the list of news, and one showing the list of news but only displaying the currently active and hiding/not rendering the previous and next news items. Then using the list + querystring you can detect which is active and which are next/prev news item.

BR Nicolai

 
Nicolai Høeg Pedersen
Reply

By the way, which is next and previous depends on sorting, filtering and searching of the list and that information does not exist on the record it self.

BR Nicolai

 
Jan Sangill
Reply

That would be a way. Thx. I will try and think if this feature is worth it:)

 

 

 
Thaw Htun Lynn
Reply

Hi I want link to next item and last item in item detail page. And I found no template tag to make it happen. I read the above discussion and didn't figure it out. 

 
Jan Sangill
Reply

What I ended up doing was making calls directly to DB in razor template, to find prev/next. This could also be done to find next/last item.

 
Thaw Htun Lynn
Reply

mmmmm. isn't there any other way around it? coz what I want is with filters. and sort

 
Nicolai Høeg Pedersen
Reply

Hi Thaw.

If you use the item publisher, you can create a list that just shows 1 item at a time...

BR Nicolai

 

You must be logged in to post in the forum