Developer forum

Forum » Rapido » XSLT navigation - "template tags"

XSLT navigation - "template tags"

Mikkel Hornbech Nielsen
Reply

Hi there.

I was wondering if its possible to display "TemplateTags()" - same purpose, different syntax. In xslt templates.
Pr instance in the template "Navigation/BaseMenuWithDropdown.xslt".

Its because i want to get a custom propertys value (set on the ContentPage item).
So far i am able to pass in system values from the ContentPage item, but i am pretty unsure about how to get the custom value.

Code so far:

               <xsl:apply-templates select="Page">

                    <xsl:with-param name="depth" select="1"/>

                    <xsl:with-param name="menutest" select="@MenuText"></xsl:with-param>

                    <xsl:with-param name="menutesthest" select="@RenderPageInNavigation"></xsl:with-param>

 

                </xsl:apply-templates>

 

    <xsl:template match="//Page">

        <xsl:param name="depth"/>

        <xsl:param name="menutest" />

        <xsl:param name="menutesthest" />

 

      <xsl:if test="@RelativeLevel=/NavigationTree/Settings/LayoutNavigationSettings/@startLevel">

            <xsl:apply-templates select="Page">

                <xsl:with-param name="depth" select="$depth+1"/>

                <xsl:with-param name="menutest" select='@MenuText'/>

                <xsl:with-param name="menutesthest" select='@RenderPageInNavigation'/>

            </xsl:apply-templates>

        </xsl:if>

 

The "RenderPageInNavigation" is my custom property on the item.

 

 

So is there a way to get that value pasted out in the xslt template?

Something like this pr instance:
”<xsl:value-of select="/"></xsl:value-of>"


Replies

 
Nicolai Pedersen
Reply

Hi Mikkel

You can add ?SaveXml=True to your url and then the xml document will get written next to your xslt file. Then you can open it and see how it looks.

I want to make sure you know viewmodel based navigations: https://doc.dynamicweb.com/template-tags/introduction/concept/navigation#sideNavTitle1-2

They run in Razor and you have full api access - and it performs faster.

BR Nicolai

 

You must be logged in to post in the forum