Problem with the page title using thymeleaf + tiles

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Problem with the page title using thymeleaf + tiles

nowi
Hello! We are not able to show the page title in our project, we are using thymeleaf-extras-tiles2-spring3.

Our configuration is this:

tiles-defs.xml

<tiles-definitions> 

    <definition name="baseLayout"  
        template="components/layouts/baselayout"> 
        <put-attribute name="title" value="" />
        <put-attribute name="style" value="components/style" /> 
        <put-attribute name="header" value="components/header" /> 
        <put-attribute name="menu" value="components/menu" /> 
        <put-attribute name="body" value="" /> 
        <put-attribute name="footer" value="components/footer" /> 
    </definition> 
   
    <definition name="thePage" extends="baseLayout"> 
        <put-attribute name="title" value="#{label.theTitle}" /> 
        <put-attribute name="body" value="pages/thePage" /> 
    </definition> 
 
</tiles-definitions> 

in the baselayout.html

<head>
          ...
<title tiles:insertAttribute="title" ignore="true"></title>
          ...
</head>

We are trying to show in the page title the i18n value of "label.theTitle" but it's not working, we tried everything we found on the manuals and it still shows the url in the page title.

Can anyone help us here please?

Thanks in advance.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem with the page title using thymeleaf + tiles

danielfernandez
Administrator
Sorry, but unfortunately the execution of Thymeleaf expressions inside attributes of type="string" (which is the case of your "title") is not allowed. See https://github.com/thymeleaf/thymeleaf-extras-tiles2/issues/8

The issue is, this is not arbitrary, but actually due to Tiles' architectural complexities in this matter…

Regards,
Daniel
Loading...