Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-01-22 21:08:05

lee
Member
From: Normandy, France
Registered: 2004-06-17
Posts: 831

Image caption

Can <code><txp:image id=?? /></code> please include the caption in the way it automatically includes the alt tag please.

Offline

#2 2006-01-22 21:29:49

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

Re: Image caption

You can do this with the upm_img_popper plugin. It handle a lot of image things.

Offline

#3 2006-01-22 21:43:09

lee
Member
From: Normandy, France
Registered: 2004-06-17
Posts: 831

Re: Image caption

I don’t want to train my non tech client to write out plugin tags in articles. The point of clicking “textpattern”, next to an image on the image tab, and being presented with a pop up window with the correct image tag text that can be copied/pasted into an article is imo the way it should be.

Offline

#4 2006-01-22 23:33:10

Jeff_K
Archived Plugin Author
From: Vancouver, British Columbia
Registered: 2005-08-19
Posts: 202
Website

Re: Image caption

I use a modified version of zem_article_image to output alt text. It is pretty specific and there are probably better ways to do this, but here it is if you are interested:

<code> function jk_alt_text($atts) { global $thisarticle,$pfr,$img_dir, $id; if (is_array($atts)) extract($atts);

$limit = 1; if (!empty($thisarticle[“article_image”])) { $images = array_slice(split(“,”, $thisarticle[“article_image”], $limit + 1), 0, $limit);

foreach ($images as $id) { $rs = safe_row(“*”, “txp_image”, “id=’$id’ limit 1”); if ($rs) { extract($rs); $out[]= “$alt”; } }

return join(“”,$out); } }</code>

Last edited by Jeff_K (2006-01-23 03:20:13)

Offline

#5 2006-01-23 01:09:33

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: Image caption

lee wrote:
The point of clicking “textpattern”, next to an image on the image tab, and being presented with a pop up window with the correct image tag text that can be copied/pasted into an article is imo the way it should be.

upm_img_popper basically gives you the image tab as a popup in the write tab. And it will insert the code for you so your user doesn’t have to learn anything new and doesn’t even have to cut and paste. It’s worth a try.


Shoving is the answer – pusher robot

Offline

Board footer

Powered by FluxBB