I am using magento 1.7. i have tried to change wrapper of cms content but still i cannot get how i can change wrapper of cms_page.
<block type="page/html_wrapper" name="cms.wrapper" translate="label">
<label>CMS Content Wrapper</label>
<action method="setElementClass"><value>std</value></action>
<block type="cms/page" name="cms_page"/>
</block>
and html output is
<div class="std">
CMS Page content
</div>
but i want to output like this
<section class="std">
CMS Page Content
</section>
Please give me any solution
You can try following code for change div to section
<block type="page/html_wrapper" name="cms.wrapper" translate="label">
<label>CMS Content Wrapper</label>
<action method="setElementClass"><value>std</value></action>
<action method="setAttribute"><param1>html_tag_name</param1><param2>section</param2></action>
<block type="cms/page" name="cms_page"/>
</block>
this will change div to section because html_wrapper class get tag name from a function getElementTagName
in app\code\core\Mage\Core\Block\Abstract\Wrapper.php
/**
* Wrapper element tag name getter
* @return string
*/
public function getElementTagName()
{
$tagName = $this->_getData('html_tag_name');
return $tagName ? $tagName : 'div';
}
so by calling setAttribute we change/set value of html_tag_name
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With