I must have forgotten something since my last go with Umbraco :-)
I'm doing a topnavigation where i want a short description below the a tag from a doc property and i have done so on an older version of umbraco where it looked like this:
First occurence of pageMenuText won't have any value... it really needs $currentPage/pageMenuText, second occurence should be fine (Although it helps to have ./ in front of pageMenuText so you know you're currently looking up a property on the current node being processed in the for-each loop)
Ah of course! Since i don't want the Frontpage subtext to change according to currentPage i'll just hardcode that part :-) The others are now working dynamically.
value of select not outputting (4.7.1)
Hi there
I must have forgotten something since my last go with Umbraco :-)
I'm doing a topnavigation where i want a short description below the a tag from a doc property and i have done so on an older version of umbraco where it looked like this:
In my 4.7.1 installation i'm doing this with no succes:
<xsl:param name="currentPage"/> <!-- Input the documenttype you want here --> <xsl:variable name="level" select="1"/> <xsl:template match="/"> <ul class="topNav"> <li class="topNavLi"> <a href="/" class="navigation"> <xsl:if test="$currentPage/@id = $currentPage/ancestor-or-self::* [@level=$level]/@id"> <xsl:attribute name="class">navigation current</xsl:attribute> </xsl:if> Forside </a> <p><xsl:value-of select="pageMenuText"/></p> </li> <xsl:for-each select="$currentPage/ancestor-or-self::* [@level=$level]/* [@isDoc and string(umbracoNaviHide) != '1']"> <li class="topNavLi"> <a class="navigation" href="{umbraco.library:NiceUrl(@id)}"> <xsl:if test="@id = $currentPage/@id"> <xsl:attribute name="class">navigation current</xsl:attribute> </xsl:if> <xsl:value-of select="@nodeName"/> </a> <p><xsl:value-of select="pageMenuText"/></p> </li> </xsl:for-each> </ul> </xsl:template>If i set $currentPage/pageMenuText i will get the value from the specific page i am on, on ALL the menu items.
What am i missing here?
Help much appreciated!
First occurence of pageMenuText won't have any value... it really needs $currentPage/pageMenuText, second occurence should be fine (Although it helps to have ./ in front of pageMenuText so you know you're currently looking up a property on the current node being processed in the for-each loop)
Cheers,
/Dirk
Hi Dirk
Ah of course! Since i don't want the Frontpage subtext to change according to currentPage i'll just hardcode that part :-) The others are now working dynamically.
Thanks for your swift reply!
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.