Configurable header tag type
1 post
• Page 1 of 1
Configurable header tag type
I wanted to be able to use a header tag different from h2, so I made the following patch (to v1.2.6). While I was making the changes, I found that the program xmap.php tries to load the 'sitemap' parameter from the xmap menu item but the metadata.xml file is only configured to include this value in the url and not as a parameter. I changed this file so that both the existing parameter 'sitemap' and the new one I added for the header tag type are both stored as parameters. With this patch, the type of tag used for headers on the page can be configured from a drop down list but defaults to the currently hard coded value.
The code change I made to xmap.html.php was as follows:
After:
(around line 22) add:
After
(around line 25) add
Around line 250, replace
with
Attached is a zip with the revised metadata.xml file and the patched program file
Regards
Phil
The code change I made to xmap.html.php was as follows:
After:
- Code: Select all
var $_isAdmin = 0;
(around line 22) add:
- Code: Select all
var $_header_type;
After
- Code: Select all
function XmapHtml (&$config, &$sitemap) {
(around line 25) add
- Code: Select all
global $Itemid;
$menu = JSite::getMenu();
$menuparams = $menu->getParams( $Itemid );
$this->_header_type = $menuparams->get('header_type', 'h2');
Around line 250, replace
- Code: Select all
echo '<h2 class="menutitle">'.$menu->name.'</h2>';
with
- Code: Select all
echo '<'.$this->_header_type.' class="menutitle">'.$menu->name.'</'.$this->_header_type.'>';
Attached is a zip with the revised metadata.xml file and the patched program file
Regards
Phil
- Attachments
-
xmap_patch_header_type.zip- (3.89 KiB) Downloaded 358 times
- doorknob
- Junior Boarder

- Posts: 27
- Joined: Thu Aug 07, 2008 9:30 pm
1 post
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 0 guests