Forums » Make sub-items collapsed by default in exhibit nav

RSS feed for this topic

Info

  1. On exhibit pages like this:

    http://exhibits.library.ucsc.edu/exhibits/show/activism-in-the-archives

    I'd like menu items to be collapsed by default and only appear when their parent is active. For example, the link to 'Democratic Party Politics' would only appear when the user was on the the 'John Thorne Papers' page.

    The code I'm using for the menus is:

    <?php set_exhibit_pages_for_loop_by_exhibit(); ?>
      <?php if (has_loop_records('exhibit_page')): ?>
      <nav id="exhibit-pages">
          <ul>
              <li><a id="exhibit-home" href="/"><?php echo metadata('exhibit', 'title'); ?></a></li>
    		  <?php foreach (loop('exhibit_page') as $exhibitPage): ?>
              <?php echo exhibit_builder_page_summary($exhibitPage); ?>
              <?php endforeach; ?>
          </ul>
      </nav>
      <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-546544957cc72fed" async="async"></script>
    <div class="addthis_sharing_toolbox"></div>
      <?php endif; ?>

    The theme is based on the 'Thanks Roy' theme. Our version is 2.2.2. Any help appreciated.

The forums are closed to new posts. To post new topics and read the latest discussions, please see the new forums.