• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 806
  • Last Modified:

What kind of HTML file code is {% ... %}

What sort of code is this inside an HTML file and where can I learn more about it?  (My guess it is somehow related to Python.  Even so, I'm looking to for educational documentation.  I'm guessing not ASP since I think that is <% and %>)

{% if show_new_page(request) %}
  {% extends "base_new.html" %}
{% else %}
  {% extends "base_old.html" %}
{% endif %}

Open in new window

0
Hugh McCurdy
Asked:
Hugh McCurdy
  • 2
  • 2
  • 2
  • +2
1 Solution
 
Dave BaldwinFixer of ProblemsCommented:
The only thing I've found that is even close is jQuery templating but that doubles up the curly braces at the beginning and the end like "{{% else %}}".
0
 
Ishaan RawatDesigner | Developer | ProgrammerCommented:
according to me this is somekind of conditional ....
I'm sure its not ...

1.

HTML

2.

CSS

3.

jQuery

4.

PHP....
It can't be python ...
Its something else...
0
 
Gerwin Jansen, EE MVETopic Advisor Commented:
It's twig, have a look here for example:

http://twig.sensiolabs.org/doc/tags/extends.html
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Ishaan RawatDesigner | Developer | ProgrammerCommented:
yaa its a knd of PHP coding
0
 
gelonidaCommented:
This seems to be Django templating, as you mentioned Python.

It could also be twig, http://twig.sensiolabs.org/ which is the same (or at least very similiar) templating language for PHP

Probably you look at a web site driven by Django.

This means your HTMLtemplate is being processed by a Django view before being sent to a browser.


Some doc about Django templating:
https://docs.djangoproject.com/en/dev/topics/templates/
0
 
Hugh McCurdyAuthor Commented:
Django rings a bell.  Since I'd never used it, I just "noted it" when I was reading the docs.  Django is probably correct.  I'll investigate and assign points if that appears to be correct.

Thank you.
0
 
Hugh McCurdyAuthor Commented:
Thanks everyone.  Turns out that it is Django template code.
0
 
Gerwin Jansen, EE MVETopic Advisor Commented:
How can we know it's django? From the sample you gave it could very well be twig :)
0
 
gelonidaCommented:
Just looking at the template code, there is no easy way to find out whether it is Django or twig.
(Except one finds one template statement implemented in one and not in the other)

The mentioning of Python suggested Dlango as twig is used by PHP.

Without further information, about the server in question there is probably no way to distinguish them.

The only way to be sure is to look on the disks for either php files or python files referring to above mentioned template files. (In the 'worst' case though very improbable, they could even be used by PHP code AND by Python code)

I assume, that hmccurdy invistigated further on his server (or on the documentation about the server) to find out.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now