Textpattern CMS support forum
#121 2007-04-29 12:28:08
<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)
#122 2007-04-29 12:58:55
- Registered: 2004-08-10
- Posts: 20
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.
#123 2007-04-29 13:24:26
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.
#124 2007-05-04 11:02:58
- Registered: 2006-02-26
- Posts: 221
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?
#125 2007-05-04 20:18:39
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!
#126 2007-05-07 09:55:00
- Registered: 2006-02-26
- Posts: 221
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 :)
#127 2007-05-12 16:44:24
- From: England
- Registered: 2006-01-27
- Posts: 421
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.
#128 2007-05-13 14:21:21
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?
#129 2007-05-13 14:30:54
- From: Hong Kong
- Registered: 2004-12-13
- Posts: 2,386
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:
<txp:smd_slimbox limit=“20” category=“Naples” showcaption=“1” textpos=“after” wraptag=“li” navclass=“smd_slimbox_nav” cellclass=“cell” />
<p>Another description of this category of images.</p>
<txp:smd_slimbox limit=“20” category=“Facilities” showcaption=“1” textpos=“after” wraptag=“li” navclass=“smd_slimbox_nav” cellclass=“cell” />
<h2>Bla bla title</h2>
<txp:smd_slimbox limit=“20” category=“World” showcaption=“1” textpos=“after” wraptag=“li” navclass=“smd_slimbox_nav” cellclass=“cell” />
#130 2007-05-13 15:32:40
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.
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)