Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

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

#121 2007-04-29 12:28:08

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

Re: smd_slimbox

instantok wrote:

<txp:asy_wondertag><txp:smd_slimbox category="?<txp:custom_field name="gallery-image-category" />" /></txp:asy_wondertag>

Niiiice. I hadn’t got round to trying Sencer’s excellent plugin with slimbox; cool to know it works. Many thanks for the tip, instantok.

textpattern can see and output these variables from article lists but smd_slimbox cannot

Yes. At the time I replied to treb0r there was a bug in smd_lib, a side-effect of which prevented smd_slimbox showing custom fields/titles in article-list mode. Since pieman showed me the light regarding sticky articles, I fixed that bug and released v0.21b of smd_lib which also fixed the article list capability.

In my, albeit limited, testing I have managed to do the following. In a page template:

<txp:if_article_list>
<txp:article listform="excerpts" />
</txp:if_article_list>

In the form ‘excerpts’:

<txp:rss_auto_excerpt words="30" linkwraptag="span" />
<txp:smd_slimbox category="?custom2" imageid="?keywords" orderby="category,id" />

For each article in the list it then showed the thumbs from the categories listed in ‘custom2’ and the image ids from the ‘keywords’ field.

Putting the slimbox tag directly in a page template, however, does indeed prevent it from showing the thumbnails and in that case textpattern cannot (I believe: correct me if I’m wrong) “see” the article details.

After making sure you’re using v0.21b of smd_lib, if it doesn’t work natively for you in an article list, can you please provide example code of a situation in which it doesn’t work so I can see if there’s still a bug in the plugin? Thanks.

Last edited by Bloke (2007-04-29 12:30: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

#122 2007-04-29 12:58:55

instantok
Member
Registered: 2004-08-10
Posts: 20

Re: smd_slimbox

Bloke wrote:
I fixed that bug and released v0.21b of smd_lib which also fixed the article list capability.

Sweet. Updating to v0.21b fixed native support. That makes me much less nervous than depending on Sencer’s plugin. I knew I was missing something from that conversation but thought the downloads in the first post were updated.

Thanks Bloke!

Offline

#123 2007-04-29 13:24:26

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

Re: smd_slimbox

instantok wrote:

I knew I was missing something from that conversation but thought the downloads in the first post were updated.

D’oh! I’d forgotten to update the 1st post. Sorry for the confusion. Updated now.


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

#124 2007-05-04 11:02:58

ultramega
Member
Registered: 2006-02-26
Posts: 221

Re: smd_slimbox

Woaah, just noticed that little gem, you can limit the amount of thumbs visible at the time :) Cool. But using that generates link which directs to an no-existing page. My TXP-installation is in subfolder, which seems to mess it up. (manually entering the subfolder to the generated url directs to right page with correct thumbs). Can I fix this somewhere?

Other thing, where can I change the paragraph “image 1/10” showed under big pictures? Can I even translate it, I’m using MLP already?

Offline

#125 2007-05-04 20:18:39

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

Re: smd_slimbox

ultramega wrote:

My TXP-installation is in subfolder, which seems to mess it up.

Curious, but entirely possible. I haven’t checked it out in a subdir. I’m using a built-in textpattern variable to get hold of the image directory, which I assumed would take care of the sub-directory for me. Maybe it doesn’t (unlikely) or I’m using it wrong (much more likely). I’ll run some tests on subdir installs and see what happens.

Do the thumbs show up at all or do you just get empty links that take you to a non-existent directory? If it’s both thumb and image then I think I know what’s going on. Thanks for highlighting it.

Since you mention you’re using MLP, there is one potential issue; that plugin currently doesn’t work fully under sub-directory installations. Can you try it without MLP activated and see if slimbox delivers the thumbs/links properly?

Now, I have an alpha version of smd_slimbox with a kludge-fix in it so the URL gets processed correctly under MLP, but I haven’t released it officially. The reason: because it also uses an alpha version of smd_lib which changes/eases the way people can develop plugins with MLP.

On the surface that sounds like a Very Good Thing (and I think it is, if I may blow my own trumpet for a second) but it really should be something native to MLP and not my library. I’d like to release it, but the aim is that smd_lib becomes a generic library that allows developers to do some of the heavy lifting/category manipulation so they can make weird and wonderful plugins like rloaderro has done with his excellent slideshow.

smd_lib is a way off yet (and needs a lot of tidying up/optimisation); my worry is that if I release it with the MLP framework in it and people use it, when/if net-carver adopts it as part of MLP it’ll likely annoy people to have to change over. Plus it’s not really been tested by anyone other than me so I don’t know what sort of load it puts on MLP. I’d really like net-carver’s blessing first, since he’s far better at this coding lark than I am.

Other thing, where can I change the paragraph “image 1/10” showed under big pictures? Can I even translate it?

Unfortunately, that’s part of Christophe’s code in slimbox.js. Have a search thru that file.

I too would like to be able to MLP-ise that, but currently can’t figure a way of doing it without rolling all the js into the plugin itself instead of being separate files. Makes the plugin bloatier. If you or anyone have any ideas on how to do it, feel free to shout!


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

#126 2007-05-07 09:55:00

ultramega
Member
Registered: 2006-02-26
Posts: 221

Re: smd_slimbox

When limited thumbs are generated with previous / next links, these links direct to non-existing page, actually to the root of the site. The address itself is correct, because adding the installation subfolder into the url takes me to the right page with different thumbs. MLP could cause this, at least earlier it had issues with subfolders. It anyway translates captions for images right with you plugin, which is the most important. I anyway allready skipped the pagination for thumbs.

I found that image 1/10 thing, and removed the word “image”, which instantly made it to be more generic :)

Offline

#127 2007-05-12 16:44:24

Algaris
Member
From: England
Registered: 2006-01-27
Posts: 534

Re: smd_slimbox

I’m trying to use this plugin on a local testing server using MAMP (http://www.mamp.info/en/index.php) for PHP, Apache, mySQL, etc, with an address of http://localhost:8888/txp/. The exact path for my server is /Applications/MAMP/htdocs/txp/

I keep getting the error message: A problem occured while loading the plugin: smd_slimbox -> User_Error: Unable to include required plugin “smd_lib” on line 437

I’ve tried changing the path for the js and css folders and putting them into the textpattern folder to see if that makes a difference but to no avail.

I’m at a bit of a loss.

Offline

#128 2007-05-13 14:21:21

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

Re: smd_slimbox

Algaris wrote:

I’m trying to use this plugin on a local testing server using MAMP… I keep getting the error message… Unable to include required plugin “smd_lib”

That message is not the plugin operation directly, but indicates a failure of the pre-requisite for its operation. The obvious thing to check is that you installed and activated the smd_lib plugin.

Assuming you’ve done that, the only way I can see of that message appearing is if there’s a configuration issue with your textpattern installation and it cannot, for some reason, find smd_lib from the “require” statement in the code. It may be related to the MAMP configuration of course. Does it work for you on a “real” server environment?


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

#129 2007-05-13 14:30:54

jstubbs
Moderator
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: smd_slimbox

Hi Stef,

Quick question I wanted to ask you re the use of your excellent plugin for a photo gallery on one page. I have the gallery title first, then a description of the gallery, then call the category of images. Just wondering if there is a better way to do this, as for each gallery I have to place a new slimbox tag, like so:

<h2>Title here</h2>
<p>Description here</p>
<ul class=“smd_slimbox”>
<txp:smd_slimbox limit=“20” category=“Naples” showcaption=“1” textpos=“after” wraptag=“li” navclass=“smd_slimbox_nav” cellclass=“cell” />
</ul>
<h2>Title here</h2>
<p>Another description of this category of images.</p>
<ul class=“smd_slimbox”>
<txp:smd_slimbox limit=“20” category=“Facilities” showcaption=“1” textpos=“after” wraptag=“li” navclass=“smd_slimbox_nav” cellclass=“cell” />
</ul>
<h2>Bla bla title</h2>
<p>Description</p>
<ul class=“smd_slimbox”>
<txp:smd_slimbox limit=“20” category=“World” showcaption=“1” textpos=“after” wraptag=“li” navclass=“smd_slimbox_nav” cellclass=“cell” />
</ul>

Offline

#130 2007-05-13 15:32:40

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

Re: smd_slimbox

jstubbs wrote:

re the use of your excellent plugin for a photo gallery on one page.

Sorry, at the moment if you want to separate out the categories on the page, the only viable way is as you have done already :-( With the possible addition of groupname="?c" to constrain Slimbox’s Next/Prev images to the relevant group.

When I get round to finishing v0.3, you should be able to do what you want from one plugin call with something like this:

<txp:smd_slimbox limit=“20” category=“Naples, Facilities, World” groupname="?c" />

And then use the beefed up class/display option to tell it to add the title and description at each change in category. That’s the plan; whether I can deliver is another thing entirely! I’ve just been unfeasibly busy with the record label recently, and I’ve had to slack off the coding.

One thing I forgot to consider, which you just brought to my attention (thank you), is how to handle the limit.

Under smd_slimbox, the limit is still a hard limit per “page”. This is fine but if you have 3 categories to display — the first with 60 images, the second with 30 and the last with only 10 — then when you click the “Next” link under any of the categories, it will advance all the images to page 2 (i.e. show images 21-40 of cat1, 21-30 of cat2 and nothing from cat3). This may or may not be desirable depending on your setup. If you have any ideas how you think this should work, let me know and I’ll see if it’s possible. It might be (technically) out of reach as it stands.

As I’ve touched on before, the way I started the plugin is a little backwards insofar as it should support the form option which would take care of formatting either the whole image list or each category depending on what effect you’re after.

The ideal scenario would be to use a standard tag set to generate the list of images (e.g. image_index, if_different or something like wet_foreach_image) and then pass those to slimbox to do the formatting. That would then allow other people to more easily bolt on extras; the amazing rloaderro has gone through the pain of living with all my slapdash updates to smd_lib and made aro_slideshow, for example. I aim to make it easier for him and others in future. That may involve handing my code over to wet to see if he can enhance wet_for_each_image to add some of the powerful searches I do.

My vision is to use smd_lib (or other core functions / other plugins such as wet’s awesome stuff) to do the generation of images/category/class stuff and then slimbox becomes a utility for just handling the slimbox bit. It’s a way off yet and I’ll probably need help or a lot of hours wading through the TXP source to really get a handle on the time-saving helper functions that the dev team and other contributors have supplied.

Unfortunately for people who use my plugins, I’m still learning TXP and sometimes I simply do things that aren’t very efficient, or re-invent the wheel through lack of knowledge of the API. All I can do is apologise and hope to make it better next time :-)

Last edited by Bloke (2007-05-13 15:33: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

#131 2007-05-13 16:29:20

jstubbs
Moderator
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: smd_slimbox

Thanks for the update and clarification. I had been wondering about the limit, and how it affected the page. I guess for me the best way for it to work would be to set the limit per category, not per page, otherwise it could be easy to forget how many images are in the category, thus causing a 2nd page to be created which could be undesirable.

How would the new class/display option work?

Thanks for the help with your plugin.

Offline

#132 2007-05-13 17:05:59

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

Re: smd_slimbox

jstubbs wrote:

I guess for me the best way for it to work would be to set the limit per category, not per page,

Yeah, I agree. I’ll have to see if it’s possible to do.

How would the new class/display option work?

I’m partway there and the current thinking is this (although it sounds difficult at first glance, it’s unfeasibly powerful if I can make it work) :

1) Deprecate: showcaption, showalt, textpos in favour of display where you can specify what you want to display (caption, alt, author, id, date, filename, etc) and then where you want it (before, after, above, below). e.g. display="caption:before, author:below"

2) Deprecate all current class options and replace with one attribute class. This takes attributes akin to zem_nth on steroids.

Inside the class option you specify a list of objects to apply a class to, the name of the class you want to assign and the frequency at which you want that class to apply. It’s best explained with examples:

class=“group:myGrpClass”

Applies myGrpClass to the first img in a logically grouped set (e.g. ones displayed by category).

class=“group:myGrp1;myGrp2”

Alternately applies myGrp1 then myGrp2 every time the group changes.

class=“above:theCap, below:theStuff”

Applies theCap to the details box above each image and applies theStuff class to the box below.

class=“cell:myCell@pos=3”

If wraptag is on, applies myCell to the third image cell only.

class=“cell:myCell@pos=3;5;9-12;15;?article_image”

If wraptag is on, applies myCell to the third, fifth, ninth thru twelfth, and fifteenth image cells only. Also applies it to the image number that matches the article image of the current article.

class=“img:myClass@step=2;5:otherClass@step=3”

Applies myClass to every other image (in other words, evens; there will be two convenience options even and odd as well) and to every 5th image. Applies otherClass every 3rd image. See “clashing” below.

class=“img:myClass@when=author/CONTAINS/bloke”

Applies myClass to any image thumbnail if the author of that image contains the word ‘bloke’. Other options instead of CONTAINS are: EQUALS (for an exact match), LT (less than), GT (greater than), LTE (less than or equal to), GTE (guess what..) or NOT. ‘author’ could be the usual crew of id, caption, alt, filename, etc…

class=“img:myClass@when=author/EQUALS/?author”

Applies myClass to any image thumbnail if the author matches the author of the article.

On top of all that, there is one special option that doesn’t take any value at the end:

class=“img:myClass@when=category/CHANGES”

That will apply myClass to the 1st image every time there is a change in image category. It’s only really useful if orderby is used.

Clashing: When positions clash, an attribute (e.g. appendclasses) will control whether the classes are concatenated together or the most recent replaces the older one.

How’s that? :-) If you can think of a better/easier way of doing it, I’m all eyes.

Last edited by Bloke (2007-05-13 17:10:22)


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