Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-03-06 21:07:19

amordecosmos
Plugin Author
From: London (Hometown: Vancouver)
Registered: 2004-08-03
Posts: 118
Website

Pulling out the image id from an article

How can I capture an article’s image id in a form?

Because I would like to implement the nifty zoom thing from here, I need to create the code:

<a href="http://www.mysite.com/images/ID.jpg" />

<txp:article_image /> won’t do because it will create

<img src="http://www.mysite.com/images/ID.jpg" />

Any ideas?

Offline

#2 2010-03-06 21:22:54

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,315

Re: Pulling out the image id from an article

I think it was this here: <txp:php>echo $thisarticle['article_image'];</txp:php>

Edit Try and test with FF v3.0.n. I remember having unsatisfactory experiences opening images, not every picture would zoom in this demo there.

Last edited by uli (2010-03-06 21:34:19)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#3 2010-03-06 21:31:03

amordecosmos
Plugin Author
From: London (Hometown: Vancouver)
Registered: 2004-08-03
Posts: 118
Website

Re: Pulling out the image id from an article

Thank you for this, uli. That works.

Although I hate dipping into PHP with TXP, rather than use a tag. It always feels like cheating to me.

Offline

#4 2010-03-06 21:36:29

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,315

Re: Pulling out the image id from an article

amordecosmos wrote:

It always feels like cheating to me.

:)) I think developers might see it the other way round or see using tags like operating knives and forks with chopsticks or so. LOL

Please notice my caveat I added above.

Last edited by uli (2010-03-06 22:01:47)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#5 2010-03-06 22:29:39

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Pulling out the image id from an article

amordecosmos wrote:

Although I hate dipping into PHP with TXP, rather than use a tag. It always feels like cheating to me.

If you prefer using a plugin over PHP, upm_image can get the image id (and much more).

Offline

#6 2010-03-07 02:17:12

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Pulling out the image id from an article

Or if you like living on the edge you can install the latest development release, which has a host of new image-related tags.


Code is topiary

Offline

#7 2010-03-07 15:25:05

amordecosmos
Plugin Author
From: London (Hometown: Vancouver)
Registered: 2004-08-03
Posts: 118
Website

Re: Pulling out the image id from an article

Thank you, Els. upm_image is one of my ‘must-installs’ for every new site, but I did not know it could pull the id.

Jsoo, I need this for a live site so nix to the development release, but I’m very excited about the next version and its new tags.

Offline

Board footer

Powered by FluxBB