Forgive me for opening this topic yet again, but I cannot find this solution anywhere, and it is driving me crazy.
I come from a Django-like templating system, where I can extend layouts like so:
child.html
{% extends 'base.html' %}
{% block title %}My Page Title{% endblock %}
{% block content %}
<p>My Page Body</p>
{% endblock content %}
base.html
<html>
<head>
<title>{% block title %}{% endblock %}</title>
</head>
<body>
{% block content %}{% endblock %}
</body>
</html>
In Tiles, I'd like to do something similar, where I can set the title of the page in a child template. I've tried using <tiles:putAttribute />
in my child templates, but they do not get passed to the parent template.
Does Tiles not handle templates in this bottom-to-top fashion? I've found a bunch of solutions using spring messages or Tiles EL, but these all require setting page titles in my Controller layer. In my opinion, page titles are part of the View layer.
I'm using a dynamic tiles definition to load my templates, so creating a separate tiles definition for each page is out of the question.