Jump to content

Search the Community

Showing results for tags 'class recursive navigation'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 1 result

  1. Hello, I found a lot of great examples of recursive navigation in the forums and have based my example here off of those. I'm having trouble adding an active class to the menu. Ultimately, I'd like to add the active class to the active parent and child item, but I've started with just trying to get the parent to have an active class. Although the menu renders as desired, I must be missing something here with adding the class: <?php function listChildrenTree($children) { echo "<ul class='span-24'>"; foreach($children as $child) { if($child === $page) $class = " current"; else $class= ' '; echo "<li class=' $class'><a href='{$child->url}'>{$child->title}</a> "; if($child->numChildren && $child->template != 'page-article') listChildrenTree($child->children); echo "</li>"; } echo "</ul>"; } listChildrenTree($pages->get('/')->children); ?> Thanks for any suggestions you may be able to provide.
×
×
  • Create New...