kopia lustrzana https://github.com/wagtail/wagtail
rodzic
69e277e5f5
commit
2eb4b4c2c1
|
@ -10,6 +10,7 @@ Changelog
|
|||
* Search methods now accept an `order_by_relevance` argument, which can be set to False to preserve the original QuerySet ordering
|
||||
* InlinePanel now accepts `max_num` and `min_num` arguments to limit the number of inline items
|
||||
* 'Add' button on inline panels is disabled when `max_num` is reached (Salvador Faria)
|
||||
* StreamField blocks now provide a `get_context` method for passing additional variables to the block template
|
||||
* WagtailRedirectMiddleware can now ignore the query string if there is no redirect that exactly matches it (Michael Cordover)
|
||||
* Order of URL parameters now ignored by redirect middleware (Michael Cordover)
|
||||
* Added SQL Server compatibility to image migration (Timothy Allen)
|
||||
|
@ -24,6 +25,8 @@ Changelog
|
|||
* The `first_published_at` and `latest_revision_created_at` fields on page models are now available as filter fields on search queries
|
||||
* Rich text fields now strip out HTML comments
|
||||
* Page editor form now sets enctype="multipart/form-data" as appropriate, allowing FileField to be used on page models (Petr Vacha)
|
||||
* Explorer navigation menu on a completely empty page tree now takes you to the root level, rather than doing nothing
|
||||
* Fix: Page slugs are no longer auto-updated from the page title if the page is already published
|
||||
* Fix: Deleting a page permission from the groups admin UI does not immediately submit the form
|
||||
* Fix: Wagtail userbar is shown on pages that do not pass a `page` variable to the template (e.g. because they override the `serve` method)
|
||||
* Fix: request.site now set correctly on page preview when the page is not in the default site
|
||||
|
|
|
@ -39,6 +39,12 @@ Inline panels now accept the optional parameters ``max_num`` and ``min_num``, to
|
|||
See: :ref:`inline_panels`
|
||||
|
||||
|
||||
``get_context`` on StreamField blocks
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
StreamField blocks now :ref:`provide a get_context method <streamfield_get_context>` that can be overridden to pass additional variables to the block's template.
|
||||
|
||||
|
||||
Minor features
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
|
@ -56,10 +62,12 @@ Minor features
|
|||
* Wagtail admin now standardises on a single thumbnail image size, to reduce the overhead of creating multiple renditions
|
||||
* Rich text fields now strip out HTML comments
|
||||
* Page editor form now sets ``enctype="multipart/form-data"`` as appropriate, allowing FileField to be used on page models (Petr Vacha)
|
||||
* Explorer navigation menu on a completely empty page tree now takes you to the root level, rather than doing nothing
|
||||
|
||||
Bug fixes
|
||||
~~~~~~~~~
|
||||
|
||||
* Page slugs are no longer auto-updated from the page title if the page is already published
|
||||
* Deleting a page permission from the groups admin UI does not immediately submit the form
|
||||
* Wagtail userbar is shown on pages that do not pass a ``page`` variable to the template (e.g. because they override the ``serve`` method)
|
||||
* ``request.site`` now set correctly on page preview when the page is not in the default site
|
||||
|
|
|
@ -441,6 +441,7 @@ Within the template, the block value is accessible as the variable ``value``:
|
|||
|
||||
The line ``value.bound_blocks.biography.render`` warrants further explanation. While blocks such as RichTextBlock are aware of their own rendering, the actual block *values* (as returned when accessing properties of a StructBlock, such as ``value.biography``), are just plain Python values such as strings. To access the block's proper HTML rendering, you must retrieve the 'bound block' - an object which has access to both the rendering method and the value - via the ``bound_blocks`` property.
|
||||
|
||||
.. _streamfield_get_context:
|
||||
|
||||
To pass additional context variables to the template, block subclasses can override the ``get_context`` method:
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue