Magento: Get a custom variable value in a phtml file

I think custom variables were originally designed to be used in emails but I use them within the main site for little bits of information whose value needs to change on a per store/language basis.

This is how you get a custom variable inside a phtml file:

Mage::getModel(‘core/variable’)->setStoreId(Mage::app()->getStore()->getStoreId())->loadByCode(‘[variable-code]’)->getValue(‘plain’);

Continue reading Magento: Get a custom variable value in a phtml file

Magento Custom Layout Update: Robots No-index

You may well have certain pages that you do not want Google, et al, to index in the SERPS.  Examples include log in pages, thank you pages, and perhaps content of little search value such as legal blurb.  This can let you control a little more, albeit very slightly, the pages you want Google to show and those that you don’t.

You can use the Custom Layout Update control (in the Custom Design tab) to set the robots control on a per-page basis.  Simply add the following code into the Custom Layout Update textarea in the Magento admin:

<reference name=”head”>
<action method=”setRobots”><value>NOINDEX,NOFOLLOW</value></action>
</reference>

Continue reading Magento Custom Layout Update: Robots No-index