rss
twitter
    Find out what I'm doing, Follow Me :)

Thursday, April 1, 2010

Pin It

Widgets

How to link pages using store URL short code

If you want to add hyperlinks between the pages on your site you could specify the full http://www.yourdomain/…, but Magento provides a short code which automagically prefixes your base store URL.  If you have a CMS page with the slug “about-us”, you can link to that page from any other CMS page

using:

<a href="{{store url='about-us'}}">About Us</a>

If you wanted to link to your home page use:

<a href="{{store url=''}}">Home Page</a>

3 comments:

  1. Have you found a fix for the issue that arises when trying to link to category pages that end with .html?

    Usually I had accomplished this with the following code:
    {{store url="}}pageurl.html

    ReplyDelete
  2. If you need to create a URL to a category or product, you can use the direct_url parameter. In that case, whatever you pass to the store directive will simply be appended to the base URL. For example, if your settings are that .html is added to your links, a link to a category can be created like so:

    {{store direct_url="pageurl.html"}}

    ReplyDelete
  3. I found a fix : use {{store direct_url=""}} instead of {{store url=""}}

    ReplyDelete