How to add facebook og:meta tags in LAYOUT.xml in magento?

akt picture akt · Aug 24, 2012 · Viewed 11.8k times · Source

I want to insert Facebook og:meta tags to use for facebook sharer ,in a head of a particular page and this page is not a CMS page.I am thinking of adding these tags through that extension layout file. I know normal titles and description are added like this ->

<reference name="head">
        <action method="setTitle"><title>My Module Page</title></action>   
 </reference>

Does magento provides something like this for Facbook og:meta tags?If not ,what is/are the other method to put og:meta tags in the head of a page so that it work with facebook sharer.

Answer

Alexandru Bangală picture Alexandru Bangală · Nov 19, 2013
<reference name="head">
    <block type="core/text" name="blockname">
        <action method="setText">
            <text>
                <![CDATA[<meta property="og:image" content="http://example.com/image.jpg"/>]]>
            </text>
        </action>
    </block>
</reference>