Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

title-pattern and deep hierarchies #34

Closed
jmiguelsamper opened this issue Jan 15, 2014 · 3 comments
Closed

title-pattern and deep hierarchies #34

jmiguelsamper opened this issue Jan 15, 2014 · 3 comments
Assignees
Labels

Comments

@jmiguelsamper
Copy link

We have a deep hierarchy of layout decorators, as follows:

layout-base.html

<html>
    <head>
        <title layout:title-pattern="$CONTENT_TITLE">Layout base</title>
    </head>
</html>

layout-customer.html

<html layout:decorator="layout-base.html">
    <head>
        <title layout:title-pattern="$CONTENT_TITLE">Layout customer</title>
    </head>
</html>

productList.html

<html layout:decorator="layout-customer.html">
    <head>
        <title th:text="#{productList}">Page title</title>
    </head>
</html>

In this situation the title of the page is not rendered properly, it shows Page title instead of the value corresponding to the productList key.

It works perfectly when the final page has only one ancestor.

We have noticed that using a processor with higher precedence than th:text it works OK, so maybe it is just a precedence problem.

We have also noticed that it works if the expression is inside the element, as in:

        <title>#{productList}</title>
@ghost ghost assigned ultraq Jan 15, 2014
@ultraq
Copy link
Owner

ultraq commented Jan 15, 2014

Hmm, I would have expected consistent behaviour between using th:text and having the text in an element (I made changes recently to support both since it used to only work for text inside the <title> element, #28). Will investigate. I suspect something similar to #30, where we were losing fragments being passed up the page hierarchy.

@ultraq
Copy link
Owner

ultraq commented Jan 18, 2014

I've just updated the 1.2.2-SNAPSHOT with a fix for this issue. Could you give it a try @jmiguelsamper, let me know if it works?

@jmiguelsamper
Copy link
Author

Yes, the fix works like a charm.

Thank you very much for your work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants