jeudi 5 mars 2015

How do I use sections with three levels of inheritance

I'm using Rythm as my template engine in Java and I'm trying to use sections with inheritance but I'm stuck with when extending templates more than once.


What I want is to append to a section from more than one place.


Description: I have three templates and they inherit as follows: base.html < internal.html < main.html (main being the most specific)


In base.html I have defined a



@@render(styles) {
<link href="/ex1.css"/>
}


In main.html I include a section as follows:



@section(styles) {
@inherited()
<link href="/ex3.css">
}


So far this works correctly.


Problem: When I include a section block in internal.html. (The template in the middle of the hierarchy.)



@section(styles) {
@inherited()
<link href="/ex2.css">
}


The section of internal.html is completely skipped. Am I doing something wrong or is there a good solution for this?





Aucun commentaire:

Enregistrer un commentaire