xslt newbie question - where does path variable come from?

Irene's Avatar

Irene

Aug 16, 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. 1 Posted by Ryan Griffith on Aug 17, 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. 2 Posted by Ryan Griffith on Sep 12, 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 Sep 20, 2012 @ 06:19 PM.

Discussions are closed to public comments.
If you need help with Cascade CMS please start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac