0

After using Drupal 7 for years, I am now handed a Drupal 8 site to do some editing. I have created a custom input format (Plain HTML), and I want to print this field with this input format in a custom template. How can I achieve this?

With {{ content.field_mapka_markery }}, it prints plain text. There is no choice to select my newly created input format in the Manage display settings. Why is that? In Drupal 7 there is always a new formatter, but not so in Drupal 8.

I also tried {{ content.field_mapka_markery|raw }} or .value. |raw doesn't work at all, and .value does the same as without it.

2 Answers 2

0

The plain text format filters the text before storing, as far as I know. You need to store it as a formatted string. Then you can apply any filters you like.

2
  • No, input formats are used for rendering the field, not to alter the field value before storing it in the database.
    – avpaderno
    Commented Jan 19, 2018 at 18:27
  • It's not different from what done for the body field of nodes.
    – avpaderno
    Commented Jan 19, 2018 at 18:34
0

Managed to create a new field with "Text - Formatted - Long" as default, which allowed me to set up my custom text format. Why is that not possible for plain text field I am not sure.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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