I’ve been trying to make a simple Table of Contents snippet that would
create a table of contents for a FAQ system where questions fall into
categories and each category and question is a page in the admin
interface (though the individual questions would all be listed in full
on the category page).
What I have so far is:
Category pages look like:
<h2><r:title/></h2> <r:content/> </r:children:each>
The only trouble I am having is that I want the second level contents
(the children of the child listed) to only be listed if that child is
currently active. Its simple to have the children (questions) of all
categories visible, but I only want the children of the active category
to be visible.
So if my directory structure is:
—why am i so lame?
—why do i always need help?
—how will i find help?
—how will this all end up?
…and my currently active page is the “how” category page then I want
my table of contents to read:
–how will i find help?
–how will this all end up?
So the table of contents is hiding the children of the other sections.
Any advice on how to do this with the current tags or with a custom tag
would be appreciated.