Note that there are some explanatory texts on larger screens.

plurals
  1. POJoomla 3: how to add class to specific a link element
    primarykey
    data
    text
    <p>I'm using Twitter Bootstrap 3 which doesn't support the sub menus. So in order to implement this I've found this cool plug-in: <a href="https://github.com/CWSpear/twitter-bootstrap-hover-dropdown" rel="nofollow noreferrer">https://github.com/CWSpear/twitter-bootstrap-hover-dropdown</a></p> <p>But the problem is that I must modificate menu render in such way that special class would be added to "a" tag which is <strong>under parent</strong> sub menu item.</p> <p>I've found something similar to my problem here: <a href="https://stackoverflow.com/questions/13557093/joomla-how-to-customize-main-menu">Joomla How to customize main menu</a> But actually I don't have any ideas how to modificate the code. Now I've this html output:</p> <pre><code>&lt;div class="moduletable"&gt; &lt;ul class="nav menu nav-pills nav-justified"&gt; &lt;li class="item-110 current active"&gt;&lt;a href="/" &gt;First&lt;/a&gt;&lt;/li&gt; &lt;li class="item-111"&gt;&lt;a href="/" &gt;Second&lt;/a&gt;&lt;/li&gt; &lt;li class="item-112 dropdown"&gt;&lt;a href="/" &gt;third&lt;/a&gt; &lt;ul class="dropdown-menu"&gt; &lt;li class="item-127"&gt;&lt;a href="/" &gt;Sub first&lt;/a&gt;&lt;/li&gt; &lt;li class="item-128"&gt;&lt;a href="/" &gt;Sub second&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li class="item-113"&gt;&lt;a href="" &gt;Third&lt;/a&gt;&lt;/li&gt; &lt;li class="item-116"&gt;&lt;a href="" &gt;Fourth&lt;/a&gt; &lt;ul class="dropdown-menu"&gt; &lt;li class="item-125"&gt;&lt;a href="/" &gt;Last&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre> <p>And this I need to get:</p> <pre><code>&lt;div class="moduletable"&gt; &lt;ul class="nav menu nav-pills nav-justified"&gt; &lt;li class="item-110 current active"&gt;&lt;a href="/" &gt;First&lt;/a&gt;&lt;/li&gt; &lt;li class="item-111"&gt;&lt;a href="/" &gt;Second&lt;/a&gt;&lt;/li&gt; &lt;li class="item-112 dropdown"&gt;&lt;a href="" &gt;third&lt;/a&gt; &lt;ul class="dropdown-menu"&gt; &lt;li class="item-127"&gt;&lt;a class="data-toggle="dropdown" data-hover="dropdown" data-delay="1000" href="/" &gt;Sub first&lt;/a&gt;&lt;/li&gt; &lt;li class="item-128"&gt;&lt;a class="data-toggle="dropdown" data-hover="dropdown" data-delay="1000" href="/" &gt;Sub second&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li class="item-113"&gt;&lt;a href="" &gt;Third&lt;/a&gt;&lt;/li&gt; &lt;li class="item-116"&gt;&lt;a href="" &gt;Fourth&lt;/a&gt; &lt;ul class="dropdown-menu"&gt; &lt;li class="item-125"&gt;&lt;a class="data-toggle="dropdown" data-hover="dropdown" data-delay="1000" href="/" &gt;Last&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre> <p>P.S. actually I don't want to use a jQuery. It's better to override menu render.</p>
    singulars
    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.
 

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