Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

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

#289 2007-10-03 00:48:39

robin746
Member
From: Ireland
Registered: 2007-09-22
Posts: 113
Website

Re: smd_slimbox

Oh, I found a bug in the plugin code. If you give dimensions to the image through thumbsize, it tacks on the units “px” after the numbers in the HTML img tag. This is incorrect formatting. I have hacked my copy to fix this.

I also added a plain title attribute, so that single images can be given a nice mouse-over text. This supercedes the use of caption, though I imagine the use cases for each are quite different.

You may consider these items in your next update.


robin

Offline

#290 2007-10-03 03:17:41

Thom1965
New Member
Registered: 2007-10-03
Posts: 3
Website

Re: smd_slimbox

What service! Thanks a bunch!!

Offline

#291 2007-10-03 07:52:19

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

Re: smd_slimbox

robin746 wrote:

I had one problem with some elements of my page not being dimmed. Comment XL from the discussion on the original Slimbox page worked for me.

Nice find. Worth knowing.

I found a bug in the plugin code. If you give dimensions to the image through thumbsize, it tacks on the units “px” after the numbers in the HTML img tag. This is incorrect formatting.

Well I never. I’ve spent so long working with CSS I just assumed that px had to be specified in the img tag the same way it does for width and height values in stylesheets. Live and learn! Thanks for the tip, I’ll fix that in the next update.

I also added a plain title attribute, so that single images can be given a nice mouse-over text.

OK, I can see how that would be useful in some cases. The captions can be a little over-the-top and to have the choice of using either the caption, the alt or an overriding value for all thumbs might be handy. Can you mail me the code please? Just copy n paste the relevant bits in if you like. I’ll see what you did and take it from there, ta.

I might add a thumbtitle option which allows you to use the caption / alt from the database, the same text you specified for imagecaption, or some other text of your choosing; in the same way that imagecaption works. I’ll see how it goes and if it makes sense to do all that, based on where I’m going for v3. I think most browsers render the title attribute of the anchor as a mouseover, so if the thumb title ends up being the same as the full size image there’s no point rendering it to the page since it adds to the byte count. In fact, I’m not even sure which title would get displayed if they both existed, I’ll have to check.

Your version might well be the best solution all round. Many thanks for helping out.


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

#292 2007-10-15 08:12:58

Mr. Smith
Member
From: Denmark
Registered: 2006-11-10
Posts: 56

Re: smd_slimbox

Bloke wrote:

Hmm, think that’s a first: no wonder the searches came up blank. I’m really not sure on that one.

As far as I can assure, smd_slimbox does not have any hard-coded paths so it should read all values from the stuff in your admin screens. Under the hood, it makes up the path to the images using two internal variables; one called “hu” (a constant which seems to be the one containing the domain; I just used it because zem (or maybe wet/ruud, I don’t remember) had used it and I figured it was therefore the right thing to do) and a conventional global variable called $img_dir which is normally associated with the “images” directory on your server.

Finally I found the time to work on the site again, and I’ve managed to solve the puzzle. It really wasn’t that hard, it was more or less due to my limited knowledge about Textpattern. After uploading the site to a remote server I just had to go to Admin -> Preferences -> Site URL. On my computer at home the Site URL says “localhost”, and after uploading and removing this it works just fine!

:-)

Last edited by Mr. Smith (2007-10-15 08:14:15)


Textpattern n00b

Offline

#293 2007-10-15 21:28:05

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

Re: smd_slimbox

2_brain wrote:

“Badly formed or empty plugin code.” installing smd_slimbox 0.29a.

I wonder if it’s the same problem lee had?

Try a version of the plugin without docs and see if that helps. I’d love to find out why it does this on some systems: beats me. I think starting from the next major revision I’ll strip the docs right down in the plugin itself, distribute full docs in the zip package and post them online as well.

Let me know if this version fixes 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

#294 2007-10-25 12:12:52

doyley3
New Member
Registered: 2007-10-25
Posts: 1

Re: smd_slimbox

Hi, I’m completely new to webstuff and I’m trying to build my website. I’ve installed slimbox and I wondered if anyone could help me with it. I have 8 thumbnails of different products on a page. I need to be able to open up thumbnail 1 (a postcard) in lightbox to enlarge the image and then be able to click next to see the back of the postcard (which is not a thumbnail on the original page). Can I do this?

Offline

#295 2007-10-26 12:08:48

fuls
Member
Registered: 2005-11-16
Posts: 117
Website

Re: smd_slimbox

Is there a way to put the category label name for non-article related images?

Thank you.

Offline

#296 2007-10-26 19:14:14

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

Re: smd_slimbox

doyley3 wrote:

I have 8 thumbnails of different products on a page. I need to be able to open up thumbnail 1 (a postcard) in lightbox to enlarge the image and then be able to click next to see the back of the postcard (which is not a thumbnail on the original page). Can I do this?

A very good request and one that I can’t think of a neat way (at present) of achieving. It can be done, as you will see in a moment, but will require a bit of messing about.

The much-touted v3 should be able to do this (in a roundabout way, via the new class/CSS rules I’m hoping to be able to build) but for now you can cheat and use a technique similar to the one I outlined for Joey/progre55. The idea’s similar but in your case you’ll need 2 slimbox tags on the page, one of which will pull out all the fronts and the other the backs of the postcards. If you surround the tag for the backs with a div that has its CSS set to display:none then all the backs will be hidden.

Then you have to make the next/prev link work when the ‘front’ thumb is clicked. For this, each pair must have an identical groupname so they become a logical “set”. The simplest way is probably to use the caption or alt text of each image to make up groups. For example you could organise your images in sub-categories as shown here; the name of the group is shown in square brackets and is the text you put in either the alt or the caption (you choose whichever suits you) :

postcards
  -> fronts
     -> c1front.jpg [card1]
     -> c2front.jpg [card2]
     -> c3front.jpg [card3]
  -> backs
     -> c1back.jpg [card1]
     -> c2back.jpg [card2]
...

You then use tage such as these:

<txp:smd_slimbox category="fronts" groupname="?alt" />
<div class="noshow"><txp:smd_slimbox category="backs" groupname="?alt" /></div>

Or use groupname="?caption" if you prefer. Neither is very pretty, but it’ll work.

Alternatively, if textpattern allows it (I think it will), you could even name the filename of your front and back images the same for each pair, thus:

postcards
  -> fronts
     -> c1.jpg
     -> c2.jpg
     -> c3.jpg
  -> backs
     -> c1.jpg
     -> c2.jpg
...

That might become a tad confusing in the image screen, but if don’t mind a bit of duplicate naming then this is even easier. You simply tell both slimbox tags to use groupname="?name". That way you save yourself the hassle of using alt/caption and can use those fields for their intended purpose.

Sorry it’s a bit of a kludge but it’s a complex case given the way that slimbox is designed to work. I’ll take this use case into account though, and may be able to help with v3 when it takes shape. Hope that gets you going for now. If you need any more assistance setting it up, just let me know.

Last edited by Bloke (2007-10-26 19:17:38)


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

#297 2007-10-26 19:15:58

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

Re: smd_slimbox

fuls wrote:

Is there a way to put the category label name for non-article related images?

Sorry fuls, I’m not quite sure what you mean. Do you have an example web page you could show me, or describe to me, so I can offer some help?


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

#298 2007-10-26 19:37:46

fuls
Member
Registered: 2005-11-16
Posts: 117
Website

Re: smd_slimbox

Sorry Bloke, I’ll try to explain better.

I have an image category list in the side bar and in the main content I have thumbnails from the recently added image gallery.
I’d like to put the name (name of the category) of that gallery above the thumbnails.

When I click on sidebar category links, another gallery opens in the main content with category related name on top.

My galleries are not related to articles, so I was wondering is it possible to pull category name out.

I hope you understand what I want to do:)

Thanks again.

Offline

#299 2007-10-29 11:36:37

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

Re: smd_slimbox

fuls wrote:

I’d like to put the name (name of the category) of that gallery above the thumbnails.

Ah, ok, I see what you want to do.

And it’s not good news right now: I don’t think it’s possible, sorry :-( The current version can only add information to each thumbnail, not to the group as a whole. I’m working on adding the ability to ‘label’ arbitrary parts of the output so that you and progre55 (and me!) can benefit.

I have another plugin to release (hopefully this week) that I’m writing for another site I’m building, but after that I’ll return to slimbox and try to address all the recent enhancement requests.

Last edited by Bloke (2007-10-29 11:37:04)


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

#300 2007-10-29 20:29:32

fuls
Member
Registered: 2005-11-16
Posts: 117
Website

Re: smd_slimbox

thanks anyway:)

I’ve solved the problem by adding:

<txp:category type=“image” title=“1” />

above the smd_slibox tag.

Offline

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

Board footer

Powered by FluxBB