Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Second menu between My Account - Log In and the categories menu bar
 
iMaster
Member
 
Avatar
Total Posts:  37
Joined:  2008-06-25
 

Hello,
I would like to create a menu on my site with a link to my home page, contact us, about us and faq.

I would like to create this extra bar above my categories bar, or under my My Account - Log In menu.

Any ideas would be greatly appreciated.

Thank You
iMaster

 
Magento Community Magento Community
Magento Community
Magento Community
 
Smallblock
Jr. Member
 
Total Posts:  24
Joined:  2008-06-25
 

I was able to do something similar by adding a few lines to the page.xml file in the layout folder for my theme.

In the default section there under the line that says

<block type="page/html_header" name="header" as="header">

I added a line that would insert the new menu that you’re talking about. Mine looked like this, of course yours would use a different path and filename…

<block type="page/template_links" name="main_site_links" as="main_site_links" template="page/template/main_site_links.phtml"/>

This will put the menu into the header, and you’ll have to handle the positioning from there to make it work how you want it.

Once that was in I just had to define the menu in a phtml file in the page template folder. I used a list wrapped in a div so it ended up looking something like this -

<div id="main_site_links_div">
    <
ul id="main_site_links_list">
        <
li><a href="<?php echo MAIN_SITE_PREFIX; ?>/index.php">Home</a></li>
        <
li><a href="<?php echo MAIN_SITE_PREFIX; ?>/products.php">Products</a></li>
        <
li><a href="<?php echo MAIN_SITE_PREFIX; ?>/support.php">Support</a></li>
        <
li><a href="<?php echo MAIN_SITE_PREFIX; ?>/dealers.php">Dealers &ampTuners</a></li>
        <
li><a href="<?php echo MAIN_SITE_PREFIX; ?>/about.php">About Us</a></li>
        <
li><a href="<?php echo MAIN_SITE_PREFIX; ?>/contact.php">Contact Us</a></li>
    </
ul>
</
div>

MAIN_SITE_PREFIX is just a constant I used since for this project the store had a different base url than the main site I was linking back to and both were different in testing than they would be in production. So this gave me an easy way to change it when neccesary, you can essentially ignore it.

Then I just styled the whole thing with CSS and it loads on each page. I don’t remember off the top of my head why I wrapped the list in a div, I would imagine it was done for either positioning or so I could get an extra hook for background images.

I hope it helps and let me know if you have any questions I can help with.

Take care,

Zach

 
Magento Community Magento Community
Magento Community
Magento Community
 
eliteeternity
Member
 
Avatar
Total Posts:  74
Joined:  2008-07-16
 

Hey,
I’m confused where to put the .phtml file?

<block type="page/template_links" name="main_site_links" as="main_site_links" template="page/template/main_site_links.phtml"/>

Where does that bit of code tell me to put the .phtml file I just created?
Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
eliteeternity
Member
 
Avatar
Total Posts:  74
Joined:  2008-07-16
 

Much thanks and all credit to my good chat pal Will_Hough.

If you’re anything like me. You’ll follow these directions:

public_html/app/design/frontend/default/default/template/page/html/

Open header.phtml

Search for this:

<?php echo $this->getChildHtml('topLinks'?>

Place your links under this code in their own div tags.
Example:

<div><a href="">Hello</a></div>

I hope this helps someone out.
There is a screen shot attached to this post of what following these steps accomplishes. i.e. the “about us, FAQS etc..” links in the pic.

Image Attachments
magento-forum-tip.png
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top