user3682671
user3682671

Reputation: 1

linking the cms page to particular image

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

Answers (3)

Mohammad Faisal
Mohammad Faisal

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

Pankaj
Pankaj

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

MeenakshiSundaram R
MeenakshiSundaram R

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

Related Questions