DavidR
DavidR

Reputation: 5388

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.

Upvotes: 2

Views: 482

Answers (4)

Carmine Paolino
Carmine Paolino

Reputation: 2849

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.

Upvotes: 1

user253984
user253984

Reputation:

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

Upvotes: 0

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 799072

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.

Upvotes: 2

andynormancx
andynormancx

Reputation: 13762

They are Django template blocks:

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

Upvotes: 5

Related Questions