开发者

HTML {% %} tags?

开发者 https://www.devze.com 2022-12-20 12:04 出处:网络
I was watching a video coding html, and I saw in the v开发者_运维知识库ideo they used a bit of code that looked like this:

I was watching a video coding html, and I saw in the v开发者_运维知识库ideo 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.


They are Django template blocks:

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


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.


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消