Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I modify output markup for system secondary menu in Drupal 7?
    primarykey
    data
    text
    <p>I want to modify the structure of the secondary menu in Drupal 7 that appears when you are logged in. The secondary navigation shows 'My Account' and 'Log Out' links. By default, this renders as:</p> <pre><code>&lt;h2 class="element-invisible"&gt;Secondary Menu&lt;/h2&gt; &lt;ul id="secondary-menu-links" class="links inline clearfix"&gt; &lt;li class="menu-2 first"&gt; &lt;a href="/user"&gt;My account&lt;/a&gt; &lt;/li&gt; &lt;li class="menu-15 last"&gt; &lt;a href="/user/logout"&gt;Log out&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt; </code></pre> <p>The code in my theme that is generating this menu is:</p> <pre><code>&lt;?php print theme('links__system_secondary_menu', array( 'links' =&gt; $secondary_menu, 'attributes' =&gt; array( 'id' =&gt; 'secondary-menu-links', 'class' =&gt; array('links', 'inline', 'clearfix'), ), 'heading' =&gt; array( 'text' =&gt; t('Secondary Menu'), 'level' =&gt; 'h2', 'class' =&gt; array('element-invisible'), ), )); ?&gt; </code></pre> <p>How can I get the following markup outputted instead of what was listed above?</p> <pre><code>&lt;li class="secmenusep"&gt;&lt;span&gt;|&lt;/span&gt;&lt;/li&gt; &lt;li class="menu-2 secnav_account"&gt; &lt;a href="/user"&gt;My account&lt;/a&gt; &lt;/li&gt; &lt;li class="secmenusep"&gt;&lt;span&gt;|&lt;/span&gt;&lt;/li&gt; &lt;li class="menu-15 secnav_logout"&gt; &lt;a href="/user/logout"&gt;Log out&lt;/a&gt; &lt;/li&gt; </code></pre> <p>I want the h2 removed, as well as the ul, and add two additional li tags with pipes for separators, and add a unique class to each.</p> <p>Your help is very much appreciated.</p>
    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.
 

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