In our theme we have a static block for the links we have in our footer. We have three blocks with Account, info and social media.
At the moment everything is hard coded with relative link paths to store pages & absolute link paths to the social media pages.
I'm wondering what is the best way to link to store pages, and know you can use cms directives
For instance there are these links for customer account pages.
<a href="{{store url='customer/account'}}">My Account</a>
<a href="{{store url='customer/address'}}">My Address</a>
<a href="{{store url='wishlist'}}">My Wishlist</a>
Why would you use this method rather than a relative path? i.e.
<a href="customer/account">My Account</a>
Is there another way to link to the customer/account page? without using the customer/account keywords?
Also why would you use something like this for a CMS page?
<a href="{{store direct_url="contact"}}">Contact Us</a>
is there a better way to link to a cms page from within a static block or another cms page?
customer
toclient
(see here how), using the{{store}}
directives will automatically generate the correct url. So you are safe. It does NOT work the same fordirect_url
.<a href="{{store url="contact"}}">Contact Us</a>
and later change the url for your contact page? Will the correct url still be generated?contact
is one of your custom pages (unless you are talking about thecontacts
module). It does not work the same for pages. Because Magento does not know you are linking to a page, nor does it keep track of the changed url keys of static pages. You can use the widgets for links but I guess this is even worse because widgets use page ids which are not protable{{widget type="cms/widget_page_link" anchor_text="some text here" title="some title here" template="cms/widget/link/link_block.phtml" page_id="52"}}