Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

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

#373 2008-01-23 21:06:13

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: smd_slimbox

I think i told about this earlier, but… Sometimes slimbox breaks down and works like this: opens new page with requested image, and produces 404 on the parent page, were link was clicked. I really didn’t find any dependences in this, but sometimes i face with such issue


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

#374 2008-01-23 21:09:59

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

Re: smd_slimbox

marios wrote:

I’ve got some extra text in the caption field. That is supposed to show only on the slim_box popup, not underneath.

When you say “not underneath”, do you mean not in the bit of the lightbox that rolls down and says “Image 1 of N”? i.e. do you want the span to “float” over the lightboxed image? (btw I can’t find a way of making the plugin do that!)

However, I can almost generate the code you mention with this cheating tag:

<txp:smd_slimbox category="whatever" wraptag="div" cellclass="smd" thumbtextwrap=""
thumbtext="after: &lt;span class='getridofme'&gt;Some extra text&lt;/span&gt;" />

but the span does not get displayed with the lightboxed image; Christophe’s slimbox script just grabs the <img...> part.

If you wish to display the alt text as the lightbox caption, here is how I would do it:

<txp:smd_slimbox category="whatever" imagecaption="This is the contents of alt: ?alt" wraptag="div" cellclass="smd" />

That will give you HTML like this for each image:

<div class="smd">
<a href="blahblah" rel="lightbox-smd"
title="This is the contents of alt: Press Conference. Well, you can read it in the Washington Times tomorrow">
<img src="blah.jpg" alt="Press Conference. Well, you can read it in the Washington Times tomorrow" />
</a>
</div>

What I want, is: A class, on the anchor, so I can apply styles independently from other instances

Sorry I’m not quite sure what you mean. Remember that every matching image in the slimbox tag will be assigned the same class; and a “shortcut” to achieve the same effect is to wrap the entire slimbox tag in a div and give that a class. This does not add to page bloat and you can still access multi-selectors in a cross-browser manner. AFAIK, the only thing you cannot do is use “child” selectors in IE6 (.smd > a). But from this tag:

<div class="smd"><txp:smd_slimbox category="whatever" /></div>

this CSS applies padding to every anchor in the tag:

.smd a {
  padding:1em;
}

If you have multiple slimbox tags in one article you can assign each one a different class/ID and still style the contained anchors independently using the above syntax.

[and] A class on the span, that appears beneath the thumbnail anchor, so I can put the display to none.

Again, using the div as a wrapper like above, you can use CSS like this to get at your span, and it should work cross-browser:

.smd a span {
  display:none;
}

If I’ve misunderstood (again!) do you have a link you could send me so I can take a look and figure out what you are trying to do?


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

Online

#375 2008-01-23 21:15:13

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

Re: smd_slimbox

the_ghost wrote:

Sometimes slimbox breaks down and works like this: opens new page with requested image, and produces 404 on the parent page, were link was clicked. I really didn’t find any dependences in this, but sometimes i face with such issue

I’ve never seen this but, of course, that does not mean it can’t happen! When you say “sometimes”, is it repeatable on a page (i.e. does the same image always produce that bad behaviour?) or is it seemingly random, i.e. you can click lots of times fine on thumbnails, display images in the lightbox, click next/prev, do lots of things and then suddenly it will pop up an image in a new window and give a 404 in the main window? Do you know if it does it on all browsers or just one?

Do you have a link you could send me that exhibits this behaviour? I would like to see it break so I can figure out why. Thanks.


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

Online

#376 2008-01-23 21:24:10

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: smd_slimbox

Some notices – I use Opera 9.2+ and this happens on every “slimboxed” image at page. It doesn’t launchs slimbox effects at all – it produces error on the first click. Next time i will see it I’ll pose here!

hew! I found – http://www.digitalia.be/software/slimbox – Opera makes error, Firefox closes, IE7 works :)
When i click at bill gates i get this. url in new page and this image openes at the parent page

Last edited by the_ghost (2008-01-23 21:32:07)


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

#377 2008-01-23 21:24:16

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

Re: smd_slimbox

Hi Stef. Wondering how the testing of your alpha version is going? Using thickbox. What are your current plans for that?

Offline

#378 2008-01-23 21:33:22

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

Re: smd_slimbox

@the_ghost: Thanks, I’ve got Opera 9.25 here. I must admit I don’t often test in that browser, but I’ll take a look at some slimbox output and see if I can replicate what you see.

@jstubbs: I restarted work on the next iteration of slimbox at the weekend and hit the jackpot I think. I don’t foresee any more hurdles (ha! famous last words) so when I’ve checked all the options do what they say on the tin, I’ll tidy up the code a bit and let it out as a “testing” release at first, like I did with smd_fuzzy_find.

Be forewarned that it’s a huge departure from slimbox and, in fact, is no longer called smd_slimbox :-)

Watch the plugin development forum!


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

Online

#379 2008-01-23 21:55:54

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

Re: smd_slimbox

the_ghost wrote:

http://www.digitalia.be/software/slimbox – Opera makes error, Firefox closes, IE7 works :) When i click at bill gates

Woah, freaky! Looks like somehow it’s messing something up and concatenating the URL and the title into one long string, then trying to reference that as an image. On my machine here it works fine in Firefox 2.0.0.11 , Opera 9.25 and IE6 :-\

Assuming the HTML of that image on the page looks ok to you (does the link and image HTML look “normal”?), I wonder if it’s something to do with the character set you are using? Perhaps there are some “strange” quoting rules that your browser language employs which intercepts/confuses the mootools calls that search for rel=“lightbox-” on the page?

As it looks like it’s more to do with Christophe’s slimbox.js than my thumbnail generation, could I ask you to show him those two links (or point him to your question in this thread) so he can see what you see, and ask if he has any ideas why it could be happening on your browser?

Thanks.


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

Online

#380 2008-01-23 22:47:13

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: smd_slimbox

I’m really confused :) If this is my browsers error, it’s really strange :)
But i like Thickbox more :) One of reasons – it uses jQuery wich is loaded on my site :)


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

#381 2008-01-23 22:53:36

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

Re: smd_slimbox

the_ghost wrote:

I’m really confused :) If this is my browsers error, it’s really strange :)

Yes it is odd. I cannot replicate it on my browsers at all. I wonder if anyone else has ever seen this? Anyone?!

But i like Thickbox more :) One of reasons – it uses jQuery wich is loaded on my site :)

Yeah. Although Thickbox isn’t quite as “polished” to look at (well, last time I looked at least) but it’s got some very cool features. And as you say, it’s jQuery which means no/very few extra libraries since jQuery is now distributed with TXP. That’s my primary motivation behind the next plugin that will replace slimbox. And maybe others ;-)


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

Online

#382 2008-01-23 23:00:14

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: smd_slimbox

I’m waiting an invitation to youк smd_thickbox plugin development thread :)
P.S. Another cool feature of thickbox is div’s pop-ups


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

#383 2008-01-24 02:44:51

marios
Archived Plugin Author
Registered: 2005-03-12
Posts: 1,253

Re: smd_slimbox

Bloke wrote:

marios wrote:

I’ve got some extra text in the caption field. That is supposed to show only on the slim_box popup, not underneath.

When you say “not underneath”, do you mean not in the bit of the lightbox that rolls down and says “Image 1 of N”? i.e. do you want the span to “float” over the lightboxed image? (btw I can’t find a way of making the plugin do that!)

However, I can almost generate the code you mention with this cheating tag:

<txp:smd_slimbox category="whatever" wraptag="div" cellclass="smd" thumbtextwrap=""
thumbtext="after: &lt;span class='getridofme'&gt;Some extra text&lt;/span&gt;" />

@bloke, got it:

I was just using this wrong, so listen, this is what I must do:

<txp:smd_slimbox imageid=“40” limit=“1” showalt=“0” />

(To get rid of the span tag)

Now, regarding the anchor tags, I’ve hacked it in yours, (Quick ugly fix)
On line 37 I added the class variable as arr-member:

	$aclass = isset($aclass) ? $aclass:"smd";

and replaced line 480 with this:

$outStr .= '<a class=".'$aclass'." href="'.$full.'" rel="lightbox-' .$grp. '" title="' .implode(" ", $captionArray). '">' .(($textpos == "before") ? $capStr : ''). '<img src="' .$theThumb. '" alt="' .$row['alt']. '"' . (($imgclass != "") ? ' class="' .$imgclass. '"' : '') . (($thumbWidth) ? ' width="' . $thumbWidth.$thumbWUnits. '"' : '') . (($thumbHeight) ? ' height="' . $thumbHeight.$thumbHUnits. '"' : '') . ' />' .(($textpos == "after") ? $capStr : ''). '</a>'.n;

Now, with my class rule by default I get a float, and if I don’t want a float, I change the class attribute in the slimbox tag.

Works now, but if you just want to add this option in ?

regards, marios


⌃ ⇧ < ⌃ ⇧ >

Offline

#384 2008-01-24 09:23:06

Joey
Member
From: Netherlands
Registered: 2005-01-19
Posts: 257

Re: smd_slimbox

Bloke wrote:

Yeah. Although Thickbox isn’t quite as “polished” to look at (well, last time I looked at least) but it’s got some very cool features.

The main difference between slimbox and thickbox is that thickbox doesn’t have the ‘fade-in’ animation:

Due to the ThickBox creator’s view that transitions should be tailored by individual authors, ThickBox windows do not implement fancy transitions. Feel free to add them as you see fit. Is this a feature? Well, some might say it is.

And of course it hasn’t the nice next and previous buttons as slimbox (only small textlinks under the title, but I think you can change this pretty easily with css).

But I would love to see a plugin for thickbox, because — as you said yourself- – jquery is now in textpattern, and I also use jquery for my other javascript things on websites :)

Last edited by Joey (2008-01-24 09:24:05)


Regards,

Joey

Offline

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

Board footer

Powered by FluxBB