Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Image captions when using category links / upm_image
Hello again,
i am building a photographer’s web site using plugins upm_image and wet_for_each_image.
Images have been assigned to a number of image categories.
When going to a section/category like “club”, the i use an article inheriting the code
<txp:wet_for_each_image category=“club”>
<txp:upm_image image_id=”{id}” type=“thumbnail” url=”/category/club/?p={id}”>
</txp:upm_image>
</txp:wet_for_each_image>
to get thumbnail views
and to display a large view of a clicked thumbnail then under the thumbnails i use the tag
<txp:image_display />
Is there a way to extract the caption information for the large image view as well?
If i use upm_image for the large view, then it tells me that it can’t find the image id (needs to be one single number).
Any help is very appreciated.
Thank you in advance!
Last edited by jayrope (2009-09-30 16:02:26)
A hole turned upside down is a dome, when there’s also gravity.
Offline
#2 2009-09-30 18:01:34
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Image captions when using category links / upm_image
If you use the form
attribute in the upm_image tag in your code above, you can in that form use all the upm_image tags you need to display what you want.
If you need more details you’d better post in the plugin thread though.
Offline
Re: Image captions when using category links / upm_image
Thank you very much, Els (meanwhile i had gotten that far as well, actually, which gave my thumbnail lists captions: nice.).
However, what i needed doesn’t seem related to upm_image, but to wet_for_each_image (couldn’t find a plugin thread for this here.)
I mainly want to get around having to assign images uploaded each to a unique article as an article image.
Instead i want to use image categories to display respective thumbnail bars with that last image clicked from the thumbnail bar displayed in large size right below, but INCL. it’s caption text.
For this i needed to be able to pass an image id as a variable from the URL bar (like to http://www.mysite.com/category/club/?image_id=7) to wet_for_each_image for it to work with. I can’t seem to figure out how to do this, other than startign to write custom php for this.
Would you have an idea about this, eventually?
Thank you very much in advance.
A hole turned upside down is a dome, when there’s also gravity.
Offline
#4 2009-09-30 18:47:58
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Image captions when using category links / upm_image
Can you give an example of the html output you need to display this:
with that last image clicked from the thumbnail bar displayed in large size right below, but INCL. it’s caption text.
Offline
Re: Image captions when using category links / upm_image
Start here:
http://bendebiel.kliklak.net/club/
This page uses an article named “club” with the code
<div id="image_nav_full"><txp:wet_for_each_image category="club"><txp:upm_image form="image_thumbs" image_id="{id}" /></txp:wet_for_each_image></div>
The form called has the code
<li><a class="thumb" title="<txp:upm_img_name />" href="<txp:site_url/>category/<txp:upm_img_category />/?p=<txp:upm_img_id />"><img src="<txp:upm_img_thumb_url />" alt="<txp:upm_img_alt />"></a>
<div class="caption"><txp:upm_img_caption /></div></li>
That all works fine.
Now when i click one of those thumbnails, f. e the 1st one gets me to http://bendebiel.kliklak.net/category/club/?p=41.
The code comes from one general article answering those requests (bound to image categories). This article displays a minified thumbnail bar and one large image, which is referenced by “p=41” from within above’s link. Problem: i can;t seem to get a hold of the caption text of that large image.
Code used:
<div id="image_nav"><txp:wet_for_each_image exclude="sitedesign"><txp:upm_image image_id="{id}" form="image_thumbs" /></txp:wet_for_each_image></div>
<txp:image_display />
i use txp:image_display, because that’s the only tag, which works outside the wet_for_each_image condition. I can’t use an upm_image tag outside of this, as it doesn’t find an image id to work with. If i keep a upm_image tage within the wet_for_each_image condition i would display large images along with every thumbnail, but i only want the one clicked to display. That’s where i am hanging.
I though i could pass on a variable within the link, f.e. i tried using “image_id” instead of “p”, but taht doesn;t change a thing. It’s a scope thing, but i can;t solve it.
Was i more clear now?
Thank you very much for looking into this!
(added couple of bc.
s for better code display. -Els)
Last edited by els (2009-09-30 20:32:31)
A hole turned upside down is a dome, when there’s also gravity.
Offline
#6 2009-09-30 21:10:02
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Image captions when using category links / upm_image
jayrope wrote:
Was i more clear now?
Yes, very, thank you. You can use adi_gps to extract the image id from the URL. Replace your <txp:image_display />
tag with the necessary upm_image tag(s), something like this should work I think (not tested):
<txp:upm_image image_id='<txp:adi_gps name="p" />'>
<img src="<txp:upm_img_full_url />" width="<txp:upm_img_full_width />" height="<txp:upm_img_full_heigth />" alt="<txp:upm_img_alt />" />
<p><txp:upm_img_caption /></p>
</txp:upm_image>
Offline