Hello!
How do I add a link in the main menu of my Magento store? All the links in the main menu are created from the categories and I’d like to add a link to a simple page.
Thank you in advance!
16 answers
See Item #4 within the following list of 25 TIPS & TUTORIALS for MAGENTO
Hello Tom!
Thanks a lot for that. I’ve been following the video but can’t get it to work. Not sure if I’m writing the correct code at the correct place. Could you kindly give me the code that should be written in the top.phtml file?
Kind regards,
jungfrun
You will need to locate and open “app/design/frontend/default/<yourtheme>/template/catalog/navigation/top.phtml” file.
Once opened, scroll down and you will see something that sort of look like this:
Code:
<ul id="nav"> <li><a href="<?php echo $this->getUrl('')?>"><span> <?php echo $this->__('Homepage') ?></span></a></li> <?php foreach ($this->getStoreCategories() as $_category): ?> <?php echo $this->drawItem($_category) ?> <?php endforeach ?></ul>
As you can see the Homepage link is an additional link I have added as an example. Now I will show you what it will look like to add a new additional link after the categorie links are shown:
Code:
<ul id="nav"> <li><a href="<?php echo $this->getUrl('')?>"><span> <?php echo $this->__('Homepage') ?></span></a></li> <?php foreach ($this->getStoreCategories() as $_category): ?> <?php echo $this->drawItem($_category) ?> <?php endforeach ?> <li><a href="http://yourdomain.com/"><span> <?php echo $this->__('New Link Here') ?></span></a></li></ul>
This way you can now change “http://yourdomain.com” to destination you would like to choose aswell as ‘New Link Here’ to the name of the link you would like to use.
I tried this and it almost works. But I get a Parse error: syntax error, unexpected ‘}’ in //public_html/dev_bshop_temp/app/design/frontend/default/jm_fashira/template/catalog/navigation/top.phtml on line 187
I tried inserting the code snippet where it should be. Please see screenshot attached.
Here’s a "How To" video that might be a bit easier to follow along with . . .
Thank you for all your help Tom!
I got it to work with the link solution you presented in post no 4.
But now I have an other question. If I want to translate the menu, what do I do then? The solution you’re presenting above no. 6 would make it possible to translate but I can’t get it to work that way…
Thank you!
Best regards,
jungfrun
You may need to quickly change some text in your Magento store. You don’t want to edit your .csv files and waste time trying to find the correct text line in those files. Now you’ll see what could be done…
1. Enter your Magento admin panel
2. Then go to “System”
3. Select “Cache Management”
4. Disable cache for “Translations”
5. Then go to the “System > Configuration > Developer” page
6. Expand the “Translate Inline” tab and enable it
7. Save the changes
Now you can see that some text blocks are in red boxes so that you can edit them. You can change text in the admin panel and at the front end.
NOTE: the change won’t affect .csv files; it’ll be saved in your database.
Wonderful, thanks Tom!
Strangely, I translated one menu item and it worked fine. Then I added one more item and translated, but then the first translated item wouldn’t translate… Tried removing the second item but still the same… Really strange, so now I have one item that will not translate. Have you ever had that problem?
Also, do you know how to translate the "Home" button, and the text at the top "Welcome to Store!"?
Many thanks Tom!
By default, your Magento store will include a message that says, “Welcome to Magento”.
To change it, login to your admin area:
1. Navigate to: System > Configuration > Design >
http://www.kingrosales.com/wp-conten…ation-menu.gif
2. Change “Welcome Text” field to whatever you like:
http://www.kingrosales.com/wp-conten…me-message.gif
Thank you for that Tom!
But you don’t know how to translate that text?
Kind regards,
jungfrun
In the admin, try the inline translation tool under System > Configuration > (left sidebar dropdown) Website > (left sidebar, bottom) >Developer.
Turn on Inline Translation for Frontend.
In the first bar you can even designate what IP address will see the translation tool active on the frontend (absolutely necessary for live site). Then go to your website, hover over the text you wish to change, and click on the little book that shows up.
Fill in the appropriate fields, save, and refresh page.
The only thing is that it’s not possible with the HOME button or the Welcome message. Is there an other way?
Kind regards,
jungfrun
I am not quite certain I understand your question . . . are you trying to remove your "Home" menu item?
No, I just want to translate it. But I don’t get the red lines and the book on the home page button nor the Welcome message. Really strange…
Try this . . . .
1. Enter your Magento admin panel
2. Then go to “System”
3. Select “Cache Management”
4. Disable cache for “Translations”
5. Then go to the “System > Configuration > Developer” page
6. Expand the “Translate Inline” tab and enable it
7. Save the changesNow you can see that some text blocks are in red boxes so that you can edit them.
You can change text in the admin panel and at the front end.
NOTE: the change won’t affect .csv files; it’ll be saved in your database.
Thanks Tom. I’ve already done that. It seems there is no solution for the HOME button then.
Many thanks for your help.
This question is now closed