logo
Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
Jop  
#1 Posted : Wednesday, May 8, 2013 4:44:39 PM(UTC)
Jop

Rank: Sienn Moderator

Reputation:

Groups: Administration, Member
Joined: 9/11/2009(UTC)
Posts: 6

Building a custom previous/next functionality in a detailview.

1.) Make a extra view, in which you load an overview of all items of the database you've made your detailview on. (Example News)
This should have the same order as the normal overview.

Code:

{!!==>END HEADER!!}{!!==>END SUBHEADER!!}
<a href="{!!NewsDB.Link!!}" class="artikel{!!NewsDB.Id!!}" style="display:none; margin-right:40px;">{!!NewsDB.Id!!}</a>
{!!==>END BODY!!}{!!==>END BODYEVEN!!}{!!==>END SUBFOOTER!!}


2.) In your detailview, make a viewcontrol(in footer of view) linking to the view you've made in step 1

3.) Also in you detailview put in the following jquery:
Code:

<script type="text/javascript">                                         
 $(function() {
   $('a.artikel{!!NewsDB.Id!!}').next().show().text("Next artikel »");
   $('a.artikel{!!NewsDB.Id!!}').prev().show().text("« Previous artikel");;
 });
</script>


So, basicly... jQuery reads the current item and shows the previous and next item, and puts in the html next / previous.

Wanna join the discussion?! Login to your Sienn Forum forum account. New Registrations are disabled.

Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.