Post by Saile » Thu Jan 19, 2012 8:21 am

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

Active Member

Posts

Joined
Thu Jan 19, 2012 8:19 am

Post by philbydevil » Thu Jan 19, 2012 3:42 pm

Look in your header.tpl file and find the menu:

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>
Copy it and change to something like this:

Code: Select all

<div id="menu">
<ul>
<li>Link1</li>
<li>Link2</li>
<li>Link3</li>
</ul>
</div>
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.

I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by Saile » Thu Jan 19, 2012 3:55 pm

thanks for reply.

is there anyway i can duplicate it?

Active Member

Posts

Joined
Thu Jan 19, 2012 8:19 am

Post by philbydevil » Thu Jan 19, 2012 4:08 pm

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


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by Saile » Thu Jan 19, 2012 5:06 pm

i tryed that but its not an exact duplicate. The text isnt spaced, wrong colors etc. Its not a complete duplicate.

Active Member

Posts

Joined
Thu Jan 19, 2012 8:19 am

Post by webvet » Thu Jan 19, 2012 5:48 pm

The css styles will be identical if you follow the same structure and use:

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>
The text will be coloured, styled and spaced exactly as the css for the other menu listed links.

Genuine, Honest Opencart Support @ http://webvetservices.com


User avatar
Active Member

Posts

Joined
Thu May 14, 2009 2:04 am
Location - Shropshire, UK

Post by Saile » Fri Jan 20, 2012 5:10 am

oh that did it! Great! thanks

When you click top bar though, it expands over the second bar.

Is it possible maybe to put that bar on the left or right?

Active Member

Posts

Joined
Thu Jan 19, 2012 8:19 am

Post by ste_barrett » Fri Apr 27, 2012 7:03 pm

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

Newbie

Posts

Joined
Mon Apr 16, 2012 8:25 pm

Post by webvet » Fri Apr 27, 2012 10:59 pm

@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!

Genuine, Honest Opencart Support @ http://webvetservices.com


User avatar
Active Member

Posts

Joined
Thu May 14, 2009 2:04 am
Location - Shropshire, UK
Who is online

Users browsing this forum: No registered users and 85 guests