Copied to clipboard

Flag this post as spam?

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


  • trfletch 598 posts 604 karma points
    May 13, 2010 @ 11:56
    trfletch
    0

    Removing the (1) (2) etc from nodenames

    Hi All,

    I have an Umbraco V4.0.3 website and it has some nodes that are separated by month folders, the problem I am having is that there has to be more that one node in the month folder that contains the same name and as you know Umbraco adds (1) to the nodename which I assume is to make sure that the node has a unique URL. The URL is not an issue for this site because we currently have an action handler that changes the URL on publish to something completely unique. The number in brackets at the end of the nodename isn't really a problem in the backend but the nodename is used on the website as the H1 tag therefore it cannot have (1) or (2) etc on the end. I don't want the user to have to fill in an extra field on the node for the H1 tag therefore what is going to be the best solution? Is there a way to stop Umbraco adding the number in brackets to the nodename? Or is there a clever way to remove the number in brackets from the H1 tag on the page? I appreciate any help people can offer. Thanks

  • Stefan Kip 1614 posts 4131 karma points c-trib
    May 13, 2010 @ 12:30
    Stefan Kip
    0

    I think you could write an Event Handler for one of the many Document Events and remove (1) yourself.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    May 13, 2010 @ 12:33
    Jan Skovgaard
    0

    Hi

    I think I would just create a new textstring property under "properties" called "Alternative page name" or something like that. And then have it automatically filled in with the name used when creating the node using a simple event handler and then use this value in the XSLT.

    I hope this helps.

    /Jan

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    May 13, 2010 @ 12:38
    Sebastiaan Janssen
    1

    I don't understand the reason why there must be nodes with the same name. Even if you do solve the display problem (I'd write an XSLT extension to remove (*) from the end of a string), the URL still contains the (1), (2), etc. Which is pretty ugly as well. Is there no other way you can organize your content?

  • trfletch 598 posts 604 karma points
    May 14, 2010 @ 11:23
    trfletch
    0

    Thanks for all the responses:

    kipusoep: Any ideas how this could be done because this would probably be the most desired solution?

    Jan Skovgaard: I also like this solution, I could probably use the Alternative page name in the URL as well

    Sebastiaan Janssen: Unfortunately it has to be setup like this and there has to be nodes with the same name in a folder. As previously mentioned we already have an event handler that creates the URL which is unique (it uses the node ID within it). If I could get kipusoep method to work then this would be fine. If instaed I got Jan's method to work then I could probably also use the Alternative page name property in my URL rewrite event handler.

     

  • Aaron Powell 1708 posts 3046 karma points c-trib
    May 14, 2010 @ 23:19
    Aaron Powell
    1

    You can turn off unique naming within the umbraco settings file:

    <ensureUniqueNaming>True</ensureUniqueNaming> in /config/umbracoSettings.config

    I've never tried turning it to False, but I'd assume it works. Also, it will cause problems with URLs I'd assume (you'd only ever get to the first node). If you're not navigating to the nodes though it may work fine.

  • trfletch 598 posts 604 karma points
    May 17, 2010 @ 15:55
    trfletch
    0

    Thank you slace, that is exactly what I was after, I didn't realise it was going to be as easy as changing a setting in the config file. We are using an event handler to change the URL to something unique and search engine friendly anyway so this is not an issue.

Please Sign in or register to post replies

Write your reply to:

Draft