You are not thinking about your issue with the navigation bar correctly. You do not need to add certain sub-items depending upon the current page. You need to hide certain sub-items. Plain HTML/CSS example:

<style type="text/css"> ul li ul {display:none;} #active ul {display:block;} </style> <ul> <li id="active">Section 1 <ul> <li>Subsection 1.1</li> <li>Subsection 1.2</li> </ul> </li> <li>Section 2 <ul> <li>Subsection 2.1</li> <li>Subsection 2.2</li> </ul> </li> </ul>

Renders as:

Even though this contains both submenus, only the first one gets displayed. Without knowing exactly what the generated HTML of you navbar looks like, I can only point to the general technique ...


The intelligent reader will judge for himself. Without examining the facts fully and fairly, there is no way of knowing whether vox populi is really vox dei, or merely vox asinorum. — Cyrus H. Gordon

In reply to Re: Thoughts on converting from HTML::Template to Template Toolkit by idsfa
in thread Thoughts on converting from HTML::Template to Template Toolkit by Tanktalus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.