Copied to clipboard

Flag this post as spam?

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


  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Jun 26, 2011 @ 15:05
    Anthony Dang
    0

    How to change the url structure while keeping content node tree

    I have this content tree structure:

    - Posts
    - 2011
    - January
    - My Post

    The resulting url on Model.Url is: /posts/2011/january/my-post/

    Is there a way to keep the content tree structure like this, but have Model.Url (or DynamicNode .Url) return a url without the "/posts/" part? ie /2011/january/my-post/

    I want to be able to hit /2011/january/my-post/ in the browser and also go to that page.

    I know that umbracoUrlAlias will allow me to shorten the url, however I specifically want Model.Url (a DynamicNode's .Url) to give me the shortended url structure because I want my package imediately compatible with sitemap packages.

    I suspect that I should be able to do this using Umbraco's routing/virtual directory handling, but I have no idea where to start with this.

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jun 26, 2011 @ 22:09
    Jan Skovgaard
    0

    Hi Anthony

    Would it be an option to look at the UrlRewriting.config perhaps? Or am I missing something here?

    /Jan

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Jun 27, 2011 @ 13:21
    Anthony Dang
    0

    Hey Jan

    That is a workaround which I considered.

    The issue is that when I mouse over a link to that post, I will still see /posts/2011/january/my-post/

    I can of course route /posts/2011/january/my-post/ to /2011/january/my-post/, but ideally I want to mouse over the nice shortened link.

    This is more of an issue if people want to remove all the parent folders from the url and have say /my-post/ as the link. It's much prettier.

     

    Any suggestions?



Please Sign in or register to post replies

Write your reply to:

Draft