Post by avorob » Sun Sep 20, 2015 12:34 am

Is there a way to add a non-directory link to main navigation bar?
Thanks.

New member

Posts

Joined
Mon Sep 14, 2015 10:07 pm

Post by IP_CAM » Sun Sep 20, 2015 12:50 am


Please don't send me OC Forum Personal Messages, just contact: jti@jacob.ch
---
OC 1.5.6.5 LIGHT Test Site: http://www.bigmax.ch/shop/
OC 1.5.6.5 V-PRO Test Site: http://www.openshop.li/shop/
My Github OC Site: https://github.com/IP-CAM
2'600+ FREE OC Extensions on the World's largest Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by agatha65 » Sun Sep 20, 2015 1:00 am

If you want to add specific information page you can use my extension
Selected information pages, links in top menu-Many combinations
To add all information pages or pages not in footer use this
Information pages and/or footer links in the top menu - vQmod

If you want to add static link(not multi language, not multi store) you can add it directly in the menu in the header.tpl file, or better with ocmod or vqmod.

Print Version for Product Page and Product Compare Page | Rich Snippets | Facebook Open Graph Meta Tags | Information pages in top menu | Multi-Language Banners, Sliders and Carousels
Image


User avatar
Active Member

Posts

Joined
Fri Mar 16, 2012 10:18 am
Location - Canada, QC

Post by avorob » Sun Sep 20, 2015 6:48 am

Thanks Ernie,
For the sake of not making too many modifications to code I just added info page as a product category and change layout as Information. Only drawback is that the link is showing in the list of directories on the left and the page showing copy "there are no products in this category"

Agatha,
What is the difference between
v2-OCMOD and v2-vQmod I might try those.

Thx

New member

Posts

Joined
Mon Sep 14, 2015 10:07 pm

Post by IP_CAM » Tue Sep 22, 2015 1:41 am

This is how I do it, in such cases:
OpenCart v.1.5.6.x
c:\JTI_Servers\openshop.li\cart\catalog\view\theme\default\template\common\header.tpl

Code: Select all

<?php if ($categories) { ?>
<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 style="text-align:left;" />
        <?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 } ?>
<li><a href="http://www.whatever.com/testfile.html" title="Blog Articles" target="_blank">Blog Articles</a></li>
  </ul>
</div>
<?php } ?>
so, in OC2, adding this:
<li><a href="http://www.whatever.com/testfile.html" title="Blog Articles" target="_blank">Blog Articles</a></li>
would look like this:

Code: Select all

<?php if ($categories) { ?>
<div class="container">
  <nav id="menu" class="navbar">
    <div class="navbar-header"><span id="category" class="visible-xs"><?php echo $text_category; ?></span>
      <button type="button" class="btn btn-navbar navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse"><i class="fa fa-bars"></i></button>
    </div>
    <div class="collapse navbar-collapse navbar-ex1-collapse">
      <ul class="nav navbar-nav">
        <?php foreach ($categories as $category) { ?>
        <?php if ($category['children']) { ?>
        <li class="dropdown"><a href="<?php echo $category['href']; ?>" class="dropdown-toggle" data-toggle="dropdown"><?php echo $category['name']; ?></a>
          <div class="dropdown-menu">
            <div class="dropdown-inner">
              <?php foreach (array_chunk($category['children'], ceil(count($category['children']) / $category['column'])) as $children) { ?>
              <ul class="list-unstyled">
                <?php foreach ($children as $child) { ?>
                <li><a href="<?php echo $child['href']; ?>"><?php echo $child['name']; ?></a></li>
                <?php } ?>
              </ul>
              <?php } ?>
            </div>
            <a href="<?php echo $category['href']; ?>" class="see-all"><?php echo $text_all; ?> <?php echo $category['name']; ?></a> </div>
        </li>
        <?php } else { ?>
        <li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a></li>
        <?php } ?>
        <?php } ?>
<li><a href="http://www.whatever.com/testfile.html" title="Blog Articles" target="_blank">Blog Articles</a></li>
      </ul>
    </div>
  </nav>
</div>
<?php } ?>
Good Luck ;)
Ernie
openshop.li/cart/

Attachments

OC_external_menu_href_link.jpg

external OpenCart href Menu Link - OC_external_menu_href_link.jpg (77.9 KiB) Viewed 3761 times


Please don't send me OC Forum Personal Messages, just contact: jti@jacob.ch
---
OC 1.5.6.5 LIGHT Test Site: http://www.bigmax.ch/shop/
OC 1.5.6.5 V-PRO Test Site: http://www.openshop.li/shop/
My Github OC Site: https://github.com/IP-CAM
2'600+ FREE OC Extensions on the World's largest Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by IP_CAM » Tue Sep 22, 2015 2:04 am

avorob wrote:What is the difference between v2-OCMOD and v2-vQmod I might try those.
Basically, NONE. They do the same, namely, using some MARKERS/TAGS, in the Source, to add/replace/remove something, by adding ADDITIONS, to existing Source Code, and create a 'workable' Template-Temp File WITH the 'Result' of such Doings.

But, if you use 'em both, they both sometimes try to do the SAME, using a COMMON MARKERS/TAG, to achieve something. And this is, in most cases, not so good, because, ONE is NOT prepared, possibly, to FIND/HANDLE such already modified Code, instead of the expected one, very well... :-\

Very generally spoken... :D
Ernie
openshop.li/cart/

Please don't send me OC Forum Personal Messages, just contact: jti@jacob.ch
---
OC 1.5.6.5 LIGHT Test Site: http://www.bigmax.ch/shop/
OC 1.5.6.5 V-PRO Test Site: http://www.openshop.li/shop/
My Github OC Site: https://github.com/IP-CAM
2'600+ FREE OC Extensions on the World's largest Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland
Who is online

Users browsing this forum: No registered users and 6 guests