How can lines in a template be outcommented or otherwise be disabled (short of deleting the line)?
E.g. if file "base_weblog.html" contains:
{% load ProgramVersion %}{% render_month_links %}
How can this line be hidden at runtime?
This does not work (e.g. TemplateSyntaxError if ProgramVersion is not a valid tag library - that is why I want to outcomment):
{% if false %}
{% load ProgramVersion %}{% render_month_links %}
{% endif %}
Update 1. This solves it:
{% comment %}
{% load ProgramVersion %}{% render_month_links %}
{% endcomment %}
Just curious: why is "load ProgramVersion" evaluated in the first case and not in the second? Is it too complicated to optimise for possibly nested control structures (and comments can not be nested)? Note that "if false" above should have been "if False", but it makes no difference. With a non-existing variable, say XYZ, load is still evaluated.