Copied to clipboard

Flag this post as spam?

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


  • Tomas Breen 5 posts 28 karma points
    Jan 07, 2010 @ 10:57
    Tomas Breen
    0

    Single Node with Mutiple URLs

    Hi Guys,

    I am building a catalogue of products. Each product will have 3 areas: Overview, Details and Pricing. I would like to be able to fill all this information on a single node, with each area in a different tab.

    How can I do this and have a different url for each area? Like below:

    /products/prod1/overview.aspx
    /products/prod1/details.aspx
    /products/prod1/pricing.aspx

    The reason for this is to make it much easer on the user to create a single product, without having to create 3 nodes below it.

    Thanks in Advance.

     

  • Hendy Racher 863 posts 3849 karma points MVP 2x admin c-trib
    Jan 07, 2010 @ 11:24
    Hendy Racher
    0

    Hi Tomas,

    You could look at adding a url rewrite rule to into the /config/UrlRewriting.config file for your three alternatives, having them point back to /products/prod1.aspx, this would probably be simplier than adding alternative Urls for each node

    HTH,

    Hendy

  • Harald Ulriksen 207 posts 249 karma points
    Jan 07, 2010 @ 11:30
    Harald Ulriksen
    2

    You could use alternate templates. Create one template for area and then modify the url in the xslt or create a new method in the library which generates the alternate template for you.

    public static string AlternateTemplateUrl(int nodeId, string template)
    {         
    return library.NiceUrl(nodeId).Replace(".aspx", "/" + template);     
    }

    You might want to skip the overview and just use the normale template for it.

    Hth,
    Harald

  • Tomas Breen 5 posts 28 karma points
    Jan 07, 2010 @ 13:00
    Tomas Breen
    0

    Harald,

    Thank you for your reply. I think you are on the right path with this. I am, however, quite new to umbraco. Can you explain where I can extend the library? It may be easier for me to modify the XSLT, can you give me an example?

    Regards,

    Tomas

  • Tomas Breen 5 posts 28 karma points
    Jan 07, 2010 @ 14:38
    Tomas Breen
    3

    Harald,

    After a bit of googling, I understand what you are explaining now.

    Any {node}/{templateAlias}.aspx works out of the box and selects the template based on that template alias. Excellent. I love Umbraco.

    Regards,

    Tomas

  • Laurence Gillian 600 posts 1219 karma points
    Jan 07, 2010 @ 15:01
    Laurence Gillian
    1

    The above post is a killer tip! :) Sweet, didn't know about this! (i'd thumbs up you, but I don't have enough karma yet!)

    /Laurie

  • Hendy Racher 863 posts 3849 karma points MVP 2x admin c-trib
    Jan 07, 2010 @ 16:53
    Hendy Racher
    0

    Yep nice tip :) no messing with config files, and sperate templates for each - ideal.

    Thanks

  • Tomas Breen 5 posts 28 karma points
    Jan 08, 2010 @ 13:10
    Tomas Breen
    0

    For completeness, here is part of the XSLT I used to achieve the multiple pages per node.

    <ul>
    <xsl:for-each select="$currentPage/ancestor-or-self::node [@level=2]/node [@nodeTypeAlias = $documentTypeAlias and string(data [@alias='umbracoNaviHide']) != '1']">
    <li>
    <a href="{umbraco.library:NiceUrl(@id)}">
    <xsl:value-of select="@nodeName"/>
    </a>
    <ul>
    <li>
    <a href="{umbraco.library:Replace(umbraco.library:NiceUrl(@id), '.aspx', '/details.aspx')}">
    Details
    </a>
    </li>
    <li>
    <a href="{umbraco.library:Replace(umbraco.library:NiceUrl(@id), '.aspx', '/enquiry.aspx')}">
    Enquire</a>
    </li>
    </ul>
    </li>
    </xsl:for-each>
    </ul>
Please Sign in or register to post replies

Write your reply to:

Draft