TinyButStrong - the PHP Template Engine
Categories > TinyButStrong general >

Is it possible to add url parameters to subtemplates

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs

By: Col
Date: 2011-05-11
Time: 02:31

Is it possible to add url parameters to subtemplates

I'm would like to do something like
[onload;script=includeme.php?width=50;getob]
however TBS will look for a script called 'includeme.php?width=50' not 'includeme.php' and pass the parameter 'width=50' to the script. Is it possible to do this somehow?

Thanks,
Col
By: Skrol29
Date: 2011-05-11
Time: 22:48

Re: Is it possible to add url parameters to subtemplates

> however TBS will look for a script called 'includeme.php?width=50'

This is an URL, only the browser can call such an URL, PHP cannot do an include of such a link.
But you can retrieve all parameters of the calling TBS field inside the target script.
When the script is called by this field, then you have the variable $CurrPrm
see http://www.tinybutstrong.com/manual.php#html_field_prm_script
So you can code:
[onload;script=includeme.php;width=50]

In "includeme.php" you can have:
$width = $CurrPrm['width']; //  = 50

By the way, parameter "getob" is no longer supported since TBS 3.0
By: Col
Date: 2011-05-12
Time: 02:46

Re: Is it possible to add url parameters to subtemplates

Thanks very much Skrol29. Despite working with TBS for a long time I am still learning new things.

parameter "getob" is no longer supported since TBS 3.0
These are old scripts that I am modifying. I'll update 'getob' to 'subtpl' as I modify them.