Note that there are some explanatory texts on larger screens.

plurals
  1. PODrupal 7 custom naviagtion menu
    primarykey
    data
    text
    <p>We are trying to get Drupal to allow us to put custom css classes on menu items based on the relationship to the current item. This way we can hide and style items with css so the menu is not as large. </p> <p>We want to be able to distinguish: First level - always shows Ancestors that are not active trail - always hide Active_trail - shows current item - show Siblings - shows Children - show</p> <p>The rules are:</p> <p><strong>General Navigation Rules</strong><br> When navigating, you will always see "level 1" navigation.<br> You will see the direct descendants (breadcrumb) of the page you are on. You see the siblings of the page you are on. You see the children of the page you are on. Note: This is not an accordion navigation. Sub-levels will only be visible when you are on the page.</p> <p><strong>Level 1</strong> You just see the home page and the top level of the navigation. Homepage link does not show.</p> <p><strong>Level 2</strong> When off the home page, its link will appear along with “level 1” navigation along and the direct children of the page you are on.</p> <p><strong>Level 3</strong> Now you see all of level 1, all of level 2 (siblings) and the children of the page you are on (level 3). This gives you a good idea of how much navigation you will typically see on a site once you have gotten deep into the pages.</p> <p><strong>Level 4</strong> You see the home page and level 1 as always. You also see the ancestors of the page you are on. And because you are on level 3, you see all of level 3's siblings and the children of the page you are on (level 4).</p> <p><strong>Level 5</strong> ou see the home page and level 1 as always. You also see the ancestors of the page you are on. And because you are on level 4, you see all of level 4's siblings and the children of the page you are on (level 5).</p> <p><strong>Update:</strong></p> <p>I was basically able to accomplish what I needed </p> <pre><code>function USZ_menu_link($variables) { $element = $variables['element']; $depth = sizeof(menu_get_active_trail()) -1; static $item_id = 0; if(!$element['#below'] &amp;&amp; !$element['#active_trail'] &amp;&amp; $element['#original_link']['depth'] != "1" &amp;&amp; $element['#original_link']['depth'] &lt; $depth){ $element['#attributes']['class'][] = 'hideme'; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload