1

I have recently seen one HTML page.The code is embed with curly braces.Values for tags and loops are closed by curly braces.

            {% if authenticated %}
            <h1>Current User</h1>
            <p>{{user}}</p>
            {% else %}
            <h1>Current User</h1>
            <p>None</p>
            {% endif %} 

What is the actaul use of these type of code?

Is HTML embedded with any other language?

  • It's a templating system like Twig: http://twig.sensiolabs.org/ – patricksweeney Sep 22 '15 at 12:39
  • Possible duplicate: http://stackoverflow.com/questions/15279240/curly-brackets-in-html – Jay Sep 22 '15 at 12:40
  • possible duplicate of [What dose the curly-brace and percent sign mean in html?](http://stackoverflow.com/questions/14887579/what-dose-the-curly-brace-and-percent-sign-mean-in-html) – ajm Sep 22 '15 at 12:40
  • It might be Django as well... You see the server side code, this page is generated per request and the client doesn't see these – ItayB Sep 22 '15 at 12:41

2 Answers2

3

This may be Django script templates. Find more here.

1

This looks like the HTML is enriched with underscore.js or a similar templating engine.

It's used for displaying JavaScript data in your HTML without the need to know how JavaScript works.

Wavemaster
  • 1,794
  • 16
  • 27