Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Tom Bruce 121 posts 505 karma points
    Aug 03, 2017 @ 20:13
    Tom Bruce
    0

    Links to Next Previous buttons

    Hi folks, I have a folder within my content section of Umbraco that has approximately 10 pages.

    I would like to add a Next and Previous buttons on each page i.e. to allow the user to navigate from page to page.

    I’m new to Umbraco any advice or pointers much appreciated.

    would something like this work

    @{@Model.DescendantsOrSelf())
        if (@Model.Next() != null) 
        {
            <a href="@Model.Next().Url">Next</a>
        }
        if (@Model.Previous() != null) 
        {
            <a href="@Model.Previous().Url">Previous</a>
        }
    }
    
  • [email protected] 378 posts 1915 karma points MVP 4x c-trib
    Aug 04, 2017 @ 06:55
    jeffrey@umarketingsuite.com
    1

    Hi Tom,

    It's for something in Umbraco, isn't it? And then put these buttons on the bottom of the page or something like that?

    If raised an issue a while ago in the Issue Tracker (http://issues.umbraco.org/issue/U4-9981) where I would love to see this in a ListView-situation. Are you using a listview for this situation (maybe a screenshot of your situation would help)?

    Let me know, and hopefully I can help you.

    Regards, Jeffrey

  • Paul Seal 428 posts 2354 karma points MVP 3x c-trib
    Aug 04, 2017 @ 12:03
    Paul Seal
    101

    For anyone else looking for the answer. I did a live coding stream last night to show Tom how to do this.

    I created a post on my site which has the video and code on it.

    http://www.codeshare.co.uk/videos/live-coding-previous-and-next-page-buttons-in-umbraco/

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies