Adding an additional Horizontal menu line in a Joomla 2.5 Artisteer template
(found on the Artisteer Forum “http://www.artisteer.com/?post_id=172761&p=forum_post&forum_id=20“)So, we want to create 2 horizontal menus.
Our plan is to create a new position for a second menu which is similar to the first position.
1.
Open a folder with your template (…/joomla/templates/yourtemplatename) and open file index.php
In this file with ctrl+F find words “art-nav”.
This part charges for horizontal menu.
Copy strings from this moment till a string:
<div></div>
So in your file the strings are next:
<div>
<div></div>
<div></div>
<div>
<?php if ($view->containsModules(‘extra1’)) : ?>
<div><?php echo $view->position(‘extra1’); ?></div>
<?php endif; ?>
<?php if ($view->containsModules(‘extra2’)) : ?>
<div><?php echo $view->position(‘extra2’); ?></div>
<?php endif; ?>
<?php echo $view->position(‘user3’); ?>
</div>
</div>
Past it right after <?php endif; ?>
Then you can delete not necessary strings (see below) and change a name of first position (user3) to any new name.
I named it “test”.
So copied and pasted part will look next way:
<div>
<div></div>
<div></div>
<div>
<?php echo $view->position(‘test’); ?>
</div>
</div>
Save this file and close.
2.
Open folder html/mod_mainmenu and file default.php
With ctrl+F find “user3” and right after “user3” add new condition:
|| $attribs[‘name’] == ‘test’
So the whole “if” condition will look next way:
if (isset($attribs[‘name’]) && $attribs[‘name’] == ‘user3’ || $attribs[‘name’] == ‘test’)
Save and close this file.
3.
Do the same operations with file html/mod_menu/default.php
Save it.
4.
Now we have to add this created position to a list of positions.
In your template folder open file templateDetails.xml and in the end find list of positions and add this new.
So just add string
<position>test</position>
5.
Open your Joomla Administration Panel.
Open Extensions-Module Manager, create new menu, call it for example “Second Menu” (press “hide” the name) and in the field “position” select position “test”.
Module Assignment – All pages.
Press “Toogle Selection”.
Basic Options: Select Menu – Top
and Save it.
Then you can open your website and check is everything right.