xslt newbie question - where does path variable come from?

Irene's Avatar

Irene

16 Aug, 2012 10:05 PM

I'm having trouble getting the links to folders in Cascade. I keep getting the Cascade root folder name included when I do my XSLT. I'm not sure where this is coming from. Here's the code that I'm using.

<xsl:template match="system-folder" mode="main">

<ul>
    <li><a><xsl:attribute name="href"><xsl:value-of select="path/text()"/></xsl:attribute><xsl:value-of select="display-name/text()"/></a>

</xsl:template>

What I want this to return is www.oururl.com/the-folder-name.

What I'm getting instead is www.oururl.com/cascade-root-folder/the-folder-name

Thanks!

  1. Support Staff 2 Posted by Ryan Griffith on 17 Aug, 2012 08:20 PM

    Ryan Griffith's Avatar

    Hi Irene,

    I'm having trouble getting the links to folders in Cascade. I keep getting the Cascade root folder name included when I do my XSLT.

    Cascade tracks and rewrites the paths for Pages and Files, but not Folders. You are seeing the Cascade root folder because the path is not being rewritten on publish. Typically in this situation, you will see a Format use a path to an index page (or whatever your environment determines as the starting page for a directory). For example:

    <xsl:template match="system-folder" mode="main">
    <ul>
        <li><a><xsl:attribute name="href"><xsl:value-of select="system-page[name='index']/path"/></xsl:attribute><xsl:value-of select="display-name"/></a></li>
    </ul>
    </xsl:template>
    

    You can remove the link to the index page using something like mod_rewrite for Apache (you might see something like this in an .htaccess file).

    Please let us know if you have any questions.

    Thanks.

  2. Support Staff 3 Posted by Ryan Griffith on 12 Sep, 2012 12:13 PM

    Ryan Griffith's Avatar

    Hi Irene,

    Just wanted to follow up to see if you had a chance to view my recent comment. Were you able to get your Format working?

    Please let us know if you have any questions.

    Thanks.

  3. Ryan Griffith closed this discussion on 20 Sep, 2012 06:19 PM.

Comments are currently closed for this discussion. You can start a new one.