Comments in Template Editor

Support questions relating to the actifsource Template Editor

Comments in Template Editor

Postby eobermuhlner » Fri Sep 02, 2011 6:52 am

Is it possible to have comments in the template editor?

I want to comment the template without the comment being visible in the generated code.
Of course, using the comment syntax of the underlying language (in my case Java) also works - but the comment is visible in the generated code which might confuse the other developers.
eobermuhlner
 
Posts: 2
Joined: Fri Aug 26, 2011 11:18 am

Re: Comments in Template Editor

Postby micha » Fri Sep 02, 2011 1:24 pm

No, it is currently not possible to insert comments which only comment the template and are not inserted in the generated code.

As a workaround, the easiest way would be to create a function which always returns false. Then, create a context which calls this function in the selector and insert your comments there. You may want to use a different comment style to distinguish between generated comments of your target language and template comments.
micha
 
Posts: 21
Joined: Thu Aug 05, 2010 2:41 pm
Location: Switzerland

Re: Comments in Template Editor

Postby eobermuhlner » Fri Sep 02, 2011 2:55 pm

That is exactly the workaround that we discussed here.

We created a function:
Code: Select all
templateComment(Resource)

Since practically everything is a Resource we can reference the function from any context in the selector.

Also useful to disable entire blocks in the template that are not yet working.
eobermuhlner
 
Posts: 2
Joined: Fri Aug 26, 2011 11:18 am


Return to Template Editor

Who is online

Users browsing this forum: Google [Bot] and 1 guest