Developer forum

Forum » Development » Insert snippet in menu

Insert snippet in menu

Lars Larsen
Lars Larsen
Reply

Hi

I have a menu rendered by an xslt of course. In this menu I would like to insert some content from a snippet. I have tried this

                <!--@Snippet("LatestSentences1031")-->
                
                <xsl:text>&lt;!--@Snippet("LatestSentences1031")--&gt;</xsl:text>
                
                <!--@Snippet("LatestSentences1031")-->

But none of them works. The snippet tag is not replaced by the snippet content. Is it possible at all to have a snippet in the navigation xslt?


Replies

 
Nicolai Pedersen
Reply

In theory it should work - you just have to make sure the Snippet tag "survives" the XSLT parsing and gets returned to the layout.

Is the tag still in your source when you view the output of the page?

 
Lars Larsen
Lars Larsen
Reply

Hi Nicolai

Oh I found out. Have done it before but couldn't remember how to do it! One has to use the xslt attributte disable-output-escaping="yes"  which do the trick:

<xsl:text disable-output-escaping="yes">&lt;!--@Snippet(LatestSentences)--&gt;</xsl:text>

 

You must be logged in to post in the forum