Skip to content

Commit

Permalink
Update docs for deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
emodric committed Jan 27, 2023
1 parent 0dd77e3 commit d1fe1e7
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cookbook/custom_blocks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ same (since all we want is to render the parsed Markdown), save for the
different template used to extend from.

In general, all backend templates need to extend from
``@NetgenLayoutsAdmin/app/block/block.html.twig`` and in most cases, backend
``@nglayouts_admin/app/block/block.html.twig`` and in most cases, backend
template will be simpler than the frontend one, without any design specific
markup and so on. Everything you can use in frontend templates is also available
here, meaning that you can use the ``block`` variable to access the block and
Expand All @@ -311,7 +311,7 @@ Going back to our example backend template, it will look like this:
{# @App/blocks/app/my_markdown/my_markdown.html.twig #}
{% extends '@NetgenLayoutsAdmin/app/block/block.html.twig' %}
{% extends '@nglayouts_admin/app/block/block.html.twig' %}
{% block content %}
{{ block.dynamicParameter('html')|raw }}
Expand Down
2 changes: 1 addition & 1 deletion cookbook/custom_container_blocks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ blocks, except specific HTML elements used as markers for block placeholders:

.. code-block:: twig
{% extends '@NetgenLayoutsAdmin/app/block/block.html.twig' %}
{% extends '@nglayouts_admin/app/block/block.html.twig' %}
{% block content %}
<div class="row">
Expand Down
2 changes: 1 addition & 1 deletion cookbook/custom_value_types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ this:
</div>
<div class="name">
<p><a href="{{ nglayouts_item_path(item) }}" target="_blank" rel="noopener noreferrer">{{ item.name }}</a></p>
<p><a href="{{ nglayouts_item_path(item, 'admin') }}" target="_blank" rel="noopener noreferrer">{{ item.name }}</a></p>
</div>
Rendering an item name and URL works for all items, as long as you implemented
Expand Down
2 changes: 1 addition & 1 deletion reference/twig_usage/nglayouts_item_path.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ and value type of the item:

.. code-block:: twig
<a href="{{ nglayouts_item_path(42, 'ibexa_location') }}">{{ 'My item' }}</a>
<a href="{{ nglayouts_item_path([42, 'ibexa_location']) }}">{{ 'My item' }}</a>
Alternatively, you can use a special format used by Netgen Layouts in the form
of an URI scheme ``value_type://value``:
Expand Down
18 changes: 17 additions & 1 deletion upgrades/upgrade_130_140.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,23 @@ Other changes
Deprecations
------------

There were no deprecations in 1.4 version of Netgen Layouts.
* Base template for all admin block templates
``@NetgenLayoutsAdmin/app/block/block.html.twig`` is deprecated and will be
removed in 2.0. Use ``@nglayouts_admin/app/block/block.html.twig`` instead.
* ``ValueUrlGeneratorInterface::generate`` method is deprecated and is replaced
by two new methods in newly added interface ``ExtendedValueUrlGeneratorInterface``:
``generateDefaultUrl`` and ``generateAdminUrl``. These two methods generate item
paths for frontend and backend, respectively. Implement the new interface in your
value URL generators and call the ``generateDefaultUrl`` in your ``generate``
method to migrate. Note that the ``ExtendedValueUrlGeneratorInterface`` interface
is immediately deprecated and will be merged into ``ValueUrlGeneratorInterface``
interface and removed in 2.0.
* While not strictly a deprecation but related to the point above,
``nglayouts_item_path`` Twig function now receives a second argument with two
possible values: ``default`` (this value being the default one) and ``admin`` in
order to specify which URL you wish to generate. Update your calls to
``nglayouts_item_path`` Twig function as needed to make sure the correct URL is
generated for your items.

Breaking changes
----------------
Expand Down

0 comments on commit d1fe1e7

Please sign in to comment.