diff --git a/core/lib/Drupal/Core/Template/TwigExtension.php b/core/lib/Drupal/Core/Template/TwigExtension.php index 9cd17b0..0631a28 100644 --- a/core/lib/Drupal/Core/Template/TwigExtension.php +++ b/core/lib/Drupal/Core/Template/TwigExtension.php @@ -23,9 +23,7 @@ public function getFunctions() { // @todo Remove URL function once http://drupal.org/node/1778610 is resolved. 'url' => new \Twig_Function_Function('url'), // These functions will receive a TwigReference object, if a render array is detected - 'hide' => new TwigReferenceFunction('twig_hide'), 'render_var' => new TwigReferenceFunction('twig_render_var'), - 'show' => new TwigReferenceFunction('twig_show'), ); } @@ -40,6 +38,7 @@ public function getFilters() { // @see TwigNodeTrans::compileString() 'passthrough' => new \Twig_Filter_Function('twig_raw_filter'), 'placeholder' => new \Twig_Filter_Function('twig_raw_filter'), + 'without' => new \Twig_Filter_Function('twig_without'), ); } @@ -53,8 +52,6 @@ public function getNodeVisitors() { public function getTokenParsers() { return array( - new TwigFunctionTokenParser('hide'), - new TwigFunctionTokenParser('show'), new TwigTransTokenParser(), ); } diff --git a/core/modules/block/templates/block-list.html.twig b/core/modules/block/templates/block-list.html.twig index 873d192..474c654 100644 --- a/core/modules/block/templates/block-list.html.twig +++ b/core/modules/block/templates/block-list.html.twig @@ -13,10 +13,9 @@ * @ingroup themeable */ #} -{% hide(form.place_blocks) %}
+ No author: {{ quote|without('author') }} +
+ ++ Complete quote after without: {{ quote }} +
+ ++ Only author: {{ quote.author }} +
+ ++ No author or date: {{ quote|without('date', 'author') }} +
+ ++ Only date: {{ quote.date }} +
+ ++ Complete quote again for good measure: {{ quote }} +
+ +++{{ quote.content }}
+ +