Actions

J2.5

Difference between revisions of "How to add a span element to menu entries"

From Joomla! Documentation

(New page: {{JVer|1.6}} To add a span element to your menu items in Joomla 1.6, you have to override the layout for mod_menu. You can follow the general approach described in [[How to override the ou...)
 
Line 1: Line 1:
{{JVer|1.6}}
+
= Joomla 1.6 and newer {{JVer|1.6}}{{JVer|1.7}} =
To add a span element to your menu items in Joomla 1.6, you have to override the layout for mod_menu. You can follow the general approach described in [[How to override the output from the Joomla! core]].
+
To add a span element to your menu items, you have to override the layout for mod_menu. You can follow the general approach described in [[How to override the output from the Joomla! core]].
  
 
You need to override the following layout from mod_menu:
 
You need to override the following layout from mod_menu:
Line 21: Line 21:
  
 
And you're done.
 
And you're done.
 +
 +
= Joomla 1.5 {{JVer|1.5}} =
 +
A span element is present by default so there is no need to add it manually.
  
 
[[Category:FAQ]]
 
[[Category:FAQ]]
 
[[Category:Version 1.6 FAQ]]
 
[[Category:Version 1.6 FAQ]]
 +
[[Category:Version 1.7 FAQ]]
 
[[Category:Template Development]]
 
[[Category:Template Development]]

Revision as of 07:36, 23 August 2011

Joomla 1.6 and newer Joomla 1.6Joomla 1.7

To add a span element to your menu items, you have to override the layout for mod_menu. You can follow the general approach described in How to override the output from the Joomla! core.

You need to override the following layout from mod_menu:

  • defult_url.php
  • default_component.php

After copying the files into your template (see How to override the output from the Joomla! core for details) do the following:

In both these files look for the following statement:

<?php echo $linktype; ?>

It should occur three times in both files.

Replace each of these with:

<span><?php echo $linktype; ?></span>

And you're done.

Joomla 1.5 Joomla 1.5

A span element is present by default so there is no need to add it manually.