Opened 18 years ago

Closed 18 years ago

Last modified 16 years ago

#2721 closed enhancement (wontfix)

[patch] Allow block tags to be commented out

Reported by: Chris Beaven Owned by: Adrian Holovaty
Component: Template system Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Rather than having a new tag for comments (see ticket #648), it would be useful to be able to comment out block tags in code (this could be easily extended to variable tags too).

This is could provide the similar functionality as #648 since you can use the block tag as a comment, {%# MY COMMENT %}, without requiring a new template tag format.

Example:

{% #if female - always show for now %}
<p>You're a girl!</p>
{% #endif %}

Attachments (1)

commentable_block_tags.patch (2.9 KB ) - added by Chris Beaven 18 years ago.
patch, including tests

Download all attachments as: .zip

Change History (5)

by Chris Beaven, 18 years ago

patch, including tests

comment:1 by Alan Green, 18 years ago

This looks like a useful alternative to {% comment %} {% endcomment %} for single line comments.

comment:2 by Hawkeye, 18 years ago

I'm +0 on this... I prefer #648 -- I think it's more elegant and more semetric.

Still, there needs to be some mechanism to easily and efficiently insert readable comments into templates.

If this is going to be included, I don't see a reason not to use the originally suggested syntax (but I'd prefer this to nothing).

comment:3 by Chris Beaven, 18 years ago

Hawkeye, Adrian already expressed he didn't want another template tag syntax. This solution works inside of an existing tag, so it may get passed this criteria.

Let it be known that using this format as an inline comment doesn't have to be "officially" stated.
The main advantage and primary purpose of this patch is that this is useful for commenting out block tags without having to wrap them in a {% comment %} block.

comment:4 by Adrian Holovaty, 18 years ago

Resolution: wontfix
Status: newclosed

I'm marking this as a wontfix. If anything, #648 is better.

Note: See TracTickets for help on using tickets.
Back to Top