Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
smd_slimbox
Yeah, yeah another lightbox-style image gallery! But this time primarily using Christophe Beyl’s ultra-lightweight Slimbox (diet coke version of lightbox) and mootools. Can also use other lightbox galleries such as Lightbox itself, Litebox, Moonbox, Thickbox and so on.
Download smd_slimbox | examples | styling | smd_lib
As ever with my stuff, comments, suggestions, improvements are welcome.
Happy gallerying!
Revision history
————————
All available versions and changes are listed here. Each entry indexes the relevant post(s) in this thread to learn about the features.
- 19 Jan 07 | 0.10 | Initial release
- 20 Jan 07 | 0.11 | Added !category (negation) support. Thanks Vitruvius
- 02 Feb 07 | 0.12 | Added imageid, with negation support (thanks wouaren) and textpos option (thanks lee)
- 06 Feb 07 | 0.20 | js and css can now be loaded elsewhere (thanks jstubbs). Added wraptag and changed defaults to make output less like tag-soup (thanks wouaren)
- 13 Feb 07 | 0.21 | Added orderby=‘fixed’ (thanks lee) and minor warnfix (thanks benjibot)
- 04 Mar 07 | 0.22 | Added MLP support, subcategory support and extended the category/imageid options. Now requires smd_lib (included in the zip file for convenience but available separately as well)
- 04 Mar 07 | 0.23 | Fixed orderby when using random (thanks mrdale) and added ability to override maxlimit
- 19 Mar 07 | 0.24 | Allowed smd_slimbox_inc to be ignored via
libcheck="0"
(thanks papuass) - 30 Jun 07 | 0.24b | Fixed paging in sub-directory installations (thanks ultramega and Qwest)
- 28 Jul 07 | 0.25 | Supercharged the groupname option (thanks [Axel])
- 31 Jul 07 | 0.25a | Maintenance upgrade only. No features, just bundled the latest slimbox/mootools library and fixed the help file
- 04 Aug 07 | 0.26 | Fixed paging to allow multiple slimbox tags per page to co-exist (thanks wheaticus)
- 22 Aug 07 | 0.27 | Added thumbnails-as-main-image option (thanks progre55)
- 30 Aug 07 | 0.28 | Added customisable captions under the main image (thanks Adam_V) and consolidated orderby (internal code)
- 14 Sep 07 | 0.29 | Added the thumbsize option to set thumbnail dimensions (thanks Simanek)
- 20 Sep 07 | 0.29a | Fixed undeclared index warnings (thanks Ambitiouslemon)
- 20 Oct 07 | 0.29b | Fixed the fix that broke in v0.24 (thanks Mr.Smith) and the ‘px’ thumbsize issue (thanks robin746)
- 03 Nov 07 | 0.210 | Uses smd_lib v0.3 so integer ranges are now only allowed in imageid. Added thumbtext/thumbtextclass/paramdelim. Deprecated showalt/showcaption/altclass/captionclass/textpos
- 28 Nov 07 | 0.211 | Uses smd_lib v0.31. Fixed some warnings and added onchange heading support (thanks karl.spencer, decoderltd)
- 20 Jan 08 | 0.212 | Added thumbtextwrap (thanks jodeci
?url
(thanks markusfalk) ; fixed whitespace around ‘?’ codes - 01 Apr 08 | 0.30 | Uses smd_lib v0.32. Backported features and refactorisation from smd_gallery ; added trigger, delim, navwraptag and linkclass (thanks marios) ; changed subcats and thumb (thanks fangonk) ; deprecated smd_slimbox_inc ; removed catlabel, libcheck and the deprecated atts from v0.210 ; renamed orderby as sort ; Moonbox, Lightbox, Litebox, Imagebox and Thickbox (jQuery) now supported ; also works with glz_custom_fields (thanks progre55 and gerhard)
- 09 Jun 08 | 0.31 | Fixed sort when using limit and saved a query (thanks robin746)
- 19 Dec 08 | 0.32 | Fixed MLP string bug
- 22 Feb 09 | 0.33 | Allowed rel removal (thanks OMGChris)
- 09 Feb 11 | 0.34 | Fixed PHP 5.3+ compatibilty (ereg_replace) and
thumb
attribute (both thanks akurei77)
Last edited by Bloke (2011-02-09 11:32:58)
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
Re: smd_slimbox
Woof! That’s a massive post. Thanks for being so specific.
You’ve ruined my weekend. I have to try it out. :)
I know what lightbox looks like, but do you have an example page to show how you’ve implemented it?
Thanks again.
Last edited by mrdale (2007-01-20 00:59:02)
Offline
Re: smd_slimbox
mrdale wrote:
Woof! That’s a massive post. Thanks for being so specific.
Yeah, I do tend to waffle ;-)
I know what lightbox looks like, but do you have an example page to show how you’ve implemented it?
Only got a couple of (roughly edited) pictures up so far, but take a look at the splash page for the Venturi game show to see it in action.
Last edited by Bloke (2007-01-20 02:15:37)
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
#4 2007-01-20 06:04:16
- Vitruvius
- Plugin Author
- Registered: 2004-09-21
- Posts: 125
Re: smd_slimbox
Wow – what a great plugin. The Slimbox component is only a small part of it – I will really get a lot of use out of the clever methods of pulling out / organising image categories. nice work. I will def. give it a try.
Two things I would love to see are:
- a negate on a cagegory. It would be great to be able to specify ‘display all image categories except this one’ etc.
- I know you can move through the images using the left and right arrow keys, but some type of text navigation when viewing the big images would be great.
Well done :)
SH
Offline
#5 2007-01-20 09:49:38
- lee
- Member
- From: Normandy, France
- Registered: 2004-06-17
- Posts: 831
Re: smd_slimbox
Thanks for the plugin.
Offline
Re: smd_slimbox
Vitruvius wrote:
I will really get a lot of use out of the clever methods of pulling out / organising image categories. nice work.
Thanks – it took some doing, but was really a case of standing on the shoulders of giants, as Newton once said. I’m sure there are better ways of doing some of the stuff, but my knowledge of the TXP api is limited at best so I did some stuff the hard way.
I would love to see… a negate on a cagegory.
Spookily enough I did think about that but it was already suffering from feature creep and I needed the plugin to work, like, now for the site I’m working on.
I’ve done that sort of thing in my earlier plugin (smd_random_banner) so it shouldn’t be hard to drop something like that in here. I was wondering if maybe “!name_of_category” might be the right terminology, or is that too geeky/programmery do you think?
some type of text navigation when viewing the big images would be great.
That part of it is out of my hands because it’s all Slimbox from the moment you click a thumbnail :-( Try the comments section of Christophe’s page for tips and hacks. I know you can click the right and left edges of the image to go fwd/back or use the “n” and “p” keys. “x” or “c” or ESC or clicking outside the image closes the lightbox. Past that I don’t know of any other keys. Yet.
Hope that helps.
Last edited by Bloke (2007-01-20 11:45:31)
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
Re: smd_slimbox
Bloke wrote:
I was wondering if maybe “!name_of_category” might be the right terminology…
What the heck, I did it anyway. Version 0.11 now has the ability to exclude categories by adding “!category_or_named_field” to the category=
option list.
It can get quite crazy because you can specify a field in the article to read the image category list from, and then override them; either with specific fields (e.g. category="?custom2, !birds"
) or with another field (e.g. category="?custom2, !custom1"
). Quite why you’d want to do that I have no idea, but I’m not going to stop you having fun :-)
Couple of caveats:
- The ‘positives’ are always taken first and then exclusions applied, regardless of the order you specify the list in the
category=
option. The relative order between all the ‘positives’ and all the ‘negatives’ is maintained, however. - If you specify a field name and that field happens to be empty in the current article, the name will be treated as an actual image category. This shouldn’t be too much of a problem unless you’re in the habit of naming your image categories things like “custom1” but it’s a potential source of confusion.
See how you get on with it. Feedback welcome, as always.
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
Re: smd_slimbox
1.
Damn this plugin was fast and easy to install.
2.
Damn this plugin makes a great looking, very functional image gallery. You rock Bloke-matey;-)
3.
Thank you very much for your effort!
4.
Have an nice weekend!
Offline
Re: smd_slimbox
Great plug-in, thanks.
I was wondering if you could help me understand some of the tags –
I have a Tennis club site and post images of various events. Each of my image categories are under a parent one called gallery
and ideally I’d like to be able to use the if_different
tag to automatically show all thumbnails by category without having to add a tag everytime I create a new image category (eg <txp:smd_slimbox category="finals-day-06" limit="10" />
) which I do everytime there is a new event.
Can I do this using the smd_slimbox
tags?
Offline
Re: smd_slimbox
decoderltd wrote:
Each of my image categories are under a parent one called
gallery
and ideally I’d like to be able to use theif_different
tag to automatically show all thumbnails by category without having to add a tag everytime I create a new image category… Can I do this using the smd_slimbox tags?
As Reverend Lovejoy said “..short answer yes with an if, long answer no with a but..”
Yes I think it might work if you can find a way of getting smd_slimbox
to iterate over a list of categories supplied by TXP. As of TXP4.0.4 I don’t think the image_index
handles sub-categories and, while category_list
does, it will not allow you to pass its output to another form or tag. Having said that, it’s late and I’ve just spectacularly lost a game of Risk, so if anyone does know how to do it please correct me.
Providing you can get a list of categories out, maybe using txp:if_different
to strip out the category name, you should be able to use slimbox like this:
<txp:smd_slimbox category="?c" limit="10" />
which would read the “current” category (I think: untested as I can’t find a way to emulate it).
If that doesn’t work then no it can’t do it right now, but I could add in some form of sub-category support if it’ll help you. It would probably require a new attribute recursive
and would have to take on several forms in order to handle recursively looking at the categories you want to include and/or the ones you don’t. Maybe the option could be two values separated by a colon, e.g. recursive="1:0"
would mean “recursively go down the list of categories I want to include but don’t bother with the children of ones I want to exclude”. A shortcut could be recursive="1"
to mean recursive="1:1"
.
If that’s too high granularity, maybe I should allow each named category to have a :1 or :0 after it to indicate whether that particular category should be traversed recursively or not? Just throwing ideas out here.
Essentially, all the code would do is look at every category in your list(s), then recursively find any requested child categories beneath them. Once all the images of all the categories have been found, the whole lot would then be output. It wouldn’t have any neat way of separating the images into sub-categories but if you ordered the result by category / name and used the groupname="?c"
option to label each change in category, you could probably use CSS Selectors to put each category into its own <div> or something, emulating if_different
(albeit clumsily).
It’s probably less work if txp could iterate the images, so if you let me know how you intend to use TXP’s tags to generate a list of categories I’ll see what I can do to make smd_slimbox play nicely with that list. Out of the box in its current form I don’t think it can do it, sorry.
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
#11 2007-01-30 05:25:40
- Vitruvius
- Plugin Author
- Registered: 2004-09-21
- Posts: 125
Re: smd_slimbox
Stef – just a quic note to say thanks for this plugin and the latest iteration – it’s great to have the negate function in the mix :)
I have downloaded and am having a fiddle.
SH
Offline
Re: smd_slimbox
Hi Stef,
That Reverend Lovejoy is a clever guy! Thanks for your great reply, I’ll roll up my sleeves and get experimenting with some tags to see if there’s a magic combination that works (!) – will keep you updated.
Offline