We have three use cases for how a page is rendered:
- Full page (regular render)
- Embedded as an iframe (no header and footer, but includes stylesheet and scripts)
- Fragment (just a HTML snippet, for when the app reloads part of a page)
We have implemented these cases in apps by overriding template blocks from special-case templates (such as embedlayout.html.jinja2 that inherits layout.html.jinja2 in hasgeek/hasjob#455). It will be easier to do this with direct support from Baseframe.
-
All Baseframe layout templates should recognise a baseframe_render variable passed to the template. Valid values are full, embed and fragment. Invalid values are interpreted as full.
-
All blocks in layout templates (baseframe.html.jinja2, layout.html.jinja2, formlayout.html.jinja2, etc) should have if conditions that skips rendering the block if a matching render condition is met.
-
Apps that override blocks with their own versions are responsible for honouring the baseframe_render variable. This will no longer be Baseframe's responsibility.
-
The if conditions should not remove template blocks, only their contents. A block containing a sub-block will need if conditions above and below the sub-block.
We have three use cases for how a page is rendered:
We have implemented these cases in apps by overriding template blocks from special-case templates (such as
embedlayout.html.jinja2that inheritslayout.html.jinja2in hasgeek/hasjob#455). It will be easier to do this with direct support from Baseframe.All Baseframe layout templates should recognise a
baseframe_rendervariable passed to the template. Valid values arefull,embedandfragment. Invalid values are interpreted asfull.All blocks in layout templates (
baseframe.html.jinja2,layout.html.jinja2,formlayout.html.jinja2, etc) should haveifconditions that skips rendering the block if a matching render condition is met.Apps that override blocks with their own versions are responsible for honouring the
baseframe_rendervariable. This will no longer be Baseframe's responsibility.The
ifconditions should not remove template blocks, only their contents. A block containing a sub-block will needifconditions above and below the sub-block.