4

I have an xslt template with following code

<ul class="functions selected">
                <xsl:for-each select="functions/function">
                    <li><a href="{@id}"><xsl:value-of select="@title" /></a></li>
                </xsl:for-each>
            </ul>

this xslt is linked to an xml file generated by a TBB, "@title" is the title of a folder in content hirarchy and "@id" is tcmID, after executing all this i get following html rendered.

<a href="tcm:104-27391-2">Test Folder</a>

I want to update the href to an existing page, I have a link resolver tbb but don't know how to use it in my XSLT code. Need some guidance.

2 Answers 2

8

If you want to resolve links in XSLS you need to specify tridion specific attributes for instance you need to replace href with tridion:href. Below a sample.

Sample:

<a tridion:href="{tcmid}" title="{title}">{text}</a>

For multimedia links

<a tridion:href="{tcmid}" tridion:type="Multimedia" title="{title}">{text}</a>
8

If you're using the link resolver tbb in your compound template this link should be resolved. It's important to ensure that the tbb runs after your xslt template has ran.

If this isn't working I'd recommend trying the syntax <a tridion:href="tcmid" ...>, but I'm pretty sure the default finish actions will pick up the normal href attribute in your tag.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.