What is the meaning of triple curly braces {{{ }}} in phtml template files? When and how do we use them?












2















There is a phtml template file in one of the third party Magento 2 extension which has triple curly braces {{{ }}} in it.

When is this notation used, What does it represent?










share|improve this question





























    2















    There is a phtml template file in one of the third party Magento 2 extension which has triple curly braces {{{ }}} in it.

    When is this notation used, What does it represent?










    share|improve this question



























      2












      2








      2








      There is a phtml template file in one of the third party Magento 2 extension which has triple curly braces {{{ }}} in it.

      When is this notation used, What does it represent?










      share|improve this question
















      There is a phtml template file in one of the third party Magento 2 extension which has triple curly braces {{{ }}} in it.

      When is this notation used, What does it represent?







      magento2.2 template phtml






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 1 hour ago









      magefms

      1,439224




      1,439224










      asked 1 hour ago









      nikinnikin

      778315




      778315






















          2 Answers
          2






          active

          oldest

          votes


















          2














          Magento uses option "noEscape" set to true when compiling the template if you want to use {{ }} when {{{ }}} are required to successfully replace the templates.




          /vendor/magento/magento2-base/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Address/Renderer.php




          Above is the reference where Magento V 2.2.4 uses Render output from Address fixture according to data format type using variables.




          • Handlebars HTML-escapes values returned by a {{expression}}.

          • If you don't want Handlebars to escape a value, use the
            "triple-stash", {{{.






          share|improve this answer



















          • 1





            Good explanation. +1

            – Shoaib Munir
            54 mins ago











          • Thanks, Shoaib Munir :)

            – Aaditya
            53 mins ago



















          1














          Handlebars HTML-escapes values returned by a {{expression}}. If you don't want Handlebars to escape a value, use the "triple-stash", {{{.



          <div class="entry">
          <h1>{{title}}</h1>
          <div class="body">
          {{{body}}}
          </div>
          </div>


          with this context:



          {
          title: "All about <p> Tags",
          body: "<p>This is a post about &lt;p&gt; tags</p>"
          }


          results in:



          <div class="entry">
          <h1>All About &lt;p&gt; Tags</h1>
          <div class="body">
          <p>This is a post about &lt;p&gt; tags</p>
          </div>
          </div>


          Reference: http://handlebarsjs.com/#html-escaping






          share|improve this answer























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "479"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f265579%2fwhat-is-the-meaning-of-triple-curly-braces-in-phtml-template-files-when%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            2














            Magento uses option "noEscape" set to true when compiling the template if you want to use {{ }} when {{{ }}} are required to successfully replace the templates.




            /vendor/magento/magento2-base/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Address/Renderer.php




            Above is the reference where Magento V 2.2.4 uses Render output from Address fixture according to data format type using variables.




            • Handlebars HTML-escapes values returned by a {{expression}}.

            • If you don't want Handlebars to escape a value, use the
              "triple-stash", {{{.






            share|improve this answer



















            • 1





              Good explanation. +1

              – Shoaib Munir
              54 mins ago











            • Thanks, Shoaib Munir :)

              – Aaditya
              53 mins ago
















            2














            Magento uses option "noEscape" set to true when compiling the template if you want to use {{ }} when {{{ }}} are required to successfully replace the templates.




            /vendor/magento/magento2-base/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Address/Renderer.php




            Above is the reference where Magento V 2.2.4 uses Render output from Address fixture according to data format type using variables.




            • Handlebars HTML-escapes values returned by a {{expression}}.

            • If you don't want Handlebars to escape a value, use the
              "triple-stash", {{{.






            share|improve this answer



















            • 1





              Good explanation. +1

              – Shoaib Munir
              54 mins ago











            • Thanks, Shoaib Munir :)

              – Aaditya
              53 mins ago














            2












            2








            2







            Magento uses option "noEscape" set to true when compiling the template if you want to use {{ }} when {{{ }}} are required to successfully replace the templates.




            /vendor/magento/magento2-base/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Address/Renderer.php




            Above is the reference where Magento V 2.2.4 uses Render output from Address fixture according to data format type using variables.




            • Handlebars HTML-escapes values returned by a {{expression}}.

            • If you don't want Handlebars to escape a value, use the
              "triple-stash", {{{.






            share|improve this answer













            Magento uses option "noEscape" set to true when compiling the template if you want to use {{ }} when {{{ }}} are required to successfully replace the templates.




            /vendor/magento/magento2-base/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Address/Renderer.php




            Above is the reference where Magento V 2.2.4 uses Render output from Address fixture according to data format type using variables.




            • Handlebars HTML-escapes values returned by a {{expression}}.

            • If you don't want Handlebars to escape a value, use the
              "triple-stash", {{{.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered 1 hour ago









            AadityaAaditya

            4,01421037




            4,01421037








            • 1





              Good explanation. +1

              – Shoaib Munir
              54 mins ago











            • Thanks, Shoaib Munir :)

              – Aaditya
              53 mins ago














            • 1





              Good explanation. +1

              – Shoaib Munir
              54 mins ago











            • Thanks, Shoaib Munir :)

              – Aaditya
              53 mins ago








            1




            1





            Good explanation. +1

            – Shoaib Munir
            54 mins ago





            Good explanation. +1

            – Shoaib Munir
            54 mins ago













            Thanks, Shoaib Munir :)

            – Aaditya
            53 mins ago





            Thanks, Shoaib Munir :)

            – Aaditya
            53 mins ago













            1














            Handlebars HTML-escapes values returned by a {{expression}}. If you don't want Handlebars to escape a value, use the "triple-stash", {{{.



            <div class="entry">
            <h1>{{title}}</h1>
            <div class="body">
            {{{body}}}
            </div>
            </div>


            with this context:



            {
            title: "All about <p> Tags",
            body: "<p>This is a post about &lt;p&gt; tags</p>"
            }


            results in:



            <div class="entry">
            <h1>All About &lt;p&gt; Tags</h1>
            <div class="body">
            <p>This is a post about &lt;p&gt; tags</p>
            </div>
            </div>


            Reference: http://handlebarsjs.com/#html-escaping






            share|improve this answer




























              1














              Handlebars HTML-escapes values returned by a {{expression}}. If you don't want Handlebars to escape a value, use the "triple-stash", {{{.



              <div class="entry">
              <h1>{{title}}</h1>
              <div class="body">
              {{{body}}}
              </div>
              </div>


              with this context:



              {
              title: "All about <p> Tags",
              body: "<p>This is a post about &lt;p&gt; tags</p>"
              }


              results in:



              <div class="entry">
              <h1>All About &lt;p&gt; Tags</h1>
              <div class="body">
              <p>This is a post about &lt;p&gt; tags</p>
              </div>
              </div>


              Reference: http://handlebarsjs.com/#html-escaping






              share|improve this answer


























                1












                1








                1







                Handlebars HTML-escapes values returned by a {{expression}}. If you don't want Handlebars to escape a value, use the "triple-stash", {{{.



                <div class="entry">
                <h1>{{title}}</h1>
                <div class="body">
                {{{body}}}
                </div>
                </div>


                with this context:



                {
                title: "All about <p> Tags",
                body: "<p>This is a post about &lt;p&gt; tags</p>"
                }


                results in:



                <div class="entry">
                <h1>All About &lt;p&gt; Tags</h1>
                <div class="body">
                <p>This is a post about &lt;p&gt; tags</p>
                </div>
                </div>


                Reference: http://handlebarsjs.com/#html-escaping






                share|improve this answer













                Handlebars HTML-escapes values returned by a {{expression}}. If you don't want Handlebars to escape a value, use the "triple-stash", {{{.



                <div class="entry">
                <h1>{{title}}</h1>
                <div class="body">
                {{{body}}}
                </div>
                </div>


                with this context:



                {
                title: "All about <p> Tags",
                body: "<p>This is a post about &lt;p&gt; tags</p>"
                }


                results in:



                <div class="entry">
                <h1>All About &lt;p&gt; Tags</h1>
                <div class="body">
                <p>This is a post about &lt;p&gt; tags</p>
                </div>
                </div>


                Reference: http://handlebarsjs.com/#html-escaping







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 1 hour ago









                Shoaib MunirShoaib Munir

                1,9431627




                1,9431627






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Magento Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f265579%2fwhat-is-the-meaning-of-triple-curly-braces-in-phtml-template-files-when%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    CARDNET

                    Boot-repair Failure: Unable to locate package grub-common:i386

                    濃尾地震