Page 1 of 1

add page to header menu

Posted: Sat Jun 18, 2011 11:12 pm
by alexdog1805
I want to add a page from information column too header menu.

What should I do?

Re: add page to header menu

Posted: Sun Jun 19, 2011 12:35 am
by SXGuy
edit catalog/view/theme/yourtheme/template/common/header.tpl

find menu div

add after the first <ul>
<li><a href="yoursite.com/yourpage">Page Name</a></li>

Re: add page to header menu

Posted: Mon Jul 18, 2011 5:08 am
by dee-efx
Hi, I have followed the steps above and they worked brilliant. The only thing is you will have to change the width in style.css otherwise the links will not fit in. I changed by to 900px and it works great.

I still need help with this though
I was wondering if anyone knew how to change toe colour of the menu item if it is selected, It works okay for the default items like home login etc etc but I cant get it to work for Events and Work shops. Can anyone help. Code from header.tpl below

<div class="div5">
<div class="left"></div>
<div class="div4"><a href="<?php echo str_replace('&', '&', $home); ?>" id="tab_home"><?php echo $text_home; ?></a>
<?php if (!$logged) { ?>
<a href="<?php echo str_replace('&', '&', $login); ?>" id="tab_login"><?php echo $text_login; ?></a>
<?php } else { ?>
<a href="<?php echo str_replace('&', '&', $logout); ?>" id="tab_logout"><?php echo $text_logout; ?></a>
<?php } ?>
<a href="<?php echo str_replace('&', '&', $account); ?>" id="tab_account"><?php echo $text_account; ?></a><a href="<?php echo str_replace('&', '&', $cart); ?>" id="tab_cart"><?php echo $text_cart; ?></a><a href="<?php echo str_replace('&', '&', $checkout); ?>" id="tab_checkout"><?php echo $text_checkout; ?></a>
<a href="http://MYSTORE/store/index.php?route=in ... >Events</a>
<a href="http://MYSTORE/store/index.php?route=in ... id=7">Work Shops</a></div>





Darren

Re: add page to header menu

Posted: Mon Jul 18, 2011 8:22 am
by Maansy
copying this code from v.1.4.8b:

Code: Select all


<script type="text/javascript"><!-- 

$(document).ready(function() {
	route = getURLVar('route');
	
	if (!route) {
		$('#tab_home').addClass('selected');
	} else {
		part = route.split('/');
		
		if (route == 'common/home') {
			$('#tab_home').addClass('selected');
		} else if (route == 'account/login') {
			$('#tab_login').addClass('selected');	
		} else if (part[0] == 'account') {
			$('#tab_account').addClass('selected');
		} else if (route == 'checkout/cart') {
			$('#tab_cart').addClass('selected');
		} else if (part[0] == 'checkout') {
			$('#tab_checkout').addClass('selected');
		} else {
			$('#tab_home').addClass('selected');
		}
	}
});
//--></script>


Re: add page to header menu

Posted: Fri Oct 19, 2018 9:49 pm
by StormDesigner
I found this old thread from 2011 in 2018 and we're on 3.0.2.0, It might be great if OC can get a "Top Menu" check box for info pages but I found my simple and I think effective workaround.
I'm creating Empty Categories, Selecting "Top Menu" & treating them as Information pages. Done.
Any questions?
One issue that is obvious with this approach is that you need to be able to tolerate having these categories appear in the sidebar menu with (0) product counts. Hmm, guess it's not perfect. I need to find a twig to edit or does anyone know of a plug-in that might provide better top menu control?

Re: add page to header menu

Posted: Sat Oct 20, 2018 2:30 am
by StormDesigner
I figured it out for Version 3.x (10/2018) in Admin, Design > Theme Editor > Common > menu.twig - Add items to link to in standard HTML JUST BEFORE the closing </UL> tag at the bottom of the default (and very brief) file. Worked like a charm, easy to get to.

Re: add page to header menu

Posted: Wed Nov 14, 2018 3:36 am
by johnp

Re: add page to header menu

Posted: Mon Oct 07, 2019 7:18 am
by decmah
The problem with that menu editor is though that it does not compute for version 3.0.3.2!
I have been on this opencart idea since 2 days' ago, which does not sound like a lot, but I've already been through the months of thinking about all of the options and finally decided on opencart, so these 2 full days were simply to start developing a website by downloading the latest version on the downloads page and getting on with it... Then I miraculously found a downloadable theme with my exacting requirement {which I thought may take days to find} , so I installed that to a load of error messages, thinking back I realized it's because that theme does not support latest version, so now I am trying to decide whether I should go the 2 or 3 route, oh but then there is 3.1 probably going to come the day after I have bit the bullet and wasted x time :crazy:
{will it matter? will both 2 or 3 migrate into 3.1 the same? will 3.1 be a buggy mess for 2 years so I don't need to care?
I wish I didn't have to care, but I need to know!! :laugh: }

Re: add page to header menu

Posted: Tue Oct 08, 2019 3:55 am
by johnp

Re: add page to header menu

Posted: Thu Oct 10, 2019 7:38 am
by IP_CAM
will 3.1 be a buggy mess for 2 years so I don't need to care? I wish I didn't have to care, but I need to know!!
You seem to expect more, than you probably will get, I fear. And it all depends on your Code
Knowledge as well, because Opencart is a continuing Development, and it's NOT consisting
out of so-called 'final' Releases. It only changes Version Numbers, after a range of 'important'
changes have been made, and so basically starts from Scratch again, with every 'latest' Version
released. It's one good reason, why it comes for free, because otherways, they would be fools,
to share their knowledge and hard work, just to one day get a better place in heaven ... :laugh:
And since OC only consists out of a few People, they have just not the capabilities, to test everything
from a to z.

And since OC is Open Source, every Mod + Theme Creator is free, to do his/her own things with OC.
And as a consequence of that, some OC Extensions might not function, in combination with other
Extensions or Themes, as they come by defaut. It therefore all depends on how much 'basic'
knowledge one has, to make OC work as planned, if one uses anything, not part of a Default OC
Installation. And it's also advised, to first check, which OC Version is already known, to belong
to the most solid Releases, and/or then, if possibly some 'private' Editions exist, already equipped
with a range of important fixes, in order to avoid possible problems, where Solutions already exist,
like those:

https://github.com/IP-CAM/Opencart-1.5.6.5-Edge
https://github.com/IP-CAM/Opencart_2302
https://github.com/IP-CAM/Opencart_3020

And better don't argue about it, but take it, as it comes, as long as it comes for free! ;)
Nobody else would care about anyway. :laugh:

Good Luck, no offense, nothing personal, just plain information.
Ernie