Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6101337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:29:18+00:00 2026-05-23T13:29:18+00:00

Is there a way to force expression engine to NOT render items within curly

  • 0

Is there a way to force expression engine to NOT render items within curly brackets as EE code?
The google chart tools uses javascript code that contains curly { } brackets, and naturally EE thinks it’s a variable and tries to render it. Any way around this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T13:29:18+00:00Added an answer on May 23, 2026 at 1:29 pm

    ExpressionEngine’s Template Class parses curly braces {} as template variables, looking for three kinds of variables: single, pair, and conditional variables:

    // Single Variable
    {summary}
    
    // Pair Variable
    {category} ... {/category}
    
    // Conditional Variable
    {if segment_2 != ""} ... {/if}
    

    Curly braces in CSS are considered a special condition.

    For example, the following CSS is acceptable to place anywhere in a template, and gets intelligently parsed:

    <style>
        /* All On One Line = Okay */
        p { margin-bottom: 1em; }
    
        /* Indented and On Separate Lines = Also Okay */
        p em {
            font-style: italic;
        }
    
        /* EE Variables are Parsed and Replaced */
        p.{site_name} {
            text-decoration: none;
            }
    
        /* EE Code is Allowed and Parsed Appropriately */
        {exp:channel:entries channel="channel_name" limit="1"}
            li.{url_title} a {
                color: #c00;
            }
        {/exp:channel:entries}
    </style>
    

    Unfortunately, JavaScript is handled differently and prevents the Advanced Conditionals Parser from processing anything in tags. For example, the following JavaScript with curly braces all on one line:

    <script>var addthis_config = { 'ui_click': true };</script>
    

    Will be parsed by ExpressionEngine as a template variable and rendered as:

    <script>var addthis_config = ;</script>
    

    You’ll notice everything starting at the opening { and ending with the closing } curly brace gets parsed and replaced! As a workaround, you can place the braces on separate lines and avoid this problem:

    <script>
        var addthis_config = {
            'ui_click': true,
            'data_track_clickback': true
        };
    </script>
    

    If you’ve written a JavaScript function that expects values from ExpressionEngine, just place your braces on separate lines — which is a good coding convention and is optimal for readability:

    <script>
        $(document).ready(function() {
            ...
                {exp:channel:entries channel="channel_name" limit="1"}
                    var business_name = '{business_website}';
                    var business_website = '{business_website}';
                {/exp:channel:entries}
            ...
        });
    </script>
    

    As suggested by Ben, you can change this behavior by setting a Hidden Configuration Variable: $conf['protect_javascript'] = 'n';

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way to force Visual Studio to copy selected code to the
In IronPython is there any way to force the expression containing integer values to
Is there a way to force a block of T-SQL code to run multi-threaded?
Is there any way to force a listview control to treat all clicks as
Is there any way to force an update of software using RunOnce, without having
Is there a way to force the flash garbage collector to clean up freed
Is there any way to force Outlook to display HTML in the desktop alert
Is there any way to force Text-Mate to use a two-space tab instead of
Is there a way to force IE or FF into a handheld mode for
Is there any way to force PHP to blow up (error, whatever) if I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.