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 122 posts 506 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>
        }
    }
    
  • Jeffrey Schoemaker 408 posts 2138 karma points MVP 8x c-trib
    Aug 04, 2017 @ 06:55
    Jeffrey Schoemaker
    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 524 posts 2890 karma points MVP 7x c-trib
    Aug 04, 2017 @ 12:03
    Paul Seal
    102

    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/

Please Sign in or register to post replies

Write your reply to:

Draft