Copied to clipboard

Flag this post as spam?

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


  • Daniel Horn 319 posts 344 karma points
    Feb 22, 2011 @ 12:02
    Daniel Horn
    0

    Removing the first slash in url?

    I've got this:

    Frontpage

    - Textpage 1 

    - Textpage 2

    Textpage 1 and 2 is just created as divs on the website and the html version of the menu is like this:

              <li><a href="#Forside" class="logo">Forside</a></li>

              <li><a href="#Projekter">Projekter</a></li>

    But when i use {umbraco.library:NiceUrl(@id)} 

    it automatically puts an / infront of the url so my urls looks like this:

    xxx.dk/#/forside

    xxx.dk/#/projekter

    Is it possible to remove the first slash? 

  • Daniel Horn 319 posts 344 karma points
    Feb 22, 2011 @ 12:04
    Daniel Horn
    0

    Tried with this:

    <xsl:attribute name="href">#<xsl:value-of select="umbraco.library:NiceUrl(@id)"/></xsl:attribute>

    It still adds like this /#/projekter

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Feb 22, 2011 @ 12:09
    Chriztian Steinmeier
    1

    Hi Daniel,

    If they're just <div> elements you should just print the same value as you're generating their IDs with (and that should probably be @urlName to be safe for use as an ID):

    <a href="#{@urlName}"><xsl:value-of select="@nodeName" /></a>
    
    <!-- Later ... -->
    <div id="{@urlName}">
        <!-- do stuff -->
    </div> 

    /Chriztian

  • Daniel Horn 319 posts 344 karma points
    Feb 22, 2011 @ 12:15
    Daniel Horn
    0

    Thanks Chriztian - you rock! :)

Please Sign in or register to post replies

Write your reply to:

Draft