Categories > TinyButStrong general >

Problem while generating Templates with TBS

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Christoph Kuhlage
Date: 2005-11-17
Time: 12:38

Problem while generating Templates with TBS

Hi,

i want to generate templates for TBS with TBS. My problem is that when i want to replace a field like [var.user_link;htmlconv=no] with
[var.user_session_link;htmlconv=no] the char "[" is replaced with "[". I tried with LoadTemplate($templatename, '=userfunction') but the function "userfunction" is not called. What can i do?

Many thanks!

Christoph Kuhlage
By: Skrol29
Date: 2005-11-17
Time: 16:29

Re: Problem while generating Templates with TBS

Hello Christoph,

I have no problem with a custom function specified in the LoadTemplate() call. It works fine for me.

Did you know you can change the TBS tags delimitors ? For example, you could use "[]" for normal templates, and "{}" for templates of templates. This is secure.

But to anwser your first question, there are several other tips to disable the protection system ("[" replaced with "&#91" is a TBS protection), but they may have disadvantages.

* using parameter "protect=no"
   but you have to specify it for each TBS field

* using LoadTemplate('mytemplate',false)
   this will avoid the protection but it also avoid the Html conversion by default.

* using LoadTemplate('mytemplate','=myfunction');
   but you need to code a function that handles other wanted conversions.

* using the hidden property $TBS->Protect = false;
   but this is an undocumented feature which may change is future versions.
By: Christoph Kuhlage
Date: 2005-11-18
Time: 09:43

Re: Problem while generating Templates with TBS

Hi Skrol29,

i think i will use the solution with another delimitor.

Many Thanks

Christoph