I have v1.5.1.3 of OpenCart and want to be able t o put links that direct to a another age on the site. I was it to be located on the top menu bar which is the catalog bar.
Alternatively if i can possibly duplicate that bar, 1 bar would be for products etc (default), the other bar below would contain the links to other pages.
Thanks
Alternatively if i can possibly duplicate that bar, 1 bar would be for products etc (default), the other bar below would contain the links to other pages.
Thanks
Look in your header.tpl file and find the menu:
Copy it and change to something like this:
Put this below your original menu and you should have two. Be sure to back up the file first just in case there are any problems.
Code: Select all
<div id="menu">
<ul>
<?php foreach ($categories as $category) { ?>
<li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
<?php if ($category['children']) { ?>
<div>
<?php for ($i = 0; $i < count($category['children']);) { ?>
<ul>
<?php $j = $i + ceil(count($category['children']) / $category['column']); ?>
<?php for (; $i < $j; $i++) { ?>
<?php if (isset($category['children'][$i])) { ?>
<li><a href="<?php echo $category['children'][$i]['href']; ?>"><?php echo $category['children'][$i]['name']; ?></a></li>
<?php } ?>
<?php } ?>
</ul>
<?php } ?>
</div>
<?php } ?>
</li>
<?php } ?>
</ul>
</div>
Code: Select all
<div id="menu">
<ul>
<li>Link1</li>
<li>Link2</li>
<li>Link3</li>
</ul>
</div>
I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1
Put the second bit of code under the first bit of code.
I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1
The css styles will be identical if you follow the same structure and use:
The text will be coloured, styled and spaced exactly as the css for the other menu listed links.
Code: Select all
<div id="menu">
<ul>
<li><a href="your link address">LINK 1</a></li>
<li><a href="next link address">LINK 2</a></li>
<li><a href="and the next one">LINK 3</a></li>
</ul>
</div>
Genuine, Honest Opencart Support @ http://webvetservices.com
Thanks for this. I did it at shop.mangotreeuganda.org but it is only showing on the homepage. Other pages revert to previous layout. Any idea where I'm going wrong? I'm sure its obvious to many people here but not to a newbie like me.
Thanks
S
Thanks
S
@ste_barrett
If you are using a standard Opencart set-up and place the code in the catalog/view/theme/*/template/common/header.tpl file it will be called on ALL pages.
If you have put it in this file and it isn't displaying then your theme may be doing odd things... If it is then I suggest you approach the theme designer!
If you are using a standard Opencart set-up and place the code in the catalog/view/theme/*/template/common/header.tpl file it will be called on ALL pages.
If you have put it in this file and it isn't displaying then your theme may be doing odd things... If it is then I suggest you approach the theme designer!
Genuine, Honest Opencart Support @ http://webvetservices.com
Who is online
Users browsing this forum: No registered users and 85 guests