0

I'm using Drupal 8, with a view of type Log entries. I'm trying to rewrite the output so it adds additional text but the field is already formatted by the time it gets to the twig file. Where is the field being rendered? I'd like to override the rendering for just this field in just one view. Thanks.

1 Answer 1

2

Use replacements ..

You can simply edit the field and tick the box Next to "Exclude from display" this will hide the field, then you can Add a new field of type "Custom text"

In the "Text" section scroll until you see "REPLACEMENT PATTERNS" expand that and grab the {{ field_name }} < the field you want to use.

then in the text section put

{{ field_name }} your additional text.
1
  • Thanks, a nice simple solution, solves my immediate problem. I know at some point I'm going to want to rewrite views output fields and expose more variables, so I'm going to try to figure out how this is done before the page is displayed.
    – pglatz
    Nov 9, 2020 at 16:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.