In a Lektor website, I'm facing the following problem:
- I have a flowblock called
factswith an according template calledfacts.html - in that template, I search for facts to display as follows:
{% for fact in site.get('/facts').children %} - these children have the model
factimposed on them and there is a correspondingfact.htmltemplate that renders them
Now the question is: how do I get to render these child pages inside facts.html?
I know this is possible by transforming the fact.html template into a macro that can be called from facts.html, but I was hoping there would be a more elegant way of achieving the same result.
Is there a render-like method available for Page objects?
I can not quite follow your setup. You said you have a
.factsattribute that is of type Flow. However, you perform a query on/factsto get its children which suggests that these are sub-pages and not flow blocks. So.. I am not sure what you try to achieve, but:You can have template files for flow-blocks, you just have to place them in e.g.,
templates/blocks/fact.html. If you do that, you can just print out the flow attribute itself (<div>{{ this.facts }}</div>) and all individual flow-blocks will be drawn with the flowblock template.EDIT:
You asked to display another (full) page template into a flow-block type: