How to use Shortcodes in Magento PHTML

Published On October 13, 2012 | By Hans-Eirik Hanifl | Magento

Get magento shortcodes in phtml files

Short codes are a simple set of functions for creating macro codes for use in CMS pages or blocks. Magento has its own short codes, which you can use in Magento CMS pages, Product pages, Category pages or blocks. Magento short code syntax is fairly simple to understand as the real short code is placed inside double curly braces.


In this, the {{store url=""}} is replaced by the actual store URL. Apart from that, there are other Magento short codes which I have listed below:


Direct URL parameter appends the store’s base URL to your path, which you can use to create category or subcategory pages, i.e.


2. URL

By using Magento’s built in routes, the URL short code generates your Magento store’s URL, which can be appended to create any URL, i.e.


which will result in something like this:


Used for generating URLs with query parameters, there are two ways in using the _query parameter, you can add an arbitrary query string to the URL, i.e.


Or, you can use the second parameter syntax, where you define the query parameter name with the parameter itself, i.e.



This will result in this:

Like this Article? Share it!

About The Author

is a forward thinking e-commerce and marketing consultant. As an advocate for the free exchange of knowledge, he founded E-Commerce Gorilla as a place where like-minded individuals can ask questions and share their expertise on practical solutions in the area of e-commerce and marketing. He is the owner of TRM Marketing and an avid supporter of the open source community.

Leave a Reply