Developer forum

Forum » Templates » where did "lastitem" go?

where did "lastitem" go?

Lise T. Pedersen
Reply

I have a dropdown-navigation, based on the DwddDropdown template. And it works perfect, except that the li class on last item isn't outputting "lastitem" - and I need this for some other functions to work.

I have tried to use other (standard) navigation-files, but it seems the same no matter which template i'm using. All other classes works perfekt and changes, when navigating.
I have attached the dropdown navigation template, maybe another pair of eyes can help...

Or perhaps it's not the template, but some preferences somewhere, which gives the trouble. Any ideas, where I shall start looking?

Thanks in advance,

Lise


Replies

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply
This post has been marked as an answer

Try to replace this...

<xsl:if test="position() = count(//Page)">lastitem</xsl:if>

... with this...

<xsl:if test="position() = last()">lastitem</xsl:if>

 

Votes for this answer: 1
 
Lise T. Pedersen
Reply

Don't know why the "standard code" suddenly didn't work - but this was perfect! Thank You!

 
Lise T. Pedersen
Reply

Oops - now I also have "lastitem" in the dropdown/submenu, and it gives some other problems - is there a way to keep it only in the main menu?

 
Lise T. Pedersen
Reply

Oops - now I also have "lastitem" in the dropdown/submenu, and it gives some other problems - is there a way to keep it only in the main menu?

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply

Oh, you only want it on the first level. My XSL skills are limited, but this should do the trick...

<xsl:if test="$depth = 1 and position() = last()">lastitem</xsl:if>

 

You must be logged in to post in the forum