1

I've looked in the existing post I couldn´t really find an answer..

So my question is simple : I already have a "Home" menu before all my menu, but this is a simple text. I'd like to put Font awesome icon, or at least a picture but the title of the category doesn't allow to put image or any code.

    <?php $_menu = $this->getHtml('level-top') ?>
<?php if($_menu): ?>
<div class="nav-container">
    <ul id="nav">
        <?php echo $_menu ?>
    </ul>
</div>
<?php endif ?>

How could I put a icon before all of my menus ?

Thanks a lot

EDIT : does the file to edit is find in the here : app/design/frontend/default/theme/template/page/html ??

I edited topmenu.phtml with this but nothing shows up ... and i did the same for top.phtml..

   <ul id="nav">
<li class="first home"><a href="<?php echo $this->getUrl('home') ?>">Home</a></li>
    <?php echo $_menu ?>
</ul>
  • You can use css to add your desired icons. Please provide a link or screenshot what you exactly require. – Adarsh Khatri May 10 '15 at 6:02
  • Ok so I did all of this and it works, but not with my module. www.ch-test.com check it out. So how can you guide me do to the exact same thing but in the module thing ? Thanks in advance a lot EDIT : sorry for the double post – Jérome Borga May 26 '15 at 19:18
1

You need to make note of which package and theme you are using and edit the file according to what ever it is set to in the admin backend (System -> Configuration -> Design - package + themes).

The file to edit is: app/design/frontend/[PACKAGE]/[THEME]/template/page/html/topmenu.phtml as you mentioned above so that it looks like:

<?php $_menu = $this->getHtml('level-top') ?>

<?php if($_menu): ?>
    <nav id="nav">
        <ol class="nav-primary">
            <li class="first home"><a href="<?php echo $this->getUrl('home') ?>">Home</a></li>
            <?php echo $_menu ?>
        </ol>
    </nav>
<?php endif ?>

Then you can edit the css in order to get the image to show in:skin/frontend/[PACKAGE]/[THEME]/css/styles.css

Once thats done, be sure to clear the Magento cache in order for the changes to appear.

  • Ok thanks for all of this, i'll come back to you if it works or not :) – Jérome Borga May 10 '15 at 13:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.