Categories > TinyButStrong general >

undeclared variables - magnet

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Ianto
Date: 2010-11-19
Time: 11:57

undeclared variables - magnet

I want to delete a whole div section if a PHP variable has not been defined.

In this example below, will the div get deleted if 'varSomeText' has not been defined in the PHP script?

HTML:
<div>
...
[onshow.varSomeText;magnet=div]
...
</div>
By: Anonymous
Date: 2010-11-19
Time: 17:44

Re: undeclared variables - magnet

Ianto,

It should - if all else is okay.

What error were you getting from your code test?

Did you try with the var set and unset?

Magnets are covered very well in the manual at
http://www.tinybutstrong.com/manual.php#html_field_prm
By: Ianto
Date: 2010-11-19
Time: 22:07

Re: undeclared variables - magnet

Hello, I get this:

TinyButStrong Error in field [onshow.varSomeText...]: the PHP global variable named 'varSomeText' does not exist or is not set yet. This message can be cancelled using parameter 'noerr'.

I guess that I will need to include the 'noerr' param in every template field.

Cheers.