Monday, May 21, 2012

Add Meta Tags in WebCenter Portal using only ADF

Developing with WebCenter Portal you may come to a point where you would like to add some custom meta tags inside the html header. There are a lot of approaches to do so, some developer are using JQuery for example, when the develop with Webcenter Portal. There is also another one method by just using ADF and JSF tags. You can do so by just modifying you Page Style and adding following code:

<af:document title="#{pageDocBean.title}" id="docrt">
    <f:facet name="metaContainer">
        <af:group id="metaContainer">
            <trh:meta name="keywords" content="#{bindings.SEO_KEYWORDS}"/>
            <trh:meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1"/>
            </af:group>
        </f:facet>
</af:document>

What is important to know here, if you want to have more then one meta data information you have to use af:group tag. This allows you to add more meta tags which will be then later render into the html header section.

No comments:

Post a Comment