cancel
Showing results for 
Search instead for 
Did you mean: 

Edit home.phtml for one store view

Edit home.phtml for one store view

Hi,

 

I am trying to replace the static block displaying the contact information on my homepage at https://cashino.kellyseye.com/

 

I have located the home.phtml file via the path: app/design/frontend/rwd/kellyseye/template/homepage

 

The issue is, if I change the first line:

<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('home-center-promotion')->toHtml(); ?>

It changes this for every store view.

 

4 REPLIES 4

Re: Edit home.phtml for one store view

Hello @jordan_cardwell

 

$storeId = Mage::app()->getStore()->getStoreId();  
if($storeId == '1') // what ever id
{ // your logic
}

or use
 $storeName = Mage::app()->getStore()->getName();

 

hope it will help you.

 

if works then mark as solution

 

 


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: Edit home.phtml for one store view

Would this be correct?

<?php $storeId = Mage::app()->getStore()->getStoreId();
 if($storeId == '15')
{ echo $this->getLayout()->createBlock('cms/block')->setBlockId('home-center-contact')->toHtml(); } ?>

Nothing has changed on my website.

Re: Edit home.phtml for one store view

Hello @jordan_cardwell

 

 

make sure it is right store id, echo first store id and make sure flush cache so it will show your changes

 


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: Edit home.phtml for one store view

Like this?

<?php echo $storeId = Mage::app()->getStore()->getStoreId();
 if($storeId == '15')
{ echo $this->getLayout()->createBlock('cms/block')->setBlockId('home-center-contact')->toHtml(); } ?>

Still nothing... I have cleared cache and confirm the Store View ID is 15

Capture.PNG