Hi folks,
we're having a strange problem with the "sling.include"-method in our
"esp"-templates.
At the moment we're trying to develop a flexible content model for a
newspaper company.
Here is a short extract of our repository structure:
------------------------------------------------
wall (sling:resourceType = "wall")
|
|--> brickgroup1 (sling:resourceType = "brickgroup")
| |
| |--> brick11 (sling:resourceType = "statichtmlbrick")
| |--> brick12 (sling:resourceType = "contentbrick")
| |--> brick13 (sling:resourceType = "contentbrick")
|
|--> brickgroup2 (sling:resourceType = "brickgroup")
|
|--> brick21 (sling:resourceType = "contentbrick")
|--> brick22 (sling:resourceType = "contentbrick")
|--> brick23 (sling:resourceType = "statichtmlbrick")
------------------------------------------------
And here are our main templates in the "apps"-directory (hint: we use an
OCM-framework to retrieve content from the repository):
------------------------------------------------
apps/wall/html.esp:
-------------------
...
// iterate over brick groups and include them
brickGroups = wall.getBrickGroups();
for (i = 0; i < brickGroups.size(); i++) {
sling.include(brickGroups.get(i).getPath());
}
...
apps/brickgroup/html.esp:
-------------------------
...
// iterate over bricks and include them
bricks = brickgroup.getBricks();
for (i = 0; i < bricks.size(); i++) {
sling.include(bricks.get(i).getPath());
}
...
apps/contentbrick/html.esp:
---------------------------
...
// include content item
sling.include(contentbrick.getContent().getPath());
...
apps/statichtmlbrick/html.esp:
------------------------------
...
<%= statichtmlbrick.getHtmlText() %>
...
------------------------------------------------
Now here is my problem. If "brick12" includes e.g. a referenced article,
which has includes to other content items, then "brick13" is never
reached in loop of the "brickgroup"-template.
It's the same with "brickgroup2", because "brickgroup1" also includes
other content items.
It seems that the "sling.include"-method only follows one include path.
Is this a bug or a feature or do I get something completely wrong here?
Thanks in advance,
Christoph