Textpattern CMS support forum

You are not logged in. Register | Login | Help

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

jstubbs
Moderator
From: Hong Kong
Registered: 2004-12-13
Posts: 2,394
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: 8,753
Website

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
Moderator
From: Hong Kong
Registered: 2004-12-13
Posts: 2,394
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: 8,753
Website

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

#49 2008-04-10 22:27:35

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,753
Website

Re: smd_gallery: super-flexible gallery generator

Hehe, you’re not alone: the way this one’s going is astounding me!

It always bugged me that I managed to get smd_slimbox to be able to do multiple galleries from one call but smd_gallery — the supposed upgrade — couldn’t do it cleanly. I’d hoped that breaking stuff out into forms would allow some cunning uses of <txp:if_different> but it had two unforeseen (at least by me) drawbacks:

  1. it only seemed to function properly when images were sorted by category
  2. if using the thumblimit facility, you’d only get thumbnails for the 1st gallery. All subsequent galleries would get titles but no thumbs. Clearly sub-optimal

So I knew I needed a way of optionally “resetting” the thumblimit counter when a category changed and tried several (failed) attempts at conditional tags; all of which involved horrible globals and messy code. Then I twigged that I could merely make the {replacements} conditional and it all fell into place. The unexpected bonus was that with one extra attribute I could make just about every piece of image data conditional, instead of simply categories. As Hannibal would say: “I love it when a plan comes together”

I hope (abuse of) the new features take people to hitherto uncharted gallery lands.

And masa, I never thought of using overrides like that; great tip, 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

Offline

#50 2008-05-08 12:57:41

fangonk
Member
Registered: 2007-07-12
Posts: 44

Re: smd_gallery: super-flexible gallery generator

Hey Bloke,

Im putting together a website for a client and they are twisting my arm in to giving them a very basic (non-slimbox) image gallery – a whole bunch of little thumbnails that when clicked open up a larger version.

Here is how I’ve got it set up in the page template:

<div id =“archivet1”>
<txp:smd_gallery category=“welcomes” thumb=“1” form=“gallery” />
</div>

And in the gallery form:

<a href=”{imagepath}{id}.jpg”>
<img class=“thaclass” src=”{url}” alt=”{alt}” />
</a>

I know this seems like an overly complex way to set this up, but after a lot of trial and error, I couldn’t seem to set it up in a more simple way. When I use the {url} tag, the plugin always outputs a link to the thumbnail and if I removed thumb=“1” in the template, the plugin always outputs the full size image on the thumbnail page.

This more complex set up would be OK with me, but now I want to output the fullsize image using a form and keep it in the context of the rest of the site. Any suggestions? Is this question really unclear? Probably.

Last edited by fangonk (2008-05-08 13:00:19)

Offline

Board footer

Powered by FluxBB