Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

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

#109 2007-04-13 14:58:47

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 10,282
Website GitHub

Re: smd_slimbox

progre55 wrote:

…what would make it even greater… would be the capability to launch it from a single image or text. Not sure if there is any possibility in getting that into the next version.

Hey progre55, glad the plugin’s (mostly) useful. Did we talk about this a few pages back? My memory’s shot. Have a read through this post and, if I’ve misunderstood how you intend it to work, let me know (with some mock examples?) and I’ll see what I can do.

Since it was written as a “do-it-all” plugin I didn’t add in the ability to handle forms or take a list of thumbs from some other source. Shame really because the output of wet_for_each_image for example would be quite useful for the folk who don’t need all the stupid array of options that are available in smd_slimbox. mrdale’s also been strutting his stuff making a very cool mashup of various plugins. He does a lot of this, so he may have some insight into a workaround that’ll get you going in the meantime.

The original intention was to show a list of thumbs and allow someone to dive into any one of them and then navigate from there. If your intention is to show some (possibly unrelated) image/text link which will somehow launch a full-scale image gallery lightbox, starting at image 1 in the list I assume(?), then it’ll take some thinking.

Although this plugin is called smd_slimbox it’s really smd_generate_a_list_of_thumbs_and_show_them; the clever bit is done by Christophe’s slimbox code. Once the list of thumbs is on the page, Christophe’s slimbox just “knows” how to iterate through them because of the ‘rel’ attribute in the HTML. In order to do what you want I think I’d have to either:

  1. defer generating the list of thumbs untll the image/text link is clicked, somehow passing them to slimbox. This might require an smd_slimbox_prepare or some plugin option.
  2. generate the list of thumbs so they are ‘on the page’ but not show any of the actual thumbnail pics. So in effect, all the links are in the HTML code but are “hidden” from the viewing public. Then, using the technique detailed on Christophe’s page about calling the lightbox directly we could add an onclick to any element on the page which may (or may not; I haven’t tested it) “start” the lightbox gallery.

Both options are utter theory right now. The second also has an accessibility side-effect because the links are all still navigable by screen readers and from the ‘tab’ key; you just won’t be able to see/have info about what your cursor is selecting.

I really don’t know if either will work or can be hacked to work but I’m willing to try in the name of science. If anyone has any experience in doing this kind of thing or can either tell us to give up because it’s not possible/available in another plugin, or drop some hints as to an easier way of doing it, both me and, I’m sure, progre55 are all ears.


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

#110 2007-04-15 22:03:15

mbalson
New Member
Registered: 2007-04-12
Posts: 2

Re: smd_slimbox

Bloke wrote:
EDIT: D’oh! Having just looked at your web site, it appears groupname="?c" is exactly what you want. If each logical ‘group’ of images on your page is sourced from a different image category, put groupname="?c" in each slimbox tag and it’ll constrain the links to that group only.

Wicked. This makes it work exactly how I want. Thanks!

Offline

#111 2007-04-17 08:57:00

davit
New Member
Registered: 2007-03-07
Posts: 6

Re: smd_slimbox

hi, this is probably a most elementary query. I’ve installed the js and css folders in the textpattern folder with the following path C:\localhost\xampp\htdocs\folder\textpattern and I’m unsure how to reference this within the <head>/<head> region. Currently using the defaults I’m receiving an error msg suggesting that I need to reference the libraries in the head region. Could someone help.

Offline

#112 2007-04-17 09:36:33

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 10,282
Website GitHub

Re: smd_slimbox

davit wrote:

I’m receiving an error msg suggesting that I need to reference the libraries in the head region

Hi davit. In theory the defaults should be fine for smd_slimbox_inc (I’ve not tested it within a ‘local’ environment though). Make sure within the <head> tag in your page template/form is a call to:

<txp:smd_slimbox_inc jsdir="/js" cssdir="/css" />

Then try loading the page again.

If it still doesn’t work, have a look at the web page source code; you should see lines like this somewhere near the top:

<script type="text/javascript" src="/js/mootools.js"></script>
<script type="text/javascript" src="/js/slimbox.js"></script>
<link rel="stylesheet" href="/css/slimbox.css" type="text/css" media="screen" />

Check those lines are pointing to the directories you expect them to be and/or tweak the smd_slimbox_inc attributes to suit your setup. If it still doesn’t work, post those three lines from your page source here and we’ll see if we can work out what’s going wrong.

Last edited by Bloke (2007-04-17 09:39:51)


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

#113 2007-04-17 12:46:16

davit
New Member
Registered: 2007-03-07
Posts: 6

Re: smd_slimbox

Hi Bloke,

I’ve checked the <head> tag and it contains <txp:smd_slimbox_inc jsdir=”/js” cssdir=”/css” />. When I look at the source there is no reference to the <script> tags. I’ve deleted the plug-ins, smd_lib_v0.21b and smd_slimbox_v0.24 and reloaded and activated them again no joy. The error when I load the page is ‘Required libraries not loaded. Call <txp:smd_slimbox_inc /> in the <head> of the page’. I assume that I’ve made an elementary mistake but I cannot see what.

Offline

#114 2007-04-17 13:58:09

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 10,282
Website GitHub

Re: smd_slimbox

davit wrote:

I assume that I’ve made an elementary mistake but I cannot see what.

Well if you have, I can’t see what it is!

I’ve checked the <head> tag and it contains <txp:smd_slimbox_inc jsdir=”/js” cssdir=”/css” />.

Which is perfectly correct.

When I look at the source there is no reference to the <script> tags.

Which is just plain odd. Even if I specify jsdir="wibblepig" cssdir="ipsoflapso" on my server (using the same plugin versions as you) it gives me the script tags, albeit with the wrong directories used. *headscratch *

You can get rid of the error message by adding the libcheck="0" attribute to the slimbox tag, but that’s not going to help if your <script>/<link> tags aren’t being generated. Hate to ask, but does the page validate otherwise?

You could try it without the forward slashes at the start, or try the alternative format:

<txp:smd_slimbox_inc scripts="/js/mootools.js, /js/slimbox.js, /css/slimbox.css" />

Can’t see it making any difference, but at this point I’m open to try anything.

As a final port of call you can bypass the smd_slimbox_inc entirely. Add libcheck="0" to the slimbox tag, remove the smd_slimbox_inc tag and then just add the three HTML tags given in my last post directly into the <head> of your page template.

It’s not a “solution” to the problem, but should hopefully get the plugin working while I try and figure out why it’s going mad on your machine. I wonder if it’s to do with it being a ‘local’ installation or being a windows environment or something? Perhaps it requires backslashes instead of forward slashes if on a windows machine?

Clutching at straws here…

Last edited by Bloke (2007-04-17 14:02:52)


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

#115 2007-04-20 11:29:43

davit
New Member
Registered: 2007-03-07
Posts: 6

Re: smd_slimbox

Hi Bloke, I’ve made some progress. The source is now correctly displaying the javascripts and I’m now displaying thumb nails on the page. If I hover over them I can see the caption, however when I double-click on them to launch the gallery a new page is loaded with the following url http://test.txp/images/2.jpg and the images are displayed in full size.

Just to recap I’ve loaded/activated the two plug-ins and dropped the two folders, css and js into C:\localhost\xampp\htdocs\folder\textpattern and I’m using the default tag <txp:smd_slimbox_inc jsdir=”/js” cssdir=”/css” /> in the <head> tag.

Have you any ideas how I can get the gallery to launch?

Offline

#116 2007-04-20 11:31:49

davit
New Member
Registered: 2007-03-07
Posts: 6

Re: smd_slimbox

Hi Bloke, further to the last mail the error message that is being displayed is:

Required libraries not loaded. Call <txp:smd_slimbox_inc /> in the <head> of this page.

Offline

#117 2007-04-20 15:07:25

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

Re: smd_slimbox

Bloke:

Sorry for the delay in getting back to you and you are correct, we did briefly touch base on this topic in the past.

I think for this client I may have an easier work around, hopefully you can assist. Although I do think the ability to launch from a single image (button) would be awsome, I definitely understand the complexity and why the plug in was designed in the fashion it was.

For this client, I can work around the issue, by just showing a limited number of thumbnails on the main page. The problem is this:

I know I can limit the images in your plug in. That is not what I want to do.
What I am looking to do is have 5 thumbnails (or a set number) in a horizontal row that has forward and back buttons. This way the user sees a limited number on the page, but can cycle through all the thumbnails if they desire. Then by clicking on a thumbnail it would launch slim_box. From here, they would also be able to see all images.

I have to believe this would be an easier solution. I know with CSS I can hide thumkbnails, but I do not know what the best method would be to create an image scroll bar to work in conjunction with your plug in.

Thanks again. Look forward to your thoughts.

progre55

Last edited by progre55 (2007-04-20 15:09:53)

Offline

#118 2007-04-22 19:36:34

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 10,282
Website GitHub

Re: smd_slimbox

davit wrote:

The source is now correctly displaying the javascripts… when I double-click… to launch the gallery a new page is loaded… and the images are displayed in full size.

Glad to hear you’ve made a little progress. The circumstance under which it shows the image in its own page is when it cannot find the javascript and/or CSS files.

Now that you can see the <script> tags in your code, check they are referring to the javascript files properly by copying out the URLs and pasting them into the browser address bar. Chances are you’ll get a 404 error, in which case it can’t (for some reason) find the scripts. I still wonder if it’s to do with the xampp environment. Maybe it’s not checking the right directories for included files?

In any case, to get rid of the “Required libraries not loaded” message I suggest just adding libcheck="0" in the smd_slimbox tag. I have no idea why the error’s showing in your case, since the smd_slimbox_inc tag is in your template so it should just work; it does in all other installations I’ve encountered. If I get a chance I’ll try installing xampp and see if I can replicate the problem.

Baffling.


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

#119 2007-04-22 20:40:11

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 10,282
Website GitHub

Re: smd_slimbox

progre55 wrote:

have 5 thumbnails (or a set number) in a horizontal row that has forward and back buttons… Then by clicking on a thumbnail it would launch slim_box. From here, they would also be able to see all images.

Right, I see what you mean. Trouble is I don’t know how to achieve it without resorting to trickery. Let me sleep on it.

I know with CSS I can hide thumkbnails, but I do not know what the best method would be to create an image scroll bar to work in conjunction with your plug in.

With the new version I’m planning, the hiding part would be fairly easy. I am building a system whereby you can tag thumbs with a vast array of different classes based on rules. So as long as I’m careful with how I set it up I should be able to let you specify that X number of thumbs are assigned one class and the remainder get another. To that second class you simply assign display:none in CSS.

An image scrollbar is trickier. I first of all dabbled with doing a google style paging system < 1 2 3 4 5 > but then found the 4.0.4-hacked version of ob1_googlenav did pretty much what I wanted. Except I couldn’t get it to work with my plugin and recognise the pages. I think I know how to do it but it would either require a hack of ob1’s code, or a copy of most of his functionality into my plugin (which I don’t really want to have to do).

A scrollbar might be possible to emulate with a mootools scroller. If you’re handy with javascript you could try it. If it’s an easy mod I might look into packaging it up into the plugin as an option, since it just requires one additional mootools module to be included.

Last edited by Bloke (2007-04-22 20:40: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

#120 2007-04-28 20:55:32

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

Re: smd_slimbox

my apologies if i missed something but it seems the variable scope is a bit off with regard to custom fields and url-title as the category. these options work on individual post pages but do not work within article lists. textpattern can see and output these variables from article lists but smd_slimbox cannot. any ideas for fixing this other than a complicated tags in tags solution?

treb0r wrote
I can only get the plug-in to work by specifying either category or image IDs directly in the tag. If I try to use any of the options that should allow me to pull categories and IDs from a given article (Custom Fields, Article Image, Title, etc), it doesn’t work.

bloke wrote
Two things to check:

  1. Are you using the tag in an individual article page? The Custom Field / Article Image / Title etc won’t work on an article-list page because there’s no actual article to read from.
  2. Check 1 again :-)

It seems there is a simple solution to this, Sencer’s asy_wondertag plugin.

Just install that plugin and use something like this where you want a custom field or url title:

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

This usage allows for more efficient deployment in article forms and saves having to write code in every gallery posting.

Much nicer than futzing around with inline php. Sencer definitely makes some explicit warnings about usage so be sure to read the documentation over before implementing it. Saved me piles of frustration though.

Hopefully it withstands testing.

Last edited by instantok (2007-04-29 01:02:00)

Offline

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

Board footer

Powered by FluxBB