Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Using global variables
In trying to find solution for this a possible solution came out to use php to declare a variable in article which would have article title in it, so then I can use it in another section not related with article itself.
Is this possible? How to do this?
Offline
Re: Using global variables
I really don’t think you need this. You could save this to a cookie using chs_cookie (the link to the plugin is missing there but you can find it here) and then retrieve it again in your form, but I think if you persevere with what you were trying in the other thread, you should be able to get it working without this roundabout method.
TXP Builders – finely-crafted code, design and txp
Offline
Re: Using global variables
Ok, so the main problem is solved, but in the meantime I found the answer to this question also, maybe someone found it useful in some situation:
Inside articles I placed
<txp:php> $GLOBALS[“subject”] = “value 1”; </txp:php>
and then in zem contact form
<li><txp:zem_contact_text label=“Subject:” default=”<txp:php> echo $GLOBALS[“subject”] ; </txp:php>” name=“tema” break=”“ required=“0” /></li>
Now, I’m not a programmer, so this is maybe not good, I don’t know, but it works.
Last edited by AndrijaM (2011-03-23 19:56:01)
Offline
Pages: 1