Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
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
Re: smd_gallery: super-flexible gallery generator
nardo wrote:
how do you output the thumbnail’s width and height (into the
imgtag) 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.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
Re: smd_gallery: super-flexible gallery generator
the_ghost wrote:
can attr
class="empty"be added toliitems 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.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
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
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.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#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
Re: smd_gallery: super-flexible gallery generator
progre55 wrote:
How easy is it to duplicate this functionality: jquery image gallery
Piece of cake :-) Include the javascript and css he specifies in your page head then use:
<ul id="demoOne">
<txp:smd_gallery category="blah1, blah2">
<li><img src="{url}" /></li>
</txp:smd_gallery>
</ul>
I’m considering expanding the tag set so you can bring the ‘id’ into the plugin as well (helps with multiple galleries per page) but that’s going to require some more thought. For now, the code there will get you going.
EDIT: schoolboy error in the code. Fixed now.
Last edited by Bloke (2008-04-04 18:57:40)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
Re: smd_gallery: super-flexible gallery generator
Hi Stef, just noticed that the smd_gallery I have here does not seem to render in IE6 and IE7 – any idea why? Fine in FF and Safari etc. Its using fancy zoom, but I don’t see a JS problem here…
Offline
Re: smd_gallery: super-flexible gallery generator
jstubbs wrote:
does not seem to render in IE6 and IE7 – any idea why?
Could it be the missing closing > on the anchor tag? Is that caused by one of my replacement tags or your form?
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
Re: smd_gallery: super-flexible gallery generator
Beats me! Tags like this are being produced:
<a href="http://domain.com/images/25.jpg" title="Bla bla" <img src="http://domain.com/images/25t.jpg" alt="bla" /></a>
On second look, the alt portion might be giving me the problem, with the self-closing tag: alt=“bla” />
I use a form to produce the gallery.
Offline
Re: smd_gallery: super-flexible gallery generator
This is the form:
<a href="{url}" title="{title}" <img src="{thumburl}" alt="{alt}" /></a>
Offline
Re: smd_gallery: super-flexible gallery generator
Then I’d wager it’s the missing > after the title :-)
<a href="{url}" title="{title}"><img src="{thumburl}" alt="{alt}" /></a>
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
Re: smd_gallery: super-flexible gallery generator
Yeah, that was it! Thanks, Stef. Life is back to normal now :-)
Offline
Re: smd_gallery: super-flexible gallery generator
Hi Stef,
Is it possible to do this:
- Show only 5 latest thumbnails from each category (Category title and below 5 thumbs)
- On click (using lightbox) show all images from clicked category (not just 5:)
Or even better, show only one thumb per category together with category title and then on click show complete gallery from that category.
Thanks!
Offline
Re: smd_gallery: super-flexible gallery generator
fuls wrote:
- Show only 5 latest thumbnails from each category (Category title and below 5 thumbs)
- On click (using lightbox) show all images from clicked category (not just 5:)
- Or even better, show only one thumb per category together with category title and then on click show complete gallery from that category.
You can now :-)
It was something I planned to do and never got round to it; you gave me a good reason to add it, so check out v0.4 [ compressed ]
Please note that the thumb attribute has changed slightly in this release. The help explains more but in a nutshell you can now use thumb to choose which size image you want to render for both the thumbnails and the fullsize pics. It works the same way as smd_slimbox.
The major additions in this release are:
thumbchange: allows you to ‘watch’ particular thumbnail attributes and display information only when they changethumbchangewraptag/thumbchangeclass: to wrap a tag and class around such information- New replacement tags
{thumbindex}and{thumbcounter}if you need them. The counters are reset each time one of your “watched” attributes changes - New replacement tags in the format
{changed:some_attribute}that are only available when the given attribute is different from the previous thumbnail. The new replacement tags are linked to thethumbchangeattribute, i.e. if you choose to “watch”categorythen one new tag ({changed:category}) becomes available every time the category changes. Combine this with thesortattribute for best results
So, fuls, to answer your question, you would now do this (see also example 6 in the help) :
<txp:smd_gallery category="blah, blah, blah" thumbchange="category_title" thumbchangewraptag="h3" form="gallery" thumblimit="1" />
and your gallery form:
{changed:category_title}
<a href="{url}" rel="lightbox-{category}">
{object}
</a>
Job done :-)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline