Magento Cheat Sheet

I keep forgetting the syntax for Magento CMS, layout XML, and other little PHP snippets. So here we go:

Add a CMS block to another block via XML

<reference name="header">
    <block type="cms/block" name="store_banner" as="store_banner">
        <action method="setBlockId"><block_id>store_banner</block_id></action>

Source for an image in the skin directory from within a CMS page

<img src="{{skin url='images/image-name.jpg'}}" alt="Keyword loaded text!" />

No Comments

Be the first to start the conversation.

Leave a Reply

Text formatting is available via select HTML. <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>