2

I have a page that uses a template

<ui:composition template="/WEB-INF/facelets/templates/clientPage.xhtml">

I was hoping to only render the compatibility view for this particular page using the meta tag

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />

The tag does not work unless I add it to the root template page. Is there a way I can add it to specific pages that use the template.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Alex U
  • 41
  • 1
  • 5
  • This question is unclear. What kind of templates? Php, Ruby, Javascript, Smarty, Mustache? What kind of compabilty view, compabilty to what? What meta tag? – Meier Oct 10 '13 at 23:16
  • Its an html template. I am using JSF. I saw the answer to a similar question in http://stackoverflow.com/questions/11545210/how-to-add-meta-tag-in-header-when-using-template But is there a way to do this without any changes to the template page ? – Alex U Oct 10 '13 at 23:45
  • Try to improve your question. Than you get better help. – Meier Oct 10 '13 at 23:51

1 Answers1

1

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.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555