Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 299235

Change field 'Global: View result counter' rendering, using double curly braces

$
0
0

The global view result counter passes itself wrapped in double curly braces when rendered, rather than as an integer value. This patch fixes that by adding a render function in Drupal\views\Plugin\views\field\Counter.php.

So, for example, a drupalist can put a global view counter and a global custom text field in a view, and then to add filters to counter in the text replacement field.

Fields:
Global: View result counter
Global: Custom text

In the custom text field:
{% if counter is even %}
... do something ...
{% endif %}

This was before not possible, as the string "{{ counter }}" was passed to the "even" filter, rather than the value of counter itself.


Viewing all articles
Browse latest Browse all 299235

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>