Skip to content

Commit

Permalink
Use null coallesce operator
Browse files Browse the repository at this point in the history
  • Loading branch information
emodric committed Mar 6, 2023
1 parent b7ab410 commit 7cd2dd8
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions cookbook/custom_target_types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,7 @@ their names and paths:

.. code-block:: twig
{% set content_name = nglayouts_ibexa_content_name(target.value) %}
{{ content_name != null ? content_name : '(INVALID CONTENT)' }}
{{ nglayouts_ibexa_content_name(target.value) ?? '(INVALID CONTENT)' }}
To register the template in the system, the following configuration is needed
(make sure to use the ``value`` view context):
Expand Down

0 comments on commit 7cd2dd8

Please sign in to comment.