diff --git a/CHANGELOG.txt b/CHANGELOG.txt index e77c0849f..72595d9cd 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -23,6 +23,7 @@ Changelog * Added ARIA role to TableBlock output (Matt Westcott) * Added cache-busting query parameters to static files within the Wagtail admin (Matt Westcott) * Allow `register_page_action_menu_item` and `construct_page_action_menu` hooks to override the default menu action (Rahmi Pruitt, Matt Westcott) + * Add docs table template rendering example (Matt Westcott) * Fix: Added line breaks to long filenames on multiple image / document uploader (Kevin Howbrook) * Fix: Added https support for Scribd oEmbed provider (Rodrigo) * Fix: Changed StreamField group labels color so labels are visible (Catherine Farman) diff --git a/docs/reference/contrib/table_block.rst b/docs/reference/contrib/table_block.rst index 45351b796..fcee2573a 100644 --- a/docs/reference/contrib/table_block.rst +++ b/docs/reference/contrib/table_block.rst @@ -26,7 +26,7 @@ Basic Usage After installation, the TableBlock module can be used in a similar fashion to other StreamField blocks in the Wagtail core. -Just import the TableBlock ``from wagtail.contrib.table_block.blocks import TableBlock`` and add it to your StreamField declaration. +Import the TableBlock ``from wagtail.contrib.table_block.blocks import TableBlock`` and add it to your StreamField declaration. .. code-block:: python @@ -35,6 +35,29 @@ Just import the TableBlock ``from wagtail.contrib.table_block.blocks import Tabl table = TableBlock() +Then, on your page template, the ``{% include_block %}`` tag (called on either the individual block, or the StreamField value as a whole) will render any table blocks it encounters as an HTML ``