Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-01-03 02:42:46

MikeB
New Member
Registered: 2009-01-03
Posts: 3

Reading global PHP variables into TXP:VARIABLES

I am trying to create a set of dynamic links that will allow me to load images and articles based on information passed via the URL. The filename for the image is derived from concatenating strings and is a global PHP variable. Is there a way to copy that global PHP variable to a TXP:Variable?

Offline

#2 2009-01-03 05:09:47

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: Reading global PHP variables into TXP:VARIABLES

Attribute parsing will help:

<txp:variable name="foo" value='<txp:php>global $bar; echo $bar;</txp:php>' />

Offline

#3 2009-01-03 08:45:17

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: Reading global PHP variables into TXP:VARIABLES

Also this method on TXP Tips might be useful.

Offline

#4 2009-01-03 12:30:13

MikeB
New Member
Registered: 2009-01-03
Posts: 3

Re: Reading global PHP variables into TXP:VARIABLES

Got it working.

Thanks….

Offline

#5 2009-01-03 15:02:20

MikeB
New Member
Registered: 2009-01-03
Posts: 3

Re: Reading global PHP variables into TXP:VARIABLES

I looked at the adi_gps plug in and installed it but can someone tell me how to use multiple arguments?

Offline

#6 2009-01-03 15:20:28

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: Reading global PHP variables into TXP:VARIABLES

The plugin help docs are quite complete with examples, but if they do not help, why not post in the plugin thread.

Offline

Board footer

Powered by FluxBB