How to set a definition inside another definition

I am developing a web application in jboss, seam, richfaces.

I use the template (xhtml) as the main page of everyone else, and there I set two insert tags. <ui:insert name="head"/> <ui:insert name="body"/>

The problem is that pages that use this main page as a template <ui:define name="head">...</ui:define>must be defined internally <ui:define name="body">...</ui:define>.

How can i do this?

Basically, I want to do the following:

<ui:define name="body">... <ui:define name="head"> <meta name="title" content="#{something.title}" /> </ui:define> ...</ui:define>

the main page should return: <meta name="title" content="#{something.title}" />to<ui:insert name="head"/>

Thanks in advance

+3
source share
2 answers

I do not think so. It compiles and reads a template.

, , , .

//In your template.xhtml
<ui:insert name="outer">
    BLA BLA BLA
    <ui:insert name="inner"/>
    BLA BLA BLA
</ui:insert>

:

 <ui:define name="outer">
    Here you can overwrite outer (This will probably overwrite inner, not sure, you need to test it)
 </ui:define>

 <ui:define name="inner">
    Or you can ONLY overwrite inner here if you want
 </ui:define>
+1

<ui:param>, content .

:

<meta name="title" content="#{titleParam}" />

, :

<ui:param name="titleParam" value="customValueForThisPage" />
0

Source: https://habr.com/ru/post/1728617/


All Articles