Textpattern CMS support forum

You are not logged in. Register | Login | Help

#21 2006-04-18 12:31:18

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

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

Ace of Dubs wrote:
Another quick question.. is there an easy way for me to link upm_images to an article and then have the article show a larger version of the image? Am I asking for too much?

You could probably do something like this in your excerpt form


<txp:permlink><txp:upm_article_image type="thumb"></txp:permlink> blah blah blah your text here

then in your article form

bc..
<txp:upm_article_image> blah blah blah your text here

replace upm_article_image with upm_image as desired.


Shoving is the answer – pusher robot

Offline

#22 2006-04-21 05:28:44

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

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

I think I found a bug:

if using multiple images (= multiple images IDs in the article image input field), the “class” attribute given to “upm_article_image” isn’t being applied to any of the images in the parsed output.

thanks.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#23 2006-04-22 03:55:21

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

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

In lists the class is applied to the list wraptag, not individual images within the list.

Offline

#24 2006-04-23 01:02:45

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

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

OK, if that wasnt a bug, maybe this one is:

I have this article form:
<code><li><txp:permlink><txp:title /><br />
<txp:upm_article_image class=“flog” limit=“1” type=“thumbnail” /></txp:permlink></li></code></code>

I call it from a page template with <txp:article_custom section="fotolog" form="floglist" />
It outputs a list of articles, with the thumbnail.

The problem is: the first thumbnail doesnt get the “flog” class.
All the other thumbnails in the list get the “flog” class.

Second: I have noticed that when using that code (type="thumbnail"), if an image doesnt have a thumbnail asociated (= no thumbnail for that image), i get this errors:

<code>tag_error <txp:upm_article_image class=“flog” limit=“1” type=“thumbnail” /> -> Warning: getimagesize(): Unable to access /home/exaudi/public_html/images/9t.gif on line 721
tag_error <txp:upm_article_image class=“flog” limit=“1” type=“thumbnail” /> -> Warning: getimagesize(/home/exaudi/public_html/images/9t.gif): failed to open stream: Conseguido on line 721</code>

thanks for the magic, Mary.

pd: if you want, you can see the first “bug” here (look the list on the right side and check the class for each thumbnail: the first one doesnt have the class aplied).


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#25 2006-04-23 06:43:22

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

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

What should it do/show if there isn’t a thumbnail?

Offline

#26 2006-05-01 06:49:53

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

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

bump:

What should it do/show if there isn’t a thumbnail?

Should it display an error message or warning? Should it display nothing at all? Or perhaps dependant upon your production setting?

That error is strange, as getimagesize() should only get run if the database says a thumbnail should be there. Did you change/remove any thumbnails outside of Textpattern? That might explain it.

The class thing is also weird.

If it’s a list the class should be applied to the wraptag, not to any of the individual list items.

Now, you’re applying limit="1", is that because you’ve got more than one article image defined for each article, but you just want the first one?

If so, that’d mean that each thumbnail would be handled by upm_article_image_list rather than upm_article_image (because of how the check is done at this moment), but then I can’t see where any of the items are getting the class from at all.

Is it possible that some of those articles have more commas then there should be? i.e: 1,,2,3,?

Offline

#27 2006-05-01 16:31:05

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

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

hi Mary. please, excuse me for not answering before.

What should it do/show if there isn’t a thumbnail?

good question! i dont know… maybe an img tag with empty src attribute?

That error is strange, as getimagesize() should only get run if the database says a thumbnail should be there. Did you change/remove any thumbnails outside of Textpattern? That might explain it.

No. I didnt create a thumbnail for those images, so I didnt change/remove any of it. The solution to the error was to… create thumbnails for those images.

If it’s a list the class should be applied to the wraptag, not to any of the individual list items.

In the following snippet (the “trouble” one) there isnt a wraptag attribute defined:
<code><li><txp:permlink><txp:title /><br />
<txp:upm_article_image class=“flog” limit=“1” type=“thumbnail” /></txp:permlink></li></code>
and the first thumb of the recent list doesnt get the class applied.

But… reading your suggestion, I have tried defining a wraptag attribute:
<code><li><txp:permlink><txp:title /><br />
<txp:upm_article_image class=“flog” limit=“1” type=“thumbnail” wraptag=“span” /></txp:permlink></li></code>
And you know what? It worked as expected! -> all the images get a <span class="flog"><img /></span>

So, a new hypothesis for the “bug”: when there is no wraptag defined, the first <img /> tag doesnt get the class applied.

Now, you’re applying limit=“1”, is that because you’ve got more than one article image defined for each article, but you just want the first one?

Yes, because of the hybrid photolog I have created. There is a main photo and also a thumbnails gallery for each fotolog entry (= article). So, I use the “article image” field to define all them: the main photo and the asociated photos.

Is it possible that some of those articles have more commas then there should be? i.e: 1,,2,3,?

I have checked and no. There are three entries right now: one with multiple images (= multiple ids in the “article image” field) and two with just one image id in that field.

thanks Mary.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#28 2006-05-01 21:23:40

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

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

Thanks Julián, I’ll try and get this sorted.

Offline

#29 2006-05-07 00:04:16

Rexel
Member
Registered: 2005-11-18
Posts: 26

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

I’ve tried
<txp:upm_image type="image" image_id="119">3</txp:upm_image>
as a wrapping tag in the write article tab but it don’t work.
Any Ideas why?
Also I’m trying to swap some images on one page with getElementById but I couldn’t link to the images without writing a complete XHTML code and the onclick eventhandler in the article write tab, not ideal if my client will be updating some images himself.
Also the image alt attributes will be swaped by the title attribute by use of javascript, again found myself hard coding.

Last edited by Rexel (2006-05-07 00:11:30)

Offline

#30 2006-05-07 01:10:20

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

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

…but it don’t work.

Care to elaborate?

Read the plugin help. It shows you how to use the plugin to output custom markup.

Offline

Board footer

Powered by FluxBB