How to Comment on Template Files? (. Tpl)
I Am Trying to Do Some Commenting on A. Html. Tpl File I'm Maintaining Using but It Would Return Syntax Error. How Do You Put Comment on Such Files? 5 Answers...
I am trying to do some commenting on a .html.tpl file I'm maintaining using
<!-- -->
but it would return syntax error.
How do you put comment on such files?
Solved! To comment on such files...I should use
{* INSERT COMMENT HERE *}
My file name is product_form.tpl
It works to me.
<!-- INSERT COMMENT HERE -->
It totally depends on template engine you are using. Some of them have no comment feature at all. You should carefully read documentation or browse source code if possible.
On my previous job I had to deal with really obsolete code from 90s with few internal-written template engines and at least in one of them I didn't find any comment feature after reading internal documentation. After browsing the code I realised that the template logic flow was based on top of few preg_replace calls with no comment feature implementation at all.
I think that the approved answer is correct only in that specific case. For example, in OVOLogistics PDF Generator for CS-CART all the following comments types don't work.
<!-- INSERT COMMENT HERE -->
{%* INSERT COMMENT HERE *%}
{* INSERT COMMENT HERE *}
As igronus said
It totally depends on template engine you are using. Some of them have no comment feature at all. You should carefully read documentation or browse source code if possible.
The only thing that worked for me was:
{%* INSERT COMMENT HERE *%}