Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#25 2008-03-23 19:10:16

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

Re: smd_gallery: super-flexible gallery generator

Hi,
Great plugin!
I’m having a problem with the launch from one image.

This is my plugin tag:

<txp:smd_gallery category=“animals”
sublevel=“all” form=“gallery” thumblimit=“1” />

Form:

<a rel=“shadowbox[{category}]” href=”{url}” alt=”{alt}” title=”{category_title}: {title}” height=”{height}” width=”{width}”>
{object}
</a>

Form outputs the following code (there are currently 2 photos in this category):

<a rel=“shadowbox[Animals]” href=“http://my-site.com/images/12.jpg” alt=“Image” title=“Animals:Image” height=“595” width=“800”>
<img src=“http://my-site.com/images/12t.jpg” alt=“Image” />
</a>

<a rel=“shadowbox[Animals]” href=“http://my-site.com/images/11.jpg” alt=“Image” title=“Animals: Image” height=“587” width=“800”>
</a>

As you can see the second link is empty and it is causing me some problems. I see all the css styling for the link (background color, border), and of course no image.
What can I do to remove that?
I’m also getting validation output errors:

there is no attribute “alt”.
there is no attribute “height”.
there is no attribute “width”.

Thank you very much for your help!

Offline

#26 2008-03-23 19:46:01

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

Re: smd_gallery: super-flexible gallery generator

fuls wrote:

I’m having a problem with the launch from one image.

Ha! That would be my fault. The example is wrong (stupid copy ‘n’ paste error that I messed up). The validator is right: take out the alt=, height= and width= from the <a> tag.

You may also find that fixes the CSS, although it is a side-effect of the way the {object} tag works. What it does is “hides” the other images by not putting anything inside the anchor. I suggest what you do is wrap the smd_gallery call with a div (or use wraptag / class attributes) then change your CSS so it targets the img inside the anchor. That way, you’ll only be applying the CSS rule if the img is present.

So something like:

<div class="thumbs">
 <txp:smd_gallery blah blah />
</div>
.thumbs img {
  width:100px;
  background:#555;
...
}

Sorry about the bogus example in the help. I’ll fix that as soon as I can.


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

#27 2008-03-23 22:05:38

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

Re: smd_gallery: super-flexible gallery generator

Great, it works now! Thanks.

Offline

#28 2008-03-23 22:40:10

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

Re: smd_gallery: super-flexible gallery generator

I liked this plugin too :)
P.S. Should you add link to 0.33 to the head of topic?


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

#29 2008-03-24 15:13:18

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

Re: smd_gallery: super-flexible gallery generator

@fuls: excellent. Sorry about the poor documentation.

@the_ghost. Oops, thanks for pointing that out. Updated now. I’d forgotten to update textpattern.org too.


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

#30 2008-03-25 12:59:29

nardo
Member
From: tuvalahiti
Registered: 2004-04-22
Posts: 743

Re: smd_gallery: super-flexible gallery generator

how do you output the thumbnail’s width and height (into the img tag) when thumbnails can be different sizes?

e.g. you wanted to approximate something like this – where your landscape and portrait thumbs sat centered in a slide frame

Offline

#31 2008-03-25 18:59:27

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

Re: smd_gallery: super-flexible gallery generator

1. can attr class="empty" be added to li items which don’t have a link? It’s like ob1_pagination works :)
2. Is there variable, like {totalimages}, which shows not the amount of displaying images per current page but counts all images, that should be displayed if limit attr is omitted?

Last edited by the_ghost (2008-03-25 19:03:34)


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

#32 2008-03-28 18:27:09

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

Re: smd_gallery: super-flexible gallery generator

nardo wrote:

how do you output the thumbnail’s width and height (into the img tag) when thumbnails can be different sizes?

Currently you can’t :-( And that layout looks very good too!

Since TXP doesn’t store thumbnail dimensions you can only rely on the sizes they are stored in the file system when you upload them. I think you can modify the thumbnail sizes yourself from the images tab on a file-by-file basis (or use the glx_admin_image plugin). Alternatively lam_dynamic_image may help you in this case.

I did consider a hack that reads the current thumbnail sizes and determines the orientation, then applies max width/height restrictions via thumbsize so you could perform such a layout BUT it incurs significant time penalties since each image’s meta data has to be read in turn.


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

#33 2008-03-28 18:39:41

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

Re: smd_gallery: super-flexible gallery generator

the_ghost wrote:

can attr class="empty" be added to li items which don’t have a link? It’s like ob1_pagination works :)

Yes it’s possible. I should probably do it, thanks for the advice.

2. Is there variable, like {totalimages}, which shows not the amount of displaying images per current page but counts all images, that should be displayed

Not yet, but I will add this for you.


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

#34 2008-03-28 18:56:18

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

Re: smd_gallery: super-flexible gallery generator

Thanks Stef! Personal customized plugin will :)


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

#35 2008-04-01 16:01:23

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

Re: smd_gallery: super-flexible gallery generator

New version 0.34 (compressed) that fixes a small SQL parenthesis bug and adds the emptyclass attribute and the {maximages} replacement tag.

emptyclass defaults to “empty”, and {maximages} can be used in both thumbnail and paging forms. The help has been updated to make it slightly clearer what each image count tag does, as the names are a little confusing at times!

Thanks to the_ghost for the ideas.


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

#36 2008-04-04 18:43:31

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

Re: smd_gallery: super-flexible gallery generator

Bloke:

I may take the plunge with your new version. How easy is it to duplicate this functionality: jquery image gallery

progre55

Offline

Board footer

Powered by FluxBB