Copied to clipboard

Flag this post as spam?

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


  • Kip Carter 42 posts 201 karma points
    May 31, 2017 @ 18:15
    Kip Carter
    0

    Reorder links in menu

    I'm using the default starter kit with 7.1 and after laying out some pages in a sub level the menu that is generated for them did fine except it isn't in the order I would like.

    I also am using the blog section and would like to see that displayed from the newest to the oldest. I just haven't figured out how to make that happen yet.

    Thoughts? Kip....

  • Søren Kottal 530 posts 3521 karma points MVP 2x c-trib
    May 31, 2017 @ 19:42
    Søren Kottal
    1

    Hi Kip

    If you edit the Blog Overview template, you can change line 12 from

    @foreach(var post in CurrentPage.Children) 
    

    to

    @foreach(var post in CurrentPage.Children.OrderBy("CreateDate desc")) 
    

    This will sort the blog posts in descending order by their creation date.

  • Kip Carter 42 posts 201 karma points
    May 31, 2017 @ 20:12
    Kip Carter
    100

    Thanks Soren... I'll do just that! I'll see just how difficult it might be to edit it on the server rather than drag it down and republish it.

    Now if someone comes up with a way to reorder the menu items I"ll be golden!

    Thanks again! Kip...

  • Brett Fullam 119 posts 629 karma points
    May 31, 2017 @ 23:13
    Brett Fullam
    1

    Are the menu items generated by the content tree ? If so you can reorder them right in the content tree.

  • Nicholas Westby 2005 posts 6843 karma points c-trib
    May 31, 2017 @ 23:32
    Nicholas Westby
    1

    Hi Kip,

    It's also worth noting that Brett an I were recently involved in an interesting conversation about some alternative approaches to this problem: https://our.umbraco.org/forum/using-umbraco-and-getting-started/85729-how-to-add-anchor-links-to-dynamic-navigation

    Here's a comment you may find particularly interesting: https://our.umbraco.org/forum/using-umbraco-and-getting-started/85729-how-to-add-anchor-links-to-dynamic-navigation#comment-271897

  • 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