문제

I have read different tuts about this and some say it all can be done from the admin panel, others say I have to add code in my layout and in the template files. Well, nothing works...

  1. I created the static block from admin > CMS > static blocks with identifier home_image-center
  2. Found the template app/design/frontend/enterprise/my_theme/template/cms/home.phtml and in the place where I want the block to stand I wrote this code:

    <div>

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

    </div>

  3. In admin > CMS > Pages opened the page called home and in the Design tab in Custom Layout Update XML field I added this code: <block type="core/template" name="home_image-center" template="cms/home.phtml" /> between the reference tags.

I have put some text in the content of the static block, just to see whether it will be shown, but it's not. My final aim is to put that block there and make it available to have a static image or text in it, that can be changed at any time from the back-end.

올바른 솔루션이 없습니다

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top