0

My magento has 2 stores, blue and white.

I have a static block which contains links to cms pages for a left menu.

The static block displays on both stores, but I took one of the cms pages pages off the white store.

Am I able to do some kind of an if statment in the static block to only display the link to that one cms page on blue only, since on the white store it just goes to 404?

Thanks!

EDIT:

in 2columns-right.phtml I have

<div class="col-right sidebar"><?php echo $this->getChildHtml('right') ?></div>

and in page.xml

<block type="core/text_list" name="right" as="right" translate="label">
    <label>Right Column</label>
</block>
  • Tell us how you show the static block (code), then probably someone can help. – Simon Aug 29 '14 at 16:23
  • try Mag::app()->getStore()getId(); to determine if you should show it – pzirkind Aug 29 '14 at 16:26
  • can you please provide site url with that page?? – Keyul Shah Aug 29 '14 at 16:31
  • I updated my post with the code I use to show the static block @simon – Brandon Stewart Aug 29 '14 at 16:32
  • It's on my local machine @keyul-shah – Brandon Stewart Aug 29 '14 at 16:34
1

Sorry for my comments - in the end the code is not really needed...

If you create a static block, there is a StoreView dropdown. You can simply create two static blocks with the same (!) identifier. In one static block, you only select the blue StoreView and enter the links which should be shown in the blue store. In the other static block, you only select the white StoreView and enter the links which should be shown in the white store. Then, the static block of the matching store will be shown.

0

As a rough workaround you can use layout handles specific to each store. For example;

_de and _en my store code

   <STORE_de>
        <reference name="right">
            <block type="cms/block" name="Promo_de">
                <action method="setBlockId"><block_id>promo_de</block_id></action>
            </block> 
        </reference>
    </STORE_de>
    <STORE_en>
        <reference name="right">
            <block type="cms/block" name="Promo_en">
                <action method="setBlockId"><block_id>promo_en</block_id></action>
            </block> 
        </reference>
    </STORE_en>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.