The most obvious example that I can think of is the output of nested comments. Say you have a comment tree and you want to display it as a nested html (say lists inside lists or divs inside divs) using your template.
The comment block / function / tag / helper / comment / something else should somehow call itself for comments.
Are there template engines that support such things inside a single template file?
I know that you can simply pre-calculate the “indent” or “depth level” of each comment and send them to the template as one flat list in the correct order, but let me say that I don’t want that. And let them say that I do not want to stitch the fragments together in the code / outside the template - I want the whole page to be contained in one template or theme file.
Refresh . I want to create a nested html. I want comments to be nested, not nested. I know how to backtrack from CSS. :) Whether it is done in a browser or on a server does not matter, because I want the template to be self-contained in a single file.
How in:
var html = render(template, {comments: aTreeOfNestedComments});
(., node.js, , "jQuery", javascript ...) , , mixins. , - ?