Comments
A template comment starts with {* and ends with *}. The template system skips it, so it never reaches the page, unlike an HTML comment, which every visitor can read in the page source.
{* A single line comment. *}
{* A comment that spans
several lines. *}
<!-- An HTML comment: sent to the browser. -->
A comment can stand anywhere outside a string, including around template code you want to switch off for a while:
{* {node_view_gui content_node=$node view='line'} *}
Comments do not nest
The first *} ends the comment, whatever came before it. In this example the comment ends after "inner", and the rest is printed:
{* outer {* inner *} after *}
The output is after *}. To switch off a block that already contains comments, comment out each part, or wrap the block in {if false()}...{/if}.
The standard templates start with the comment {* DO NOT EDIT THIS FILE! Use an override template instead. *}. It is a reminder that design/standard/ is replaced on every upgrade: copy a template into your own design before changing it.
Contributors
- Balazs Halasy
- Geir Arne Waaler
- Graham Brookins Updated Maintainer
Comments
Add a comment