Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#337 2009-07-12 00:29:16

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: [plugin] [ORPHAN] upm_image: More powerful image display

Martin, thanks for the reply.

masa wrote:

I’m not sure if that helps, but upm_image has a plethora of attributes. Have you looked into break="value" for <txp:upm_article_image /> ?

Not yet. The fact that I get 4 individual <div>s, each with unique captions (but with all 4 images every time) makes me think that I’m doing is almost right. But it’s a good point nonetheless.

I think you could use title="<txp:upm_img_alt />". I’m posting one of my forms below as an example; just needs adding the title attribute.

You’re right. It was just a suggestion so that the plugin could do the legwork!

Offline

#338 2009-07-13 08:28:17

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: [plugin] [ORPHAN] upm_image: More powerful image display

  • Don’t forget about the wraptag attribute.
  • You only need to specify a form for upm_article_image if you’re going to customize the output in a way that the built-in doesn’t allow you to do (in which case do something like what Martin posted; use the tags in the “Customising Output” section of the plugin help).

Offline

#339 2009-08-14 22:58:38

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: [plugin] [ORPHAN] upm_image: More powerful image display

Although I’m able to achieve something using smd_gallery, I would like to know if it’s possible to do it with upm_image plugin. I’ve tried this in the past, but with no luck.
Nothing really fancy, just this: an article has some images assigned (comma-separated ids on article image field).
I want the first one to be output as a full image, and the remaining images as thumbnails.

Reading the documentation, it seems that the way (the only way?) to achieve this using upm_image plugin is by using the wrapform attribute in tandem with upm_img_list. The problem is that it’s not very clear (for me, at least) how to use them together.
Others have asked similar questions in the past (on this same thread), but there weren’t any answer for them.

So far, I’ve tried the simplest thing:

<txp:upm_article_image wrapform="article_img_list" />

And on form article_img_list:

<txp:upm_img_list />

Using just that, I get the following error message:

Tag error: <txp:upm_img_list /> -> Textpattern Notice: upm_image: invalid context, tag must be used within the tag as a wrapper or from its own form called by the tag. on line 561

I’ve tried a few variations that didn’t output any error message, but didn’t output anything at all either.

What’s the solution for this riddle?


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#340 2009-08-16 09:09:09

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: [plugin] [ORPHAN] upm_image: More powerful image display

I don’t know exactly what markup you’re looking for, but this should get you started:

<txp:upm_article_image limit="1" type="image" />

<txp:upm_article_image offset="1" type="thumbnail" />

Offline

#341 2009-08-16 16:25:42

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: [plugin] [ORPHAN] upm_image: More powerful image display

Hi Mary.
Thanks for the reply.
That code will certainly do it.

But now… I really want to know the mysterious behind wrapform and <txp:upm_img_list />. :)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#342 2009-08-18 03:26:32

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: [plugin] [ORPHAN] upm_image: More powerful image display

If memory serves, what you tried should work, albeit it wouldn’t be the output desired. Could be there’s a bug there, I’ll have to take a look.

Offline

#343 2009-12-03 22:39:04

aswihart
Member
From: Pittsburgh, PA
Registered: 2006-07-22
Posts: 345
Website

Re: [plugin] [ORPHAN] upm_image: More powerful image display

Hey Mary, wonder if you can help me out with this: when I use the upm_article_image tag like this…

<txp:upm_article_image wraptag="ul" class="galleria" break="li" show_alt="yes" show_title="yes" />

…it works great unless I only have one article image, when for some reason it’s output leaves out the <li></li> tags around the single <img> tag. This causes a problem with the Galleria plugin I’m using on my site, because the CSS I’m using requires the li tag around the img tag. Any help on this is much appreciated.

Last edited by aswihart (2009-12-03 23:20:22)

Offline

#344 2009-12-03 23:27:23

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

Re: [plugin] [ORPHAN] upm_image: More powerful image display

aswihart wrote:

…it works great unless I only have one article image, when for some reason it’s output leaves out the <li></li> tags around the single <img> tag.

Looks like expected behaviour, the plugin help says this:

break="value"

If using multiple images and the wraptag parameter, the (X)HTML tag to separate images with.

I assume that using the form attribute or the container tag (and putting the <li> tags inside the form or container) will solve it.

Offline

#345 2009-12-03 23:58:12

aswihart
Member
From: Pittsburgh, PA
Registered: 2006-07-22
Posts: 345
Website

Re: [plugin] [ORPHAN] upm_image: More powerful image display

doh! sorry that was an easy solution. Actually I was having problems using the form earlier with that Galleria plugin for some reason and switched to using the self-closing tag because it worked. Now the form is working fine and my single image articles get there li just like everybody else. Thanks Els!

Offline

#346 2009-12-08 20:23:50

jstubbs
Moderator
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: [plugin] [ORPHAN] upm_image: More powerful image display

Mary, I am using upm_image to create a slider, all works well except that only the first of several images displays and I can’t think right now how to get this working:

<txp:if_individual_article>
slider wrapper..
<txp:upm_article_image form="coda-slider-work" />
/slider wrapper...
</txp:if_individual_article>

Form coda-slider-work:

<div class="panel">
<div class="panel-wrapper">
<h2 class="title"><txp:title /></h2>
<txp:upm_article_image limit="1" />
</div>
</div>

As said all works well except it outputs the same article image 4 times instead of looping through the 4 images.

Output is like this:

<div class="panel">
<div class="panel-wrapper">
<h2 class="title">title1</h2>
<img src="/images/35.jpg" width="500" height="394" alt="home" title="The homepage" />
</div>
</div>
<div class="panel">
<div class="panel-wrapper">
<h2 class="title">title 2</h2>
<img src="/images/35.jpg" width="500" height="394" alt="home" title="The homepage" />
</div>
</div>
...
...

Probably a simple way to do this, but it escapes me right now ;-)

Offline

#347 2009-12-08 22:24:10

masa
Member
From: Asturias, Spain
Registered: 2005-11-25
Posts: 1,091

Re: [plugin] [ORPHAN] upm_image: More powerful image display

jstubbs wrote:

…, all works well except that only the first of several images displays…

Isn’t that what limit="1" should do?

I’m not quite sure, what you want the markup to look like, but the two extra divs in your upm form will be repeated for every image.

Offline

#348 2009-12-08 22:45:41

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

Re: [plugin] [ORPHAN] upm_image: More powerful image display

You have a upm_article_image tag inside the form used by the upm_article_image tag… I guess the first one, here:

<txp:if_individual_article>
slider wrapper..
<txp:upm_article_image form="coda-slider-work" />
/slider wrapper...
</txp:if_individual_article>

should be replaced with an article or article_custom tag.

Offline

Board footer

Powered by FluxBB