Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

template variable - call different static blocks on different pages using the same block type? 
 
lotusseedsD
Mentor
 
Avatar
Total Posts:  1144
Joined:  2007-08-31
 

OK, I have difficulty to come out a concise title.  I am looking into a way to do this but can’t figure out.

Is it possible to extend the cms/block, and making it to template variable.

Something like this maybe?

<block type="cms/block" name="cms_template_variable">
<action method="setTV"><template>tv_template</template></action>
</block>

The tv_template.phtml can be something like this and can be place any way in the template (header, left, right, content)

<div class="tv_box">
<?php echo $this->getStaticBlock() ?>
</div>

So I want a Static Block for Furniture and its subcategory pages, I create a ‘furniture_promo’, enter some content, and it goes to the tv_box block.

In Apparel I want to show different content in the same block, I create another Statick Block called ‘apparel_promo’.

 
Magento Community Magento Community
Magento Community
Magento Community
 
lotusseedsD
Mentor
 
Avatar
Total Posts:  1144
Joined:  2007-08-31
 

I am so sorry, I don’t know why this post showed up twice. Would be nice if I can delete the duplicated ones.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Boz
Jr. Member
 
Total Posts:  13
Joined:  2008-06-17
 

Did you ever achieve this?

I’m looking at displaying different banners on each category page and this sounds like a solution, if it can be done.

Boz

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top