• 24th, May 2011

Magento – Setting up Robots Meta tag in your theme

1) Set the meta tag in /app/design/frontend/your_theme/default/template/page/html/head.phtml

...
<meta name="robots" content="<?php echo htmlspecialchars($this->getRobots()) ?>" />
...

2) Set the Robot content from Layout in /app/design/frontend/your_theme/default/layout/page.xml

Every page layout should look like this

    <page_two_columns_right translate="label">
        <label>All Two-Column Layout Pages (Right Column)</label>
        <reference name="root">
            <action method="setTemplate"><template>page/2columns-right.phtml</template></action>
            <!-- Mark root page block that template is applied -->
            <action method="setIsHandle"><applied>1</applied></action>
        </reference>
		<reference name="head">
			<action method="setRobots"><value>NOINDEX,FOLLOW</value></action>
		</reference>
    </page_two_columns_right>
 

  • Magento 1.4.0.1

Tags: , , , ,

Leave a Reply

*

© 2010 unexpected[it]. All Rights Reserved.