This is my XML from layout:
<customer_account_index>
<reference name="content">
<block type="name_module/customer_account_welcome" name="customer_account_dashboard" before="-" template="name_module/customer/account/welcome.phtml"/>
</reference>
</customer_account_index>
<customer_account_index>
<update handle="customer_account_dashboard" />
<reference name="content">
<block type="cms/block" name="customer_account_dashboard_welcome" before="-">
<action method="setBlockId"><block_id>succes-startkit</block_id></action>
</block>
</reference>
</customer_account_index>
This is the content of my template:
<?php if ($this->shouldDisplayWelcome()):?>
<div class="welcome-msg">
<?php echo $this->getChildHtml('customer_account_dashboard_welcome') ?>
</div>
<?php endif;?>
and my function from my block:
public function shouldDisplayWelcome()
{
$session = Mage::getSingleton('core/session');
$welcome = $session->getShowWelcomeMessage();
if ($welcome === true) {
$session->setShowWelcomeMessage(false);
return true;
}
return false;
}
Depends on what my function returns I want to display my static block or not. What am I doing wrong from the layout?
Thanks
[UPDATE]
Right now this version of the XML doesn't work:
<customer_account_index>
<reference name="content">
<block type="cms/block" name="customer_account_dashboard_welcome" before="-">
<action method="setBlockId" helper="mynamespace_mymodule/customer/shouldDisplayWelcome">
<block_id>succes-startkit</block_id>
</action>
</block>
</reference>
</customer_account_index>
If i make a syntax error in my helper, I got the error message, but no matter what i return true or false in my function my static block is still displayed.