Post by Dubblicious » Tue Jul 05, 2011 8:41 am

Hi everyone.
Using v1.5.0.5 fresh install.
I have a main website that my store is part of. I would like to have a link to home page on the menu bar. Does anyone have a solution for this ?
thanks in advance.
Last edited by Dubblicious on Wed Jul 06, 2011 4:32 am, edited 1 time in total.

User avatar
New member

Posts

Joined
Tue Jun 14, 2011 2:35 pm

Post by rph » Tue Jul 05, 2011 2:36 pm

Have you tried manually adding it to the default header.tpl template?

-Ryan


rph
Expert Member

Posts

Joined
Fri Jan 08, 2010 5:05 am
Location - Lincoln, Nebraska

Post by Dubblicious » Tue Jul 05, 2011 3:33 pm

rph wrote:Have you tried manually adding it to the default header.tpl template?
No I haven't. I am not familiar with PHP , is that in the common folder, or product folder ? Do I add a link with regular html code ?

User avatar
New member

Posts

Joined
Tue Jun 14, 2011 2:35 pm

Post by SXGuy » Tue Jul 05, 2011 4:44 pm

edit catalog/view/theme/yourtheme/template/common/header.tpl

Find <div id="menu">

Find the next <ul>
Add below

<li><A href="<?php echo $home; ?>"><?php echo $text_home; ?></a></li>

That should work.

Active Member

Posts

Joined
Sun Nov 08, 2009 2:07 am

Post by Dubblicious » Wed Jul 06, 2011 1:23 am

SXGuy wrote:edit catalog/view/theme/yourtheme/template/common/header.tpl

Find <div id="menu">

Find the next <ul>
Add below

<li><A href="<?php echo $home; ?>"><?php echo $text_home; ?></a></li>

That should work.
Thanks for replying to this thread, I am completely new to PHP and opencart. Where in that code do I place my link ? Also I am assuming that the text_home is the text on the nav bar itself, do I need to change to text_Home if I want it capitalized? One other thing please; if I want that link to be on the far right of the nav bar am I right that it should be after the last <ul>.

User avatar
New member

Posts

Joined
Tue Jun 14, 2011 2:35 pm

Post by kostijn » Wed Jul 06, 2011 1:54 am

Thanks, this helped me a lot as well, I made another solution but this one is way leaner! Thanks!

Newbie

Posts

Joined
Tue Jul 05, 2011 3:20 pm

Post by kostijn » Wed Jul 06, 2011 2:00 am

@dubblicious - In the solution posted, clicking on home will now have the same effect as clicking on your logo.

Newbie

Posts

Joined
Tue Jul 05, 2011 3:20 pm

Post by Dubblicious » Wed Jul 06, 2011 2:30 am

kostijn wrote:@dubblicious - In the solution posted, clicking on home will now have the same effect as clicking on your logo.
That would bring back to the store home not my main site home page, so this is not the solution I am looking for then is it.

User avatar
New member

Posts

Joined
Tue Jun 14, 2011 2:35 pm

Post by kostijn » Wed Jul 06, 2011 3:27 am

OK, then you need to add this after the <ul>:

<li><A href="http://www.google.com">google</a></li>

Google is just the example here, so change google into whatever you homepage is.

Newbie

Posts

Joined
Tue Jul 05, 2011 3:20 pm

Post by Dubblicious » Wed Jul 06, 2011 4:30 am

kostijn wrote:OK, then you need to add this after the <ul>:

<li><A href="http://www.google.com">google</a></li>

Google is just the example here, so change google into whatever you homepage is.
That did the job, thank you for the solution. :D

User avatar
New member

Posts

Joined
Tue Jun 14, 2011 2:35 pm

Post by defiantclass » Tue Aug 23, 2011 1:55 am

How would you add multiple additional items via these methods?

I only had 1 item in my menu which was my Category name. Using this method I added the Home item as suggested above. I then attempted to add the link to another site of mine (like suggested above using Google) but what happened was it displayed my site as a link on top of my Catalog, which was also turned into a link.

So I had Home in bold, and then to the right of it I had my Site link on top of a Category link.

I'd like to have Home Category Site all with the same font size, color, and without the underlined link style, if this is possible???

Thanks a lot.

New member

Posts

Joined
Mon Jul 11, 2011 6:48 am

Post by PetracheNicolae » Mon Sep 05, 2011 4:39 am

SXGuy wrote:edit catalog/view/theme/yourtheme/template/common/header.tpl

Find <div id="menu">

Find the next <ul>
Add below

<li><A href="<?php echo $home; ?>"><?php echo $text_home; ?></a></li>

That should work.
thanks for this

New member

Posts

Joined
Tue May 24, 2011 5:40 am

Post by storm-cloud » Thu Feb 23, 2012 9:52 pm

I know this an older thread but I was also interested in the same function but I found adding...

Code: Select all

<li><A href="<?php echo $home; ?>"><?php echo $text_home; ?></a></li>
... as suggested broke W3C validation. Some may not worry about this but I think it is nice to keep the markup valid.

So instead I hardcoded the URL into the header template as...

Code: Select all

 <li><a href="http://www.mywebsite.com.au/">Home</a></li>
Then had valid markup again. ;D

Active Member

Posts

Joined
Wed Feb 22, 2012 8:07 am

Post by hudbarnett » Fri Nov 02, 2012 10:26 pm

This is a great help, i was wondering how to add home to the menu.

Is it possible to do the same with the about us page?

i did try playing about with the line of code but couldn't get it to work.

thanks

hudbarnett

New member

Posts

Joined
Thu Mar 29, 2012 9:46 pm
Who is online

Users browsing this forum: No registered users and 14 guests