Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2008-09-25 10:25:17
- leafy_loader
- Member
- Registered: 2008-09-25
- Posts: 96
Associating more than one image to an article
I’m sure you’ve all come across this question many times and I apologise for bringing iit up again. I’ve spent the last few days trying to find a solution but had to concede defeat and sign up to this forumn in the hope someone can help. I’m new to textpattern and have managed to get on well so far.
I want to set up textpattern so that a user can associate more than one image to an article so that I can display those images along with the article. I know I could create a category for every article then call all the images associated with that category but I want to keep the process simple for the user plus it’s not how categories were meant to be used.
I’ve installed the upm_image plugin but this does not seem to be the answer to my problem or am I missing something here?
Hacking textpattern is not an option as I’m not familiar with it and simply do not have the time. I’ve invested alot of time learning how to use it so would rather find a solution then use another CMS but I may just have to.
Thanks.
Offline
#2 2008-09-25 11:35:45
- masa
- Member
- From: Asturias, Spain
- Registered: 2005-11-25
- Posts: 1,091
Re: Associating more than one image to an article
Try jm’s image picker – it allows you to select any number of images and inserts them as article images.
Offline
Re: Associating more than one image to an article
Or, as you already have the plug-in, you can add as many image id’s you like, as a comma-separated list, to the “Article image” field under “Advanced Options” in the “Write” tab then call them using Mary’s upm_image plug-in with a tag similar to <txp:upm_article_image wraptag="ul" class="articleImages" break="li" show_alt="yes" show_title="yes" />
. Obviously change the attributes to display the way you want.
Last edited by thebombsite (2008-09-25 15:01:05)
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Re: Associating more than one image to an article
hi leafy_loader,
upm_image is the way to go.
The question is:
how do you want the user to associate the images to the article?
freely?
That is, putting the images (upm_image
tags) right in the article body wherever the user wants -> then, also check upm_image_popper (they work in tandem)
or in a (previously defined) structured way?
That means, the placeholders (upm_article_image
) are already set on an article form for the images associated (on the article_image input field) to the article.
So, the user will pick a number of images, and they will be output on some place (predefined), probably above/below the article body.
form
, limit
and offset
attributes are your friends. And also, txp:upm_if_article_image_list
(which test if there is more than one image associated to the article).
Offline
Re: Associating more than one image to an article
You could also try Hak_article_image It works very well for me.
Offline
#6 2008-09-26 22:13:33
- leafy_loader
- Member
- Registered: 2008-09-25
- Posts: 96
Re: Associating more than one image to an article
Thanks guys, I didn’t realise you could comma separate the image id’s to associate them with an article. It doesn’t appear in the documentation
I can get the images to appear but I can’t figure out how to make them appear wrapped in an anchor tag wilth the href and title attributes for that tag. eg, output
<a href=“my_url” title=“click me”><img src=“img_src1” alt=“alt text” /></a>
<a href=“my_url” title=“click me”><img src=“img_src2” alt=“alt text” /></a>
<a href=“my_url” title=“click me”><img src=“img_src3” alt=“alt text” /></a>
If I use
<txp:upm_article_image wraptag=“div” break=“a” /> I get;
<a><img src=“img_src1” alt=“alt text” /></a>
<a><img src=“img_src2” alt=“alt text” /></a>
<a><img src=“img_src3” alt=“alt text” /></a>
is it possible to achive what I want?
The documentation really could do with some examples
Offline
#7 2008-09-26 22:29:46
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Associating more than one image to an article
leafy_loader wrote:
I didn’t realise you could comma separate the image id’s to associate them with an article. It doesn’t appear in the documentation
That’s because you can’t do that unless you’re using a plugin. See posts above for examples.
Offline
#8 2008-09-26 22:41:16
- leafy_loader
- Member
- Registered: 2008-09-25
- Posts: 96
Re: Associating more than one image to an article
Els wrote:
leafy_loader wrote:
I didn’t realise you could comma separate the image id’s to associate them with an article. It doesn’t appear in the documentation
That’s because you can’t do that unless you’re using a plugin. See posts above for examples.
Yes I know, I have the plugin. My point was that nothing in the documentation for the plugin instructed me that this was possible
Offline
Re: Associating more than one image to an article
leafy_loader wrote:
I can get the images to appear but I can’t figure out how to make them appear wrapped in an anchor tag wilth the href and title attributes for that tag. eg, output
I suppose you want to link a thumbnail to the full size version, right?
Use the form
attribute.
<txp:upm_article_image form="my_linked_image" />
Then, create a form my_linked_image
:
<a href="<txp:upm_img_full_url />" title="click me"><img src="<txp:upm_img_thumb_url />" alt="<txp:upm_img_alt />" /></a>
Offline
#10 2008-09-30 07:32:17
- leafy_loader
- Member
- Registered: 2008-09-25
- Posts: 96
Re: Associating more than one image to an article
Thanks Maniqui you have been a great help. One last thing though, if I wanted to apply a class to the 1st thumbnail I output will I have to write custom php or does the upm_image plugin allow for that?
Offline