TDL Comments?

Posts   
 
    
jshallard
User
Posts: 62
Joined: 23-Mar-2005
# Posted on: 08-Jun-2005 13:23:42   

What is the Template Definition Language (TDL) syntax to add a comment to a Template? i.e. how can I add notes in a Template that will not end up in the generated code?

Apologies for the simple questions. I have had a look at the documentation, and can not seem to find the answer.

Thanks for any help

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39786
Joined: 17-Aug-2003
# Posted on: 08-Jun-2005 13:32:46   

There's no comment statement in TDL.

Frans Bouma | Lead developer LLBLGen Pro
jshallard
User
Posts: 62
Joined: 23-Mar-2005
# Posted on: 08-Jun-2005 15:01:33   

Thanks for the prompt response. I guess that is why i could not find the documentation!

The reason I want to use Template comments, is that I would like to mark sections of Template files where they have been edited from the originals. This means that if newer versions of the templates are released, it is much easier to identify the custom code and merge it in to the new versions.

If anyone else is wishing to do the same thing, I have found it can be achieved easily by using a "StringValueEquals" IF statement that will always evaluate to false. I have been using the following:

<[ If StringValueEquals TemplateName "Comment" ]> Comments <[ EndIf ]>

This will work as long as a Template Set is never created with the name "Comments".

An alternative would be to extend the TDL language - but the above should serve as a shortcut in the mean time.

Thanks

I would like to add that LLBL is an awesome tool - I only wish i had it several years ago! simple_smile

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39786
Joined: 17-Aug-2003
# Posted on: 09-Jun-2005 11:36:57   

jshallard wrote:

Thanks for the prompt response. I guess that is why i could not find the documentation!

The reason I want to use Template comments, is that I would like to mark sections of Template files where they have been edited from the originals. This means that if newer versions of the templates are released, it is much easier to identify the custom code and merge it in to the new versions.

If anyone else is wishing to do the same thing, I have found it can be achieved easily by using a "StringValueEquals" IF statement that will always evaluate to false. I have been using the following:

<[ If StringValueEquals TemplateName "Comment" ]> Comments <[ EndIf ]>

This will work as long as a Template Set is never created with the name "Comments".

An alternative would be to extend the TDL language - but the above should serve as a shortcut in the mean time.

You can also use a fake include statement:

<# This is a comment #>

Though that might confuse the reader. So you can invent your own comments: <#-- comment --#>

I would like to add that LLBL is an awesome tool - I only wish i had it several years ago! simple_smile

smile Thanks!

Frans Bouma | Lead developer LLBLGen Pro