Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-06-11 06:08:02

mhulse
Plugin Author
From: Eugene Oregon
Registered: 2005-01-21
Posts: 200

[solved] TXP and PHP questions

Hi,

Example code:

<txp:php>
global $thisarticle;
$article_image = $thisarticle[‘article_image’];
</txp:php>

Just curious how I would access the article image properties… for example, the above will return an ID, but what PHP can I use to get the URL or other values (caption, alt…) of that image ID?

Hmm, would I have to query the database with the image ID? If so, could someone post example code… or, even better, is there a good developer resource for looking these things up?

Related question: where can I look up TXP specific PHP functions and such… Is there a developer manual? How bout a plugin manual for developers?

Any help would be great!

Many thanks!
Cheers,
M

Last edited by mhulse (2007-06-11 07:05:31)

Offline

#2 2007-06-11 06:52:26

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

Re: [solved] TXP and PHP questions

mhulse wrote:

Just curious how I would access the article image properties… for example, the above will return an ID, but what PHP can I use to get the URL or other values (caption, alt…) of that image ID?

Dive into upm_image. It covers almost all aspects of accessing images and their properties in Textpattern.

where can I look up TXP specific PHP functions and such…

Textpattern contains some libraries which might be helpful.

How bout a plugin manual for developers?

Start here. Don’t miss that.

Offline

#3 2007-06-11 07:05:08

mhulse
Plugin Author
From: Eugene Oregon
Registered: 2005-01-21
Posts: 200

Re: [solved] TXP and PHP questions

Hi wet!

Perfect! Many thanks for the links and tips. :)

Your help is always excellent! I owe you one.

Have a great day.

Cheers,
Micky

Offline

Board footer

Powered by FluxBB