We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Help with Pages — Nested Menu plugin modification?

Development and Programming

james Brown's avatar
james Brown
492 posts
16 years ago
james Brown's avatar james Brown

I was trying to use Mark Huot’s Pages — Nested Menu plugin for a menu on a site. I’m trying to set it up so that the child pages are shown only if you are somewhere within the parent page (or child pages of that parent). I have tried everything from PHP to doing a conditional embed with another version of the plugin (seems the plugin can only be run a total of once even if the other one is in an embedded template).

I have figured out an easy way to achieve this now, but it requires an id for the child <ul>. Would it be possible for someone to help with a small modification to the plugin to insert the parent’s URL segment as an id in the <ul> element of the child menu?

So for a simple menu like this: dogs beagles pugs poodles cats siamese fluffy calico

The child menu for dogs would have a <ul id=”dogs”>, and the child menu for cats would have a <ul id=”cats”>.

I have tracked down in the code where the child <ul>’s get created, I just don’t know how to access the parent URL segment. The line number is 343, and the code on that line is:

$this->return_data .= '<ul>';

Could anyone please help me?

       
Wil Linssen's avatar
Wil Linssen
49 posts
16 years ago
Wil Linssen's avatar Wil Linssen

Hi James To get an id for the sub lists, just alter line 351 that should read

$this->return_data .= '<ul>';

To include your id like so:

$this->return_data .= '<ul id="'.$page['exp_weblog_titles']['url_title'].'">';

That should do it!

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.