Skip to main content

Questions tagged [escaping]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
1 answer
805 views

Escaping quotes of an entry string used inside a script tag

How can I display an entry string, with included special characters (like single and double quotes) , inside a script tag without translating these special characters into html entities but escaping ...
Samuel's user avatar
  • 69
2 votes
2 answers
1k views

Convert characters to Ascii

Is there a twig filter to encode special characters like umlauts: {{ entry.title | filter }} Datensätze & Karten Which then should result in: datensaetze-karten Basically what '...
KSPR's user avatar
  • 3,786
1 vote
1 answer
2k views

Remove Quotes from Text Fields

My client needs to input apostrophes in text fields for staff names, such as ’ or just the plain ' and as you can imagine, it is causing issues. I have tried this replace({'\'',''}) and this ...
isral's user avatar
  • 113
2 votes
3 answers
1k views

Escape characters in format

I'm trying to find a method of escaping characters in Craft's DateTime object. This is the output I'm trying to achieve: 16th January 2016 This is what I've tried: {{ article.postDate.format('j\<\...
William Isted's user avatar
1 vote
1 answer
324 views

Ignore Twig's variable and transform it to Polymer's variable.

I've encountered on a problem with escaping, where I want some parts of code, not being translated by Twig. Straight to the problem. Polymer, uses the same marking for variables as Twig, and I'm not ...
Dominik Krulak's user avatar
1 vote
2 answers
750 views

Plain text field - apostrophes are getting escaped

I have a plain text field in Craft and the content has an apostrophe. On the front end, the apostrophe gets turned into &#039; Not ideal! Thanks in advance..
Luke Peters's user avatar
2 votes
1 answer
253 views

Convert textfield to be used in html class or id?

Does anyone know if it is possible to apply a Twig filter or use escaping to convert a Craft textfield into a html class/id safe string?
Alf Vestre's user avatar
2 votes
3 answers
978 views

How to use "&amp;" in richtext?

I'm currently finishing a client-website which has to be 100% valid HTML5. For one of the sections, I am using a matrix containing rich-text fields. This content is simply shown on the front page. The ...
Andre Mohren's user avatar
13 votes
2 answers
14k views

How to output a field as raw HTML?

I have a field in a matrix block that is used for video embed codes. I want to output the contents of that field directly as HTML. However, it always seems to get entity-encoded (ie. the < and > ...
Nick F's user avatar
  • 1,215
3 votes
1 answer
5k views

How can I escape Twig code to prevent it from being parsed?

How do I escape Twig code to prevent it from being processed?
nicael's user avatar
  • 2,382