Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#37 2008-04-04 18:54:50

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

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.

Txp Builders – finely-crafted code, design and Txp

Offline

#38 2008-04-06 08:50:34

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

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

#39 2008-04-06 09:04:39

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

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.

Txp Builders – finely-crafted code, design and Txp

Offline

#40 2008-04-06 09:37:04

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

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

#41 2008-04-06 09:39:55

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

Re: smd_gallery: super-flexible gallery generator

This is the form:

<a href="{url}" title="{title}" <img src="{thumburl}" alt="{alt}" /></a>

Offline

#42 2008-04-06 09:44:53

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

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.

Txp Builders – finely-crafted code, design and Txp

Offline

#43 2008-04-06 10:00:56

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

Re: smd_gallery: super-flexible gallery generator

Yeah, that was it! Thanks, Stef. Life is back to normal now :-)

Offline

#44 2008-04-08 20:57:28

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

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

#45 2008-04-09 00:23:34

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

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 change
  • thumbchangewraptag / 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 the thumbchange attribute, i.e. if you choose to “watch” category then one new tag ({changed:category}) becomes available every time the category changes. Combine this with the sort attribute 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.

Txp Builders – finely-crafted code, design and Txp

Offline

#46 2008-04-10 15:39:19

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

Re: smd_gallery: super-flexible gallery generator

Wow! Thank you very much, I will check it asap:D!

Offline

#47 2008-04-10 19:45:59

keith
Member
From: Blyth, Northumberland, England
Registered: 2004-12-08
Posts: 199
Website

Re: smd_gallery: super-flexible gallery generator

Stef, you scare me!!


Keith
Blyth, Northumberland, England
Capture The Moment

Offline

#48 2008-04-10 19:57:45

masa
Member
From: Asturias, Spain
Registered: 2005-11-25
Posts: 1,091

Re: smd_gallery: super-flexible gallery generator

I agree, this gem of a plugin keeps evolving at a scary rate. :-)

I realised that one could even set up different types of galleries with individual forms and then use the form override option in the Write interface to select a specific one for individual articles.

Offline

Board footer

Powered by FluxBB