0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-12-01 11:41:20 +01:00
wagtail/docs/topics
Matt Westcott dbc4c9b28e Adds the include_block template tag (#2786)
Update render and render_basic methods on Block to take a context kwarg

Update TableBlock to support passing extra context to render

Implement render_as_block on BoundBlock, StreamValue and StructValue.

Collectively, these are the objects encountered during template rendering which typically render
a block template when output inside {{ ... }} tags. Implementing render_as_block allows us to do
the same thing, but passing a template context as well.

Implement include_block tag

Support extra context vars on include_block via 'with foo=bar'

Support 'only' flag on include_block tag, to omit the parent context

Update StreamField documentation to cover the include_block tag

Rewrite 'BoundBlocks and values' docs based on the include_block tag

Add tests for blocks with legacy render / render_basic methods

Any bits of StreamField infrastructure that attempt to call render or render_basic
on a block with a 'context' kwarg, should (for now) also work on blocks that don't
accept the context kwarg, but output a RemovedInWagtail18Warning.

Explicitly test whether render / render_basic will accept a 'context' kwarg

This avoids unexpected behaviour when the method legitimately accepts a context
kwarg, but happens to throw an unrelated TypeError - in this situation, the final
output (or error diagnostics) will behave as if the context was never passed,
making debugging difficult. See https://github.com/torchbox/wagtail/pull/2786#discussion_r69563984
2016-07-06 17:44:02 +03:00
..
search Update documentation and code to put mixin first 2016-05-04 14:05:33 +01:00
images.rst Various typo fixes and grammar/clarity improvements. 2016-03-10 15:11:41 +00:00
index.rst Moved advanced image topics into advanced topics 2016-01-27 11:27:16 +00:00
pages.rst Change Indexed.search_fields to be a listish thing 2016-03-24 21:05:09 +00:00
snippets.rst Use python_2_unicode_compatible in snippets.rst (#2688) 2016-06-07 13:49:28 +01:00
streamfield.rst Adds the include_block template tag (#2786) 2016-07-06 17:44:02 +03:00
writing_templates.rst Changed indentation on all code samples to 4 spaces. 2016-04-28 10:57:22 +01:00