sub navigation
This is an open discussion with 4 replies, filed under XSLT.
Search
Why don’t you ditch the Category page altogether and pass a case handle as a URL Parameter to the Cases page?
/cases/case-name-here/
The alternative direction is: how are you selecting the navigation in the first place? If you’re checking the $current-page
parameter inside an xsl:if
could you check for both:
test="$current-page='cases' or $current-pages='categories'"
your way is not working for m, when i go to a category page all the navigation buttons are selected because of: if $current-pages=’categories’” loop…
but, I solve this problem starting from what you said, i think i can delete the catgories data source now….
thanks nick!
navigation.xsl
<xsl:choose> <xsl:when test="$current-page = @handle"> <xsl:attribute name="class">active</xsl:attribute> </xsl:when> <xsl:when test="@handle = 'cases' and $current-page= 'caseslist'"> <xsl:attribute name="class">active</xsl:attribute> </xsl:when> <xsl:otherwise></xsl:otherwise> </xsl:choose>
this is how i solved this problem…
so, i have one data source that list 20 “cases”
my menu looks like this:
Home
Cases
- Grid View
- List View
Contact
Grid View is actually the Cases page, List View is a hidden page named Caseslist
when you go on /cases page the Cases button is active….
when you go on /caseslist page the Cases button is active….
sorry for my bad english :P
<xsl:when test="$current-page = @handle or @handle = 'cases' and $current-page= 'caseslist'"> <xsl:attribute name="class">active</xsl:attribute> </xsl:when>
simplified :P
Create an account or sign in to comment.
so, i have 2 sections: Cases and Categories… each case is inside a category…
i have 2 pages too….
/cases - this page display all the cases, and /category/something that display all the cases that are inside “something..”
and 3 navigation buttons: Home, Cases, Contact -Categories is hidden…
i already listed all the categories on the cases page so “something1, something2 and something3” should be subnav of Cases.
now, the navigation knows that if $curent-page is “cases” then Cases button will be selected….
the problem is that i can’t make Cases button selected when i go to a category page ex: /category/something1
in this example $curent-page is “category” and not “cases”
my first idea was to give “cases” value to $curent-page only when you access /category/something… but i don’t know how to do that and it doesn’t look like a smart way to solve this problem…
anyone can help me with this? thanks!