Forum

Thread tagged as: Question, Problem, Field-Types

Using html in type="text"

I am building a template for a list of members. In Austria we have thing called "gendering" for titles. In order to do that, I have a field, that needs to output html.

<perch:content id="member_title" type="text" label="Titel des Mitglieds" />

My client is going to fill this with

Mag<sup>a</sup>, Dr<sup>in</sup>

If I just write it in like that, the output is just text, with <sup>'s in them. Can I not write html in the field-type text? Do I have to use the textarea field-type?

Thomas Semmler

Thomas Semmler 0 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

All text is HTML-encoded by default by the templating engine. That's just good practice.

If you don't want a field to be encoded, add encode="false" to the tag.

I tried that - but it didn't change anything.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Did you re-save your content?

Yes I did, but it didn't work.

But now that I picked it up again, it seems to work - so thanks for helping!