Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#31 2007-02-13 16:13:46

lee
Member
From: Normandy, France
Registered: 2004-06-17
Posts: 831

Re: smd_slimbox

Stef, any chance of ordering images by id, something like <txp:smd_slimbox image_order_id=“24,26,19,21,25,18,27,28,29,30,20,17,23” />, so that the images are displayed in the order shown.

Or maybe make imageid respect the order of the ids as put into the plugin attribute.

Cheers
Lee

Last edited by lee (2007-02-13 16:17:42)

Offline

#32 2007-02-13 22:19:38

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,428
Website GitHub

Re: smd_slimbox

benjibot wrote:

Undefined variable where on line 276.

D’oh, a misplaced . was causing that. As you say, it was only a warning and caused no functional difference, but it’s nice to have a plugin give no errors even in debug! Thanks for the catch.

lee wrote:

any chance of ordering images by id…

Yes, there is now. It’s stupidly hard (read: awkward) to do. After going to great lengths to keep the order you specify as far as possible in the code, it was always destroyed by the database call itself. According to the docs, by default MySQL will “always display [retrieved data] in the order in which it was stored in the table.” Bah!

But since I know the order you specified stuff in, and keep it that way in the code, I just added an option that trawls through the output from the database and reindexes it in the order you specified! It’s not particularly efficient so with long lists of images you might find performance suffers, but it works. If anybody has any better algorithms, please share…

If you want to run it in this mode, specify orderby="fixed" and a list of images using imageid. It makes no sense (as far as I can see!) to fix the order of stuff specified by category, so this option only works if you add imageid to the mix.

Couple of things to be aware of: if you supply orderby="fixed" as an option with other categories and other orderby clauses, any imageid list you supply will automatically be shown first before everything else. Had to make a decision on this one and figured if you’re going to great lengths to fix the list of images it must be for a reason, so your list wins the supremacy battle. Also note that ‘fixed’ ignores :asc or :desc modifiers :-)

Give v0.21 a whirl and see 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.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#33 2007-02-13 22:21:27

joel
Member
Registered: 2004-11-26
Posts: 162

Re: smd_slimbox

I’ve discovered a strange issue on IE6 and 7 recently. The dark png-overlay doesn’t fill the screen when loading the full image. Everything else seems fine though.

Any ideas?

Offline

#34 2007-02-13 22:25:26

lee
Member
From: Normandy, France
Registered: 2004-06-17
Posts: 831

Re: smd_slimbox

Fantastic!!! Tested and working – many thanks.

Offline

#35 2007-02-13 22:28:49

lee
Member
From: Normandy, France
Registered: 2004-06-17
Posts: 831

Re: smd_slimbox

joel wrote:

I’ve discovered a strange issue on IE6 and 7 recently. The dark png-overlay doesn’t fill the screen when loading the full image. Everything else seems fine though.

Any ideas?

Works in IE6 for me.

Offline

#36 2007-02-13 22:32:52

joel
Member
Registered: 2004-11-26
Posts: 162

Re: smd_slimbox

I run windows on paralells on a mac. It shouldn´t make any difference though.

Offline

#37 2007-02-13 22:43:35

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,428
Website GitHub

Re: smd_slimbox

joel wrote:

I’ve discovered a strange issue on IE6 and 7 recently. The dark png-overlay doesn’t fill the screen when loading the full image. Everything else seems fine though.

Hmm, not seen it myself. Got a link to show what you mean? It might just be a screen res or driver issue (are you running at, like, 5120×4096 :-p) or another random IE bug to add to the extensive chalkboard.

My guess is, if there is an issue, it’ll be in the slimbox part of the code and not the thumbnail generation part of the plugin. See if anyone’s mentioned it on Christophe’s page or in the forums.


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

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#38 2007-02-13 22:49:27

joel
Member
Registered: 2004-11-26
Posts: 162

Re: smd_slimbox

The site is under construction. I can E-mail you a link if you have the time to have a look… :)

Offline

#39 2007-02-13 22:52:44

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,428
Website GitHub

Re: smd_slimbox

joel wrote:

The site is under construction. I can E-mail you a link if you have the time to have a look… :)

Go for it. I’ll see what I can see see see…


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

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#40 2007-02-13 23:01:38

joel
Member
Registered: 2004-11-26
Posts: 162

Re: smd_slimbox

joel wrote:

The site is under construction. I can E-mail you a link if you have the time to have a look… :)

Bloke wrote:

Go for it. I’ll see what I can see see see…

Thanx man! I truly appreciate it! :)

Last edited by joel (2007-02-13 23:15:57)

Offline

#41 2007-02-14 04:50:46

tollady
Member
Registered: 2006-12-06
Posts: 13

Re: smd_slimbox

Is there any way to add a class to just one of the cells? For example, I would like my output to be:

<a href=”#”><Img blah blah /></a>
<a href=”#”><Img blah blah /></a>
<a href=”#” **class=“className”**><Img blah blah /></a>

or

<a href=”#”><Img blah blah /></a>
<a href=”#”><Img blah blah /></a>
<div **class=“className”**><a href=”#”><Img blah blah /></a></div>

I figure it may be possible in combination with “ this tag but I’m not sure how.

Many thanks.

Last edited by tollady (2007-02-14 04:53:43)

Offline

#42 2007-02-15 10:18:25

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,428
Website GitHub

Re: smd_slimbox

tollady wrote:

Is there any way to add a class to just one of the cells?

As soon as you said this, I thought of how cool it would be to allow a different class at particular positions or every nth step, then followed your link to zem_nth!

I doubt we’ll be able to use zem_nth directly because of the tags-in-attributes limitation. But I don’t see any reason why it shouldn’t be possible to build that functionality into the plugin. I would want it to be flexible though so I propose the following idea… not thought it through yet so it may not be feasible but I think I can pull it off:

  • Allow more than one class to be specified for all *class attributes, e.g. cellclass="cell,cellalt,cellother"
  • Extend the class options in a similar way to the orderby tag. So you can specify modifiers to each classname to indicate the steps to which that class should be applied

I would allow any and all combinations of modifiers (wouldn’t want to limit your creativity!) so examples of the new syntax might be:

cellclass="mycell:odd, cellalt:even"

To add class mycell at 1,3,5… and cellalt at 2,4,6… etc.

cellclass="mycell:pos=3"

To force the mycell class to appear for the third thumbnail only on each page.

cellclass="mycell:pos=3;5"

To force the mycell class to appear for the third and fifth thumbnail on each page.

cellclass="mycell:pos=3-7;10"

To force the mycell class to appear for the third thru seventh thumbnail on each page, and the 10th.

cellclass="mycell, cellalt, cellother"

To loop over those three classes in the order given. So 1st thumb gets mycell, 2nd gets cellalt, third gets cellother, fourth gets mycell… etc.

captionclass="mycap:step=4"

Every fourth caption is given class mycap.

cellclass="mycell:step=2, altcell:step=3"

To add the mycell class to every other cell (same as mycell:even) and altcell every 3rd image.

At places where they clash (e.g. the 6th image) the last example would add both classes to that cell, so we would need another option to specify what behaviour the plugin should take when it detects a clash. Haven’t decided how to do that yet. Maybe a new global option classclash="1" or "0" to either allow or disallow multiple class defs per item? If you choose to disallow it, classes appearing first in your list take precedence. And any pos= modifiers take top priority.

Does that make sense?

For the ‘page’ level classes (e.g. navclass, prevclass, nextclass) the step values would dictate on which page those classes are applied. So navclass="mynav:step=3" means every third page give the nav area the classname ‘mynav’.

Before I take the plunge and see if I can add all this:

  1. Do you think the system would work, or is it too confusing?
  2. Besides, pos, step, even and odd, can you think of any more situations or modifiers people might need or conceivably use?
  3. Do you think the default for clashes should be “0” (always take the class order as precedent) or “1” (allow multiple defs per class)? Which makes more sense?

Your (or anyone’s!) input would be appreciated.

Of course, then I’ve just got to see if my coding’s up to scratch and deliver it… eeek!


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

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#43 2007-02-16 00:22:01

tollady
Member
Registered: 2006-12-06
Posts: 13

Re: smd_slimbox

That sounds great! Not sure if you need to get too complicated with it. The options in zem_nth seemed enough.
Your plans for pos, step, even and odd sound perfect.
Good luck. I’m looking forward to using it!

Offline

#44 2007-02-28 12:00:47

Spiceworm
New Member
Registered: 2007-02-28
Posts: 1

Re: smd_slimbox

I get this error:
tag_error <txp:smd_slimbox/> -> Warning: implode(): Bad arguments. on line 277

I think it is an installation error, but i can’t figure out what i’ve done wrong, i’ve placed the JS and CSS directory’s in both textpattern dir’s (www/textpattern/* and www/textpattern/textpattern/*

I’ve the feeling that i should place a php include somewhere?

edit:
i had to include <txp:smd_slimbox_inc jsdir=”/textpattern/js” cssdir=”/textpattern/css” />

while the JS and CSS directory’s are in the textpattern root dir. It probably has something to do with easyphp’s configuration, but thanks anyway.

Last edited by Spiceworm (2007-02-28 14:20:08)

Offline

#45 2007-02-28 23:56:57

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,428
Website GitHub

Re: smd_slimbox

Spiceworm wrote:

I get this error:
tag_error <txp:smd_slimbox/> -> Warning: implode(): Bad arguments. on line 277

Eeeek, that’s not supposed to happen, even if you do forget to use <smd_slimbox_inc />. It’s supposed to complain that you haven’t used smd_slimbox_inc and then stop dead in its tracks.

This error shouldn’t even appear if you use smd_slimbox_inc but give it the wrong location to find the js/css files, because all that does is govern the slimbox part of the plugin, not the thumb generation, which is where the error occurred. Can you remember what options you gave the plugin? Maybe I can figure it out from there.

I think I understand why it can appear (stupid coding assumption on my part), but can’t figure out the exact situation under which it does appear, if that makes any sense. Anyway, since it’s not a major issue I’ll try a fix for it in the next release. I’ve started a dev version of 0.22 that hopefully fixes that, plus it uses my new plugin library (smd_lib). That opens up the possibilty of enabling sub-categories, which is a major bonus.

When I get time I’ll build in the ‘nth class’ functionality for tollady too. And, if I’m feeling particularly adventurous, I may even add support for net-carver’s awesome Multi-lingual Publishing pack. There’s only two internal strings to localise in this plugin, but it’d be nice to have it in for completeness and for the localisation of captions/alts (plus it’s good practise). If you’re contemplating a multi-language site, you really need the MLP extension; it truly is brilliant.

Watch this space for the next rev in the next, umm, parsec or two.

Last edited by Bloke (2007-03-01 00:45:51)


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

Hire Txp Builders – finely-crafted code, design and Txp

Offline

Board footer

Powered by FluxBB