Skip to content

baseframe.html.jinja2 should honour a baseframe_render variable #193

@jace

Description

@jace

We have three use cases for how a page is rendered:

  1. Full page (regular render)
  2. Embedded as an iframe (no header and footer, but includes stylesheet and scripts)
  3. 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.

  1. 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.

  2. 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.

  3. Apps that override blocks with their own versions are responsible for honouring the baseframe_render variable. This will no longer be Baseframe's responsibility.

  4. 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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions