Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-11-09 19:39:53

wet
Developer Emeritus
From: Vöcklabruck, Austria
Registered: 2005-06-06
Posts: 3,416
Website GitHub Mastodon

wet_for_each_image: Lists images by employing user supplied markup

Okay, you are definitely allowed to yawn: YAGP.

But this one’s different as it doesn’t doesn’t even render images: wet_for_each_image is a kind of master plugin whose only competence is to select images eligible for display, and then it delegates subsequent tasks to a worker markup whose duty is doing all of the hard work.

More information and download. Usage and code samples

Offline

#2 2006-11-09 21:21:23

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

Re: wet_for_each_image: Lists images by employing user supplied markup

Hey, this is pretty handy.


Shoving is the answer – pusher robot

Offline

#3 2006-11-10 00:45:29

soulship
Member
From: Always Sunny Charleston
Registered: 2004-04-30
Posts: 669
Website

Re: wet_for_each_image: Lists images by employing user supplied markup

It surely is, I was scratching my head until I checked out your sample page. This is nice and clean and extensible. Thanks Robert!

Last edited by soulship (2006-11-10 00:47:08)

Offline

#4 2006-11-10 05:49:54

wet
Developer Emeritus
From: Vöcklabruck, Austria
Registered: 2005-06-06
Posts: 3,416
Website GitHub Mastodon

Re: wet_for_each_image: Lists images by employing user supplied markup

As a clarification to Logoleptic’s comment added over there: wet_for_each_image and wet_thumbfilter are not competing in the same application area but are rather complementary. wet_thumbfilter iterates through selected articles, while wet_for_each_image runs over the images collection.

Offline

#5 2006-11-10 16:08:37

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

Re: wet_for_each_image: Lists images by employing user supplied markup

Have you thought of the having category attribute default to the current category if in a category page? That would make it perfect for category based galleries. Could always use asy_wondertag, already for that though.

In fact I think this combined with upm_image meet most of the desired more powerful Image tag requests


Shoving is the answer – pusher robot

Offline

#6 2006-11-10 16:41:09

soulship
Member
From: Always Sunny Charleston
Registered: 2004-04-30
Posts: 669
Website

Re: wet_for_each_image: Lists images by employing user supplied markup

Have you thought of the having category attribute default to the current category if in a category page?

I would second this request. This would eliminate then need for gallery plug-ins and any .js flavor gallery script you want could be used (and changed or updated) easily.

Last edited by soulship (2006-11-10 16:41:21)

Offline

#7 2006-11-11 00:48:55

wet
Developer Emeritus
From: Vöcklabruck, Austria
Registered: 2005-06-06
Posts: 3,416
Website GitHub Mastodon

Re: wet_for_each_image: Lists images by employing user supplied markup

hakjoon wrote:

Have you thought of the having category attribute default to the current category if in a category page?

Not thought of it yet, but it makes sense… Will fire up the trusty Eclipse. Stay tuned.

Offline

#8 2006-11-12 05:21:20

jagorny
Member
From: Portland, OR
Registered: 2006-08-24
Posts: 39
Website

Re: wet_for_each_image: Lists images by employing user supplied markup

I am very excited to try and integrate this into livesearch results…

Can you image having this pull up images whose category is a search term as well as articles? Ahh if only images were keyworded also… and links. BOOOOOO.

Yay for the plugin though…

Offline

#9 2006-11-12 07:32:14

wet
Developer Emeritus
From: Vöcklabruck, Austria
Registered: 2005-06-06
Posts: 3,416
Website GitHub Mastodon

Re: wet_for_each_image: Lists images by employing user supplied markup

hakjoon wrote:

Have you thought of the having category attribute default to the current category if in a category page?

Try this.

I’ve added a form attribute, too. This would allow “computed/dynamic” worker markup by getting the form name from a custom field or even elsewhere – one sick mind could imagine lots of possibilites with that.

Offline

#10 2006-11-12 17:04:55

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: wet_for_each_image: Lists images by employing user supplied markup

hakjoon wrote:

In fact I think this combined with upm_image meet most of the desired more powerful Image tag requests

You’re right. Thanks! Now I can do what I was hoping to do in a much simpler way.

Offline

#11 2006-11-12 22:21:30

squaredeye
Member
From: Greenville, SC
Registered: 2005-07-31
Posts: 1,495
Website

Re: wet_for_each_image: Lists images by employing user supplied markup

Wet,
I’m glad so many folks are getting good use out of this one :)
Maybe we can all come together and post our examples? That way we could spur one another on to greater heights.

Thanks as usual man. You truly are a computer.


Offline

#12 2006-11-20 03:29:04

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

Re: wet_for_each_image: Lists images by employing user supplied markup

Really nice plugin! One question – on your site, you have a lightbox gallery example. I used the same code for the form and it works fine, only issue is there are two br tags after each image, and I can’t see how to get the images to line up side by side, they go down from top to bottom!

Offline

#13 2006-11-20 05:15:13

wet
Developer Emeritus
From: Vöcklabruck, Austria
Registered: 2005-06-06
Posts: 3,416
Website GitHub Mastodon

Re: wet_for_each_image: Lists images by employing user supplied markup

If your code is inside an article, there’s a chance that those <br /> elements are inserted by Textile. View HTML on the article edit screen, and just in case try surrounding the gallery code with <notextile>...</notextile>.

EDIT: Had a try on my site with a similar result, so this would be the reason.

Last edited by wet (2006-11-20 05:25:09)

Offline

#14 2006-11-20 16:19:35

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

Re: wet_for_each_image: Lists images by employing user supplied markup

Thanks Robert, that worked nicely.

Offline

#15 2006-11-23 05:11:22

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

Re: wet_for_each_image: Lists images by employing user supplied markup

Hi wet.

Very nice and easy to use plug-in.

I’m trying it, but I must admit that performance concerns me.

I’m trying to achieve a very simple thing: a list of thumbnails in the logo category (with no links, nor pop-ups nor anything else, just the thumbnail images).
I have been testing both your plug-in and this method suggested in the FAQ.

I have tried both
<txp:wet_for_each_image category="logos" thumb="1"><txp:thumbnail id="{id}" /></txp:wet_for_each_image>
and
<txp:image_index wraptag="div" break="" c="logos" />

The first one (using your plugin) makes 72 queries (total page queries), while the second one (built-in tag) just makes 46 queries (total pages queries).

The output is almost identical (both including title and alt text for all images). The only difference is that the second method (less queries) wraps the thumbnail with, for my needings, a dummy link (can’t avoid that, that’s why I tried your plug-in).

The point is: what could be making the difference in queries quantity if the output is almost the same?

Thanks!

Last edited by maniqui (2006-11-23 05:29:54)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB