Copied to clipboard

Flag this post as spam?

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


  • suzyb 464 posts 877 karma points
    Nov 27, 2012 @ 23:44
    suzyb
    0

    Removing "folders" from link

    In several of our sites we want pages to be organised under container or summary document types but don't want these to appear in the page link.

    For example
    Home
    -- Page
    ---- Another Page Type Summary
    ------- Another Page Type

    In the above the Url for Another Page Type would be built like

    /Page/AnotherPageTypeSummary/AnotherPageType 

    however we would like to be able to change these to remove AnotherPageTypeSummary so the Url would become

    /Page/AnotherPageType 

    "Another Page Type Summary" is needed for navigation and structure so removing it isn't really an option. 

    Is there a way to customise the path as well as the Url Name for a page.

  • Stephen Davidson 216 posts 392 karma points
    Nov 27, 2012 @ 23:51
    Stephen Davidson
    0

    Could you not use Umbraco URL Alias or Umbraco URL Name? Or do you mean the breadcrumb path?

    S

  • Fuji Kusaka 2203 posts 4220 karma points
    Nov 28, 2012 @ 03:55
    Fuji Kusaka
    0

    Hi,

    Am looking to achieve the same results but without any success. Here is what ive been trying, may be that could help you.

    add this to the /config/UrlRewriting.config

    <addname="hideFolder"   virtualUrl="^~/en/sector/(.+?)"rewriteUrlParameter="ExcludeFromClientQueryString"destinationUrl="~/en/$+"ignoreCase="true"/>    
  • suzyb 464 posts 877 karma points
    Nov 28, 2012 @ 19:08
    suzyb
    0

    I just noticed my example was slightly wrong, it should be AnotherPageType.aspx.

    But anyway...Umbraco URL Alias or Umbraco URL Name only change the last part of the url, the filename.  It's the bit before I want to change.

    I also don't think the rewriting will do exactly what we want as we want any links on the site to show the shorter URL instead of just rewriting it when the page is visited.

  • Nathan Woulfe 422 posts 1580 karma points MVP 3x c-trib
    Nov 29, 2012 @ 07:18
    Nathan Woulfe
    0

    Hi Suzy

    UmbracoUrlAlias can be used to remove sections of the path - if you were to add the property to your doctype, then alias AnotherPageType.aspx as 'Page/AnotherPageType', it will then be accessible at that URL.

    Then when you're building out navigation etc and need to include the url for the node, instead of node.NiceUrl or node.Url, use node.umbracoUrlAlias.

    Should do exactly what you're looking for.

    cheers
    Nathan

  • 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