ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

How to escape template tags in entries

September 01, 2011 4:30pm

Subscribe [3]
  • #1 / Sep 01, 2011 4:30pm

    morfunk

    1 posts

    In an entry which has a textarea, how do I output something like {this}.

    We blog a lot about code, tempting systems, etc. and I can’t figure out a way to simply show the above.

    Thanks,
    Dave

  • #2 / Sep 01, 2011 4:45pm

    We have also ran into this a lot with including JavaScript in templates which is sometimes unavoidable. The only workaround so far is to do something like the following…

    {
    this
    }

    Of course in your scenario you aren’t going to want line-breaks so that isn’t an option. Very interested to hear from the EE team if there is a solution for both our problems.

  • #3 / Sep 01, 2011 4:50pm

    morfunk

    1 posts

    Yep, exactly. I’ve used the line break trick to get it to not mess with some JavaScript in page templates, but for a blog post on a different templating system, there’s just no getting around it…

  • #4 / Sep 02, 2011 1:16am

    John Henry Donovan

    12339 posts

    Hi morfunk and welcome to the forums 😊

    Can you explain with some context as to why you wish to add this to a textarea?
    Is it a code example?

    Did you try wrapping it in <code> or <pre> tags. Or using the html entities for the curly braces?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases