user991830
user991830

Reputation: 894

joomla add html to menu link title

Hopefully a simple one...

I want to add the following inside a Joomla (v2.5.4) menu link along with the link text:

<i class="icon-book"></i>

Like this:

<li>
 <a href="page-name.html"><i class="icon-book"></i> Library</a>
</li>

I have tried putting the above tag inside the menu title as html, but joomla won't hold/save it and strips it out.

Any help/ideas?

Thanks

Upvotes: 2

Views: 2013

Answers (1)

Craig
Craig

Reputation: 9330

Joomla won't allow any tag's in the menu title, even HTML encoded (i.e. & lt; etc). To do it the way you're wanting to you would have to use a third-party menu system that support it - there are lots around that do, you can have a look at Menu Systems section of the Joomla! Extensions Directory.

Otherwise, in Joomla! you can use the parameters in "Link type Options" panel.

In this case you can assign a class to the <a> tag by putting aCSSClass in the "Link CSS Style" parameter. Then your <a> tag will render as <a class="aCSSClass" href=...

Then you can define the class in your templates CSS file and do what you want.

Upvotes: 1

Related Questions