Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2006-02-07 07:33:27
- janw
- Member
- From: Groningen
- Registered: 2005-11-18
- Posts: 47
pass variables into txp-tags?
I want to pass variables to my txp-tags.
I use something like this:
<code><txp:php>global $film;$film = $_GET[“id”]</txp:php>
<txp:bas_flvplayer id=<txp:php>global $film;echo ‘\’‘ . $film . ‘\’‘;</txp:php> /></code>
But it doesn’t work…
What am I doing wrong?
Offline
Re: pass variables into txp-tags?
The parser does not support tags inside of tags. Since a TXP tag is nothing but a pointer to a function you could probably do
<code>
<txp:php>
global $film;
$film = $_GET[“id”];
bas_flvplayer([‘id’ => $film]);
</txp:php>
</code>
I haven’t tested this, just thinking out loud.
Last edited by hakjoon (2006-02-07 14:40:33)
Shoving is the answer – pusher robot
Offline
#3 2006-02-07 18:51:51
- janw
- Member
- From: Groningen
- Registered: 2005-11-18
- Posts: 47
Re: pass variables into txp-tags?
Thanks a lot but this doesn’t work.
It says expect ‘)’instead of ‘[’
Any more ideas?
Offline
Re: pass variables into txp-tags?
Sorry getting my languages mixed up. If this works any better.
<code>
<txp:php>
global $film;
$film = $_GET[“id”];
bas_flvplayer(array(“id” => $film));
</txp:php>
</code>
Shoving is the answer – pusher robot
Offline
#5 2006-02-07 19:05:23
- janw
- Member
- From: Groningen
- Registered: 2005-11-18
- Posts: 47
Re: pass variables into txp-tags?
Parse error: parse error, unexpected ‘=’, expecting ‘)’
Another language? :-)
Offline
Re: pass variables into txp-tags?
Oh well I’m out of ideas. That’s how I pass variables to the functions when I use them in plugins. Maybe it works differently inside the <txp:php>
tags (I’ve honestly never used them).
I think I was giving you perl there for minute. :)
Shoving is the answer – pusher robot
Offline
Pages: 1