Can I add a meta tag to a particular page that is using templates

拈花ヽ惹草 提交于 2019-12-06 12:00:05

Declare an <ui:insert> in the master template at the desired location:

clientPage.xhtml

<!DOCTYPE html>
<html ...>
    ...
    <h:head>
        <ui:insert name="head-meta" />
        ...
    </h:head>
    ...
</html>

Extend the master template with another master template:

i18ClientPage.xhtml

<ui:composition template="/WEB-INF/facelets/templates/ie8ClientPage.xhtml"
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
>
    <ui:define name="head-meta">
        <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
    </ui:define>
</ui:composition>

Finally let those template clients use this master template instead.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!