0

This may be a very stupid question. I made a new page in Magento and I want to make a link to the page on my Magento homepage, but I dont know what the link url to use for that page. The url key for my page is over-ons My base url is: 127.0.0.1/html/magento/magento I cant seem to find out how to get to my new page. How do I link this to the home page? I've seen a tutorial on the official magento website itself and it said you have to make a new category but that doesn't seem right for such a small thing. How do I get to my new page?

3

You need to add this in the content field of the homepage in CMS->Manage pages

<a href="{{store _direct="over-ons"}}">Over Ons</a>

This will build the correct url independent of your base url.

0

If you mean putting a link in the main navigation, then unfortunately a Category is probably the only way to do it without a custom module observer. If you want to do it properly by customization, Marius has an excellent answer here.

Magento's navigation building code is an ancient relic from around Magento 1.0, and mainly just loops through the categories to build tiered out navigation. You can take advantage of this by giving a Category and a CMS page the same short url, as Magento processes the CMS router after the Category router, meaning that the link to the CMS page is the one that will be honored.

EDIT: Cleared up the wording on why this should be done.

  • 1
    I don't think the OP asked how to add a link in the navigation, but in case you got it right, I want to challenge your answer. Starting version 1.7 you can add anything to the top menu using the event page_block_html_topmenu_gethtml_before. See here an example. The example is in the question not the answers. – Marius Nov 6 '14 at 15:31
  • Excellent point. That would probably be strictly-speaking the best way to do it. I offered the response because OP mentioned he saw a tutorial mentioning the Category method, and seemed to want to approach this from a "non-customization" (everything done in the admin) angle. Adding to the navigation via observer is definitely cleaner. – Andrew Quackenbos Nov 6 '14 at 15:35
  • I cleared up my initial answer to explain it a bit better. Thanks. – Andrew Quackenbos Nov 6 '14 at 15:39

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.