Reputation: 1
I have created a CMS page with the name collection.html and added the code like
{{block type="catalog/product_list" name="home.catalog.product.list" alias="products_homepage" category_id="7" template="catalog/product/list.phtml"}}
I want to link this CMS page to the image which is displaying in the other page. How to link this page to particular image in the other page?
Upvotes: 0
Views: 66
Reputation: 5959
While you have created a CMS Page
, you would have added some URL Key
for the page.
Getting the URL
in phtml
$this->getUrl('cms-page-url-key');
Getting the URL
in CMS Page
or Static Block
{{store direct_url="cms-page-url-key"}}
Upvotes: 0
Reputation: 581
If the image is in CMS page or Static Block then you can do by this way
<a href=" {{store direct_url="identifier_of_cms_page"}} ">
<img ... />
</a>
If the image is in phtml page then
<a href=" <?php echo $this->getUrl('identifier_of_cms_page');?> ">
<img .. />
</a>
Upvotes: 1
Reputation: 2837
To get the CMS page url in template file
$this->getUrl('', array('_direct' => 'cms-page-key'));
To pass parameter with this
$this->getUrl('', array('_direct' => 'cms-page-key', '_query' =>'a=5&b=6'));
Upvotes: 0