Portal Showcase

ui:define

ui:define can create sections inside a template that is using any of ui:component, ui:composition, ui:decorate or ui:fragment.

General Usage

To define names for each section, its mandatory to use name attribute. For inserting content into these sections, use ui:insert.


INSERTED TEXT

Source Code

<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://xmlns.jcp.org/jsf/facelets">

	<ui:decorate template="template.xhtml">
		<ui:define name="defineContent">
			<br/><br/>INSERTED TEXT
		</ui:define>
	</ui:decorate>

</ui:composition>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html">
    
   	<ui:insert name="defineContent">
   		   	<h:outputText value="#{i18n['this-text-comes-from-a-template']}"/>
   	</ui:insert>
</ui:composition>
Liferay Faces Bridge Implementation 4.0.0 + Liferay Faces Portal 3.0.0 + Showcase Common 3.0.0 + Liferay Faces Util 3.0.0 + Mojarra 2.2.13