Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

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

#193 2007-07-27 20:27:46

progre55
Member
Registered: 2006-05-02
Posts: 668

Re: smd_slimbox

Bloke:

Hope all is well. I have been following the board and it is great how active you are in assisting people with your plug in. As everyone who uses the plug in knows, it is an invaluable tool for website design.

I do have a question, how I currently use the tool is to show a gallery, allow the end user to select an image and then from there obviously they can scroll thru the remianing images. One comment I have received is that if the gallery has multiple images, you need to get out and go back in.

Is there anyway that you know (or anyone knows) where you could use slimbox, but have a flikr like capability. that is that the thumbnails would be prewsent on the bottom and allow for navigation that way.

Sorry for the long email, but any guidance would be appreciated.

Progre55

Offline

#194 2007-07-27 23:04:10

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

Re: smd_slimbox

Axel wrote:

the goal would be to show in the lightbox only the image/images of the article containing the clicked one… I place the images by using <txp:smd_slimbox imageid="4,5" />. The idea using the id of of the image as groupname="4,5" sounds like a solution to me.

OK, try v0.25 of the plugin which is groupname supercharged.

I’ve extended the groupname tag to allow ?id, ?name, ?author, ?ext (file extension), ?alt, ?caption, ?width and ?height, as well as the usual fixed string, ?c for category, and ?custom field options. This gives some more flexibility to the output, especially when used with orderby.

For example, if you had a gallery site showcasing different photographers and each photographer uploaded their own images you could do a page that showed a selection of all photographers:

<txp:smd_slimbox category="photos" orderby="random author" groupname="?author" showpagelinks="0" limit="100" />

That would show 100 thumbs of randomly selected images from the ‘photos’ category, and order them on the page by author. Note that they (currently) won’t be grouped logically on the page just yet (that’s extended presentation, hopefully in v0.3 of the plugin). The extra option groupname="?author" means that if a viewer clicked an image by photographer ‘charlie’ he could only navigate within charlie’s images from the lightbox. They would have to exit the lightbox and pick an image from another photographer first to see all their pics.

In your case, however, it’s going to depend how you set it up. If you are pulling out images using imageid=“4,5” then you can use groupname conventionally like this:

<txp:smd_slimbox imageid="4-8, 11" groupname="mygrp1" />
<txp:smd_slimbox imageid="9,10" groupname="mygrp2" />

Using unique groupnames means that images are constrained to that tag’s output.

If you are doing it that way, though, my guess is you are putting the slimbox tag in the article body itself? If so, might I suggest an alternative using a form to help cut down your workload. Put the slimbox tag in an article form instead and construct the tag something like this:

<txp:smd_slimbox imageid="?custom2" groupname="?custom2" />

When you create each article, list the images you want slimbox to show for that article in your custom2 field. e.g. 4,5, or 4-8,15,17 or whatever. Because the list of images is unique for each article and you have told the plugin to group images the same way it will limit the lightbox to only show images from a single article.

It’s quite confusing to explain but hopefully I haven’t lost you there! Play with the options and watch the effect it has on the images. But if you are really stuck, ask and I’ll see if I can find a better example.

is there a complete list of all slimbox/lightbox tags and its attributes somewhere around?

Only in the plugin docs or in the smd_slimbox_docs.html help file in the zip archive (scroll down a bit to find the list of attributes available).

Last edited by Bloke (2007-07-27 23:09:08)


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

#195 2007-07-27 23:22:58

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

Re: smd_slimbox

progre55 wrote:

One comment I have received is that if the gallery has multiple images, you need to get out and go back in.

Yes, it’s a “feature” of the slimbox approach. Once the lightbox is on-screen, you can only step thru images in the order they are given in the thumbs; there’s no random access. I agree it can be awkward but there’s not much I can do about it since as soon as that lightbox is on-screen, my plugin is out of the loop. You could try poking around on Christophe’s forum to see if anyone’s asked there, or request it.

(Which reminds me, I really should roll the latest version of his slimbox code into the plugin)

Sorry I can’t be of much use here. When and if I get time to spin-off smd_slimbox into a super-duper modular gallery plugin (as long as Crockery/someone else doesn’t beat me to it) I’ll take your idea into account; it makes a lot of sense. 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

#196 2007-07-28 22:10:47

gluteus
Member
From: Switzerland
Registered: 2007-01-20
Posts: 74

Re: smd_slimbox

Hello Stef

I read nearly every post here. I saw that I’m not the first with my problem.
So, here it is:
I created some gallerys with your great plugin in articles. If I click on the thumbnails in the section, everthing is fine.
Now, I would like to create some navigation. My idea is, for example I create a new article with links to the gallery-articles. I see the thumbnails, but if I click on them, the image will open in the same window without slimbox.
My articles are “live”, I guess it has to do with the “if_individual_article”-thing. Unfortunately I did not understand everything.
Here is an example of a gallery-article (article id=3):
<txp:smd_slimbox category="16_blasio" groupname="?c" orderby="id" />
This will show up correctly in my gallery-section.
Here is my article with the link to the gallery-article:
<txp:permlink id="3">Galerie 1</txp:permlink>
Article shows all thumbnails, but it opens the image “normally” in the browser.
Could you please give me a hint?

Thanks a lot

dave

Offline

#197 2007-07-29 00:20:31

wolle
Member
Registered: 2006-05-04
Posts: 19
Website

Re: smd_slimbox

Doesn’t know if it is a bug:

I want to choose a category, so I do:

<txp:smd_slimbox category="one-two-three" />

But no output! When I rename the category, that it contains only one minus-character (one-twothree) and call slimbox the same way:

<txp:smd_slimbox category="one-twothree" />

I get the (correct) output.

Any ideas?

Btw: Thanks for this nice plugin! :-)

Offline

#198 2007-07-29 08:17:54

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

Re: smd_slimbox

gluteus wrote:

I guess it has to do with the “if_individual_article”-thing.

Maybe yes. It sounds like the libraries aren’t being included on your page. Look at the source code for your individual article and see there are 3 files loaded (mootools.js, slimbox.js and slimbox.css). These are included by the smd_slimbox_inc tag.

Then go to your page with the article link on it and look at the source code. I think you will find those 3 files missing. Make sure you call smd_slimbox_inc on every page you have the possibility of using slimbox – on both article-list and individual-article pages. That should fix it.


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

#199 2007-07-29 08:27:10

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

Re: smd_slimbox

wolle wrote:

When I rename the category, that it contains only one minus-character (one-twothree) and call slimbox the same way… I get the (correct) output.

Are you using the latest version 0.21b of the smd_lib library?

I thought I fixed that a while ago. I can’t replicate the problem on my test site at the moment (but I’m using newer alpha versions of the code so maybe that’s why).

If it’s not that, let me know which versions of the code and library you are using and I’ll dig deeper.


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

#200 2007-07-29 09:34:29

wolle
Member
Registered: 2006-05-04
Posts: 19
Website

Re: smd_slimbox

Are you using the latest version 0.21b of the smd_lib library?

Yes: smd_lib version 0.21b, smd_slimbox version 0.25

If it’s not that, let me know which versions of the code and library you are using and I’ll dig deeper.

I like your plugin very much and I’m happy to use it. Thanks for your work!

Offline

#201 2007-07-29 12:54:16

[Axel]
Member
From: Switzerland/Denmark
Registered: 2007-07-26
Posts: 65
Website

Re: smd_slimbox

Bloke I owe you one!

The new version works like a charm, and does exactly what I wonted. the new features are just great.
A big THX also for including me in the plugin code.

Greetz [Axel]


Greetz [Axel]

Offline

#202 2007-07-29 17:55:32

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

Re: smd_slimbox

wolle wrote:

smd_lib version 0.21b, smd_slimbox version 0.25

Aha! Although I couldn’t exactly replicate your problem (I have categories like dan-kate-wedding and it’s fine) if any category contains a number and a hyphen it falls apart. I made some with dates in them like pix-2007-07-29 and it went mental trying to work out the ranges between the 3 numbers.

I’ve patched smd_lib to v0.21c so it now only looks at a range if it is entirely numeric and contains a single hyphen (as it should have done last time I ‘fixed’ it, d’oh!)

That should work for you, but there is one corner case that will still produce weird results; if you have a category named “2007-07” for example it’ll see the two numbers with the dash between them and think it’s a range of values. A temporary fix for this would be to put at least one non-numeric character in the category name, e.g. “p2007-07”.

This is fixable (I need to only allow number ranges in image IDs and not in categories) but it’s quite involved so I’ll save it for the next release. Thanks for spotting the problem. Let me know if it works ok now (or not!)


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

#203 2007-07-30 05:44:21

gluteus
Member
From: Switzerland
Registered: 2007-01-20
Posts: 74

Re: smd_slimbox

Bloke schrieb:

Then go to your page with the article link on it and look at the source code. I think you will find those 3 files missing. Make sure you call smd_slimbox_inc on every page you have the possibility of using slimbox – on both article-list and individual-article pages. That should fix it.

I use just one page. I looked in both source codes, they are there.
Here are the examples:
With js function
The same article and same images now as individual article.
Without js function

And they have the same head-section.
Any ideas?

Thanks.

Offline

#204 2007-07-30 07:42:54

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

Re: smd_slimbox

gluteus wrote:

I use just one page. I looked in both source codes, they are there… Any ideas?

Yes: when you specify the attributes for smd_slimbox_inc, make sure you put a / before the directory names. At the moment it is looking for the libraries in textpattern/slimbox/js/ and textpattern/slimbox/css/.

On your galerie index page, that resolves correctly, but when you view the individual article the path resolves to galerie/textpattern/slimbox/js/ and it cannot find the files there.

Try that and let me know how you get on.


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

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

Board footer

Powered by FluxBB