Page 1 of 1

Extra links in header.tpl

Posted: Fri Aug 28, 2015 5:27 pm
by uwe_kwigx
Hello,
i recently installed OpenCart and managed to modify an extension which added a "Home" Button to the Top Menu Bar. I now could just modify this with several Link titles which i wanted to put in the top menu and just install it as an extension in OpenCart.

But there must be an easier way. The header.tpl code in catalog/view/theme/default/template/common is really long and i couldnt managed to put a simple code inside so it appeared in the right way on the top menu bar. After which line can i add my links?

This is the modification which i use to add Links to the top menu bar.

Code: Select all

    <file path="catalog/view/theme/*/template/common/header.tpl">
		<operation>
			<search ><![CDATA[<ul class="nav navbar-nav">]]></search>
			<add position="after"><![CDATA[<li><a href=" MY LINK "> LINK TITLE </a></li>]]></add>
		</operation>
	</file>

Re: Extra links in header.tpl

Posted: Sat Aug 29, 2015 1:00 am
by viethemes
I see that your code will add a link befire the first menu item in Top Menu :)

Re: Extra links in header.tpl

Posted: Mon Aug 31, 2015 4:35 pm
by uwe_kwigx
viethemes wrote:I see that your code will add a link befire the first menu item in Top Menu :)
Exactly, but where can i place this lines in header.tpl to add links without this extension?

Re: Extra links in header.tpl

Posted: Mon Aug 31, 2015 5:00 pm
by OSWorX
There are many extensions (paid and free) which will add links you want:
https://www.opencart.com/index.php?rout ... der%20menu

Re: Extra links in header.tpl

Posted: Mon Aug 31, 2015 7:48 pm
by Venkko
HI!

If I have undestand your question correctly, you have your answer on your modification code.
Exactly, but where can i place this lines in header.tpl to add links without this extension?

Code: Select all

<search ><![CDATA[<ul class="nav navbar-nav">]]></search>
         <add position="after"><![CDATA[<li><a href=" MY LINK "> LINK TITLE </a></li>]]></add>
On the code above it says that search "ul class="nav navbar-nav" and add after that line "<li><a href=" MY LINK "> LINK TITLE </a></li>"

Isn't this the one that you where asking?

Re: Extra links in header.tpl

Posted: Thu Sep 03, 2015 4:02 pm
by uwe_kwigx
OSWorX wrote:There are many extensions (paid and free) which will add links you want:
https://www.opencart.com/index.php?rout ... der%20menu
This is what i searched - thank you!

Custome opencart header menu free

Re: Extra links in header.tpl

Posted: Thu Oct 22, 2015 6:31 am
by InfiniteDezigns
Found exactly where this was supposed to go. Unfortunately it no longer works in Opencast 2.0.3.1. What happened?