Textpattern CMS support forum

You are not logged in. Register | Login | Help

#31 2008-02-28 23:08:32

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,672
Website

Re: smd_gallery: calling all testing masochists :-)

jakob wrote:

Got a chance to play with it and it’s great! Not being familiar with your previous plugin or wet_for_each it took a bit of guessing to grab the article images.

Hey cool, glad it’s useful. You did it right. fwiw, if you need a cheat sheet of things that are available to you, temporarily give the plugin debug="4" as an option and it’ll spit out (towards the bottom of all the other gumph) a list of variables that the plugin can “see”. Any name to the left of a “=>” is fair game for putting a ‘?’ in front of (or an ‘!’ of course) in the plugin attributes; you can even make combos using them.

I used the tag a few times over (js variable definition in head, thumbs, images) but it worked fine without causing a huge number of queries.

Yeah, that’s something I’d love to fix. Ideally I’d like to have it so you could “set up” the info and then “use” those thumbs many times further on the page. Unfortunately it breaks down on article list pages and I haven’t figured out a way of overcoming it yet. Perhaps some conditional tags might work? But if you (or anyone) have any ideas then feel free to share :-)

Thanks for testing it for me. Feedback welcome any time.

Last edited by Bloke (2008-02-28 23:10:00)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#32 2008-02-29 08:09:54

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,487
Website

Re: smd_gallery: calling all testing masochists :-)

Yes, I did just that and looked through the copious debug infos. What I wasn’t sure about was the attribute to use as most(all) examples used category but some trial and error. I also put txp into debug mode and the plug-in then threw out some bugs but it worked all the same. They disappear when put back to live.

I didn’t use any forms just yet but what type should they be: misc?

One thing I had thought of was a {counter} variable which would be just the loop count (guessing: {counter}=$idx). I was revamping a site from 2004/2005 and the js originally used sequential numbers to number the divs and behaviours. I then twigged I could use the image IDs to have a unique ID.

EDIT:
One problem has arisen: where no article-images are specified it takes the first three from the database.

Last edited by jakob (2008-02-29 08:59:36)


TXP Builders – finely-crafted code, design and txp

Offline

#33 2008-02-29 09:07:08

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,672
Website

Re: smd_gallery: calling all testing masochists :-)

jakob wrote:

Yes, I did just that and looked through the copious debug infos. What I wasn’t sure about was the attribute to use as most(all) examples used category but some trial and error.

Thanks for the info jakob. I’ll add some more varied examples when I get chance. As you probably found out, id is the other common one for grabbbing stuff from the database.

I also put txp into debug mode and the plug-in then threw out some bugs but it worked all the same.

Oo-er. Not good. Can you remember what they were? I didn’t spot any on my site that’s running in debug mode, but I’m using an old version of PHP. I remember some people had errors under PHP5 from my plugins in the past. I’d best fix those.

I didn’t use any forms just yet but what type should they be: misc?

I don’t think it makes much difference (I never found a use for any form “types” aside from where they appear in the list!). I use misc most of the time.

One thing I had thought of was a {counter} variable which would be just the loop count (guessing: {counter}=$idx).

Y’know, I thought that was in there but maybe I forgot to add it. Well spotted. I’ll make sure it’s in there for the next version. Thanks.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#34 2008-03-12 03:19:19

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,672
Website

Re: smd_gallery: calling all testing masochists :-)

OK, I’ve gone ahead and officially released it. Fixed the problem jakob highlighted and added the counters he requested (thanks), and rolled all the docs/examples into the plugin.

The documentation will be ironed out over time as I find better ways of explaining stuff. If anyone has any input or cool forms/layouts/tags that demonstrate the plugin, please shout.

The directory mode is still untested but there’s not much call for it so it’ll probably stay dormant for a while yet. Anything else you find, please throw it in the official thread.

I’m really sorry masa but I’ve failed you on the random image thing so far. I tried loads of different ways to do it this evening and got most of the way there, but it just wasn’t very “clean”. Since the plugin iterates over each image one by one and cannot know in advance into which part of the form you want to put the random image, it can’t decide which image to choose. If I think of a cunning way round it I’ll be sure to include it in a future release.

Thank you to all the people who took time out of their precious schedules to test this hunk of code in its raw form and provide feedback. I hope it continues to help you out.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#35 2008-03-12 07:34:41

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

Re: smd_gallery: calling all testing masochists :-)

Shall I close and archive this thread, then? :)

Offline

#36 2008-03-12 08:12:34

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,672
Website

Re: smd_gallery: calling all testing masochists :-)

Mary wrote:

Shall I close and archive this thread, then? :)

Might as well, yes please.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

Board footer

Powered by FluxBB