Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

  1. Index
  2. » Plugin support
  3. » smd_slimbox

#1 2007-01-19 22:31:26

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,453
Website GitHub

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.

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

#2 2007-01-20 00:51:51

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

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

#3 2007-01-20 02:11:11

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,453
Website GitHub

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:

  1. a negate on a cagegory. It would be great to be able to specify ‘display all image categories except this one’ etc.
  2. 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

#6 2007-01-20 10:52:15

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,453
Website GitHub

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

#7 2007-01-20 12:38:56

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,453
Website GitHub

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:

  1. 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.
  2. 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

#8 2007-01-26 11:30:44

raveoli
Member
From: Copenhagen
Registered: 2004-03-06
Posts: 205
Website

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

#9 2007-01-29 14:26:25

decoderltd
Member
From: London
Registered: 2006-06-20
Posts: 248
Website

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

#10 2007-01-30 01:26:24

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,453
Website GitHub

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 the if_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

#12 2007-01-31 10:19:47

decoderltd
Member
From: London
Registered: 2006-06-20
Posts: 248
Website

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

  1. Index
  2. » Plugin support
  3. » smd_slimbox

Board footer

Powered by FluxBB