Magento – Some links in the navigation / URL in Nav bar

Who set in the navigation bar at his Magentoshop more links möchste, can do this either by categories, than the static blocks are set to do something or free, by the file in the folder top.phtml

app / design / frontend /[base or default]/[IhrTemplate]/template/catalog/navigation

is adapted.

Picture

Picture

For this purpose the area

<?php $_menu = $this->renderCategoriesMenuHtml(0,'level-top') ?>

<?php if($_menu): ?>

<div class ="nav-container">

<ul id ="not">

<?php echo $_menu ?>

</Street>

</div>

<?php endif ?>

to

<?php $_menu = $this->renderCategoriesMenuHtml(0,'level-top') ?>

<?php if($_menu): ?>

<div class ="nav-container">

<ul id ="not">

<li class="level0"><a href="http://www.IhrLink.com/"><span>IhrLink</span></a></li>

<?php echo $_menu ?>

</Street>

</div>

<?php endif ?>

change, by the line

 

<li class="level0"><a href="http://www.IhrLink"><span>IhrLink</span></a></li>

 

is inserted. If an internal link shop to be installed, is not to be static, can also be carried out as follows:

 

<li><a href = / IhrLink /><span>IhrLink</span></a></li>

 

This is important to be careful, that the “” are no longer available.

It plays a role, whether the line before or after <?php echo $_menu ?> is inserted. The link is then either before or after the shop own links.

Addendum dated 08.05.2018:

From Magento 1.9 and there in the use of the RWD topmenu.phtml in the / skin / frontend / rwd / default / css want to change file can be. This is basically the same structure but.

As another option, I would like to point out, it is of course possible instead of static links like o.g. incorporate a static block, so you can easily change the backend the links. This is a little more flexible, however, it may also cause problems still.

For this I refer to the article “Install static block in PHTML pages“. Is important to note:

Here is the updated topmenu.phtml (or top.phtml) then in parts e.g.. like this

        <ol class="nav-primary">
            <?php echo $_menu ?>
            <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('nav-links')->toHtml() ?>
        </ol>

So Magento expected

<li>Links</li>

in the static block. Using the WYSIWYG editor of Magento, this is always automatically when you save a

<Street>

before and also set the respective closing behind. but this can cause display problems, because thus in the navigation so this will be integrated into the existing list. So you have to look, how best to implement this. By the way, is taken at the first store still the version without the ul. Until the next save ul are then added to the Code. So you can remove them when saving each and must always pay attention, that this also then and then and then doing…. or to disable the WYSIWYG editor in Magento simply by default.

Possible CSS adjustments and the allocation of CSS classes are also more feasible and possibly. necessary.

Used in Magento 1.4-1.9

Published by Covos

Since 2009 I have been working intensively with Magento. I started with the creation and operation of B2C stores. This was extended through my work in the logistics sector. This resulted first specialized B2E systems. Today I work day-a day with exciting B2C, B2B- and B2E projects and reports in this blog about challenges and give insider tips.

6 comments on “Magento – Some links in the navigation / URL in Nav bar”

  1. Do you have an idea, how the Navileiste at about 800 Pixels can be separated, to insert a link, has a completely different background image?

  2. That should not be a problem ansich, However, I would need a few more details. Can you send me a brief email contact. Best with the actual page URL and a description of what and where to.

  3. Great post. Thank you very much. Works flawlessly on 1.7.0.2. Who does not wish to lend a hand or have to change their links often times, I can only Menu Builder (http://store.nvncbl.com/) recommend.
    You can move comfortably in the back left, Create etc. But only 1 bus 2 Links are of course not worth.
    Thanks again.

  4. Super, thank you!
    In my (1.7.0.2) was located the relevant file under topmenu.phtml:
    app/design/frontend/base/default/template/page/html

Leave a Reply

Your email address will not be published. Required fields are marked *