views:

86

answers:

4
+1  Q: 

HTML {% %} tags?

I was watching a video coding html, and I saw in the video they used a bit of code that looked like this:

<body>
{% block %}
{% endblock %}
</body>

Is this some form of commenting in html? I think the coder they were using was Espresso for Mac. I've just never seen it. The video is here: http://vimeo.com/7405114, at about 5 minutes in, toward the very end.

+5  A: 

They are Django template blocks:

http://docs.djangoproject.com/en/dev/ref/templates/builtins/

andynormancx
+2  A: 

Those are a Django block tag. They're used in template inheritance to define a block of text in a template that can be replaced in children templates.

Ignacio Vazquez-Abrams
A: 

Comments in HTML are created by <!-- and -->. The {% ... %} is propably a placeholder which gets replaced later.

dbemerlin
+1  A: 

If you look closely in the video it says that they are blocks for the Django template system.

They contain code in the Django template language.

Carmine Paolino