You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Burghard Britzke <bu...@charmides.in-berlin.de> on 2008/08/03 09:09:37 UTC
[trinidad] Facelet Template with
I am developing a facelet template with a <tr:document> within. The
html-title should vary for every use of that template. So I put the
<title>-tag in a <ui:insert> within a <f:facet name="metaContainer">.
That works well from my template-clients which use <ui:define> to
overwrite the <f:facet name="metaContainer">. Unfortunally I want to
insert other tags which should be rendered in the header and which
should only be defined once in the template and should not be
overwriten by each client (like a global <script>-tag).
is there a way to do it? with the <tr:document>? or shold I use
<trh:html>, <trh:head> and <trh:body> instead?
Re: [trinidad] Facelet Template with
Posted by Andrew Robinson <an...@gmail.com>.
Template:
<tr:document
xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:fn="http://java.sun.com/jsp/jstl/functions"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:t="http://myfaces.apache.org/tomahawk"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:tr="http://myfaces.apache.org/trinidad"
xmlns:trh="http://myfaces.apache.org/trinidad/html"
xmlns:ts="http://myfaces.apache.org/sandbox"
xmlns:s="http://jboss.com/products/seam/taglib"
title="#{empty title ? msgBundle.defaultTitle : title}">
<f:facet name="metaContainer">
<h:panelGroup>
<trh:script source="/scripts/sameScript.js" />
<ui:insert name="head" />
</h:panelGroup>
</f:facet>
... template content here ...
<ui:insert />
... more template content here ...
</tr:document>
Usage:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:c="http://java.sun.com/jstl/core"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:fn="http://java.sun.com/jsp/jstl/functions"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:t="http://myfaces.apache.org/tomahawk"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:tr="http://myfaces.apache.org/trinidad"
xmlns:trh="http://myfaces.apache.org/trinidad/html"
xmlns:ts="http://myfaces.apache.org/sandbox"
xmlns:s="http://jboss.com/products/seam/taglib">
<body>
<ui:composition template="myTemplate.xhtml">
<ui:define name="head">
... other scripts, CSS links, etc ...
</ui:define>
<ui:param name="title" value="Test Page Title" />
... body to go here ...
</ui:composition>
</body>
</html>
On Sun, Aug 3, 2008 at 1:09 AM, Burghard Britzke
<bu...@charmides.in-berlin.de> wrote:
> I am developing a facelet template with a <tr:document> within. The
> html-title should vary for every use of that template. So I put the
> <title>-tag in a <ui:insert> within a <f:facet name="metaContainer">. That
> works well from my template-clients which use <ui:define> to overwrite the
> <f:facet name="metaContainer">. Unfortunally I want to insert other tags
> which should be rendered in the header and which should only be defined
> once in the template and should not be overwriten by each client (like a
> global <script>-tag).
> is there a way to do it? with the <tr:document>? or shold I use <trh:html>,
> <trh:head> and <trh:body> instead?
>