Code

Opened 8 years ago

Closed 8 years ago

Last modified 5 years ago

#2721 closed enhancement (wontfix)

[patch] Allow block tags to be commented out

Reported by: SmileyChris Owned by: adrian
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: UI/UX:

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 SmileyChris 8 years ago.
patch, including tests

Download all attachments as: .zip

Change History (5)

Changed 8 years ago by SmileyChris

patch, including tests

comment:1 Changed 8 years ago by Alan Green

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

comment:2 Changed 8 years ago by Hawkeye

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 Changed 8 years ago by SmileyChris

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 Changed 8 years ago by adrian

  • Resolution set to wontfix
  • Status changed from new to closed

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.