Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#291 2008-12-04 13:07:52

maniqui
Moderator
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: smd_gallery: super-flexible gallery generator

Hi Bloke,
thanks for the detailed reply.
I’ve nothing to add, the genius is you, not me.

Now, the question: is it possible to assign an id (I’m talking about the HTML attribute here) to the wraptag? I’ve seen it’s possible to use the class attribute, but I didn’t find a way to use an id.
It could be useful for javascripting purposes.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#292 2008-12-04 17:14:31

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,268
Website

Re: smd_gallery: super-flexible gallery generator

maniqui wrote:

is it possible to assign an id

Yes it’s possible. Yes it’s easy. Yes it’ll be in the next revision.


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

#293 2008-12-04 17:21:27

maniqui
Moderator
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: smd_gallery: super-flexible gallery generator

Yes, yes, yes :)

Possibilities with this plug-in seem almost endless.

Just for the sake of posting a very simple example:

<txp:article_custom id="1">
... some txp article tags...
  <txp:smd_gallery id="?article_image">
     <txp:image id="{id}" />
  </txp:smd_gallery>
</txp:article_custom>

It’s like upm_image on steroids.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#294 2008-12-04 17:57:13

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,268
Website

Re: smd_gallery: super-flexible gallery generator

maniqui

The new attribute will be html_id to fit in with the other core tags that use one, and it’ll apply it to the wraptag only, yes? (if it’s used). You can sort of simulate it now if you like. Look at this, untested, example:

<txp:article limit="10">
   <h3><txp:title /></h3>
   <txp:smd_gallery id="?article_image" combo="myhtml_id:mydiv_?thisid">
      <txp:smd_if field="{counter}" operator="eq" value="1">
         <div id="{myhtml_id}">
      </txp:smd_if>

         <txp:image id="{id}" />

      <txp:smd_if field="{counter}" operator="eq" value="{totalimages}">
         </div>
      </txp:smd_if>
   </txp:smd_gallery>
</txp:article>

That will (should!) create a combo for every article and label it mydiv_ plus the article’s ID. The smd_if tags make sure the opening and closing divs are only displayed on the first and last images (assuming article_image holds more then one image).

Obviously the tag attribute html_id simplifies this ten-fold! Thanks for the idea.


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

#295 2008-12-04 18:38:11

maniqui
Moderator
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: smd_gallery: super-flexible gallery generator

Hey, in that case (using the smd_gallery inside an article) it is far less easier to create a unique ID ;)

<txp:article limit="10">
   <h3><txp:title /></h3>
   <txp:smd_gallery id="?article_image">
      <txp:smd_if field="{counter}" operator="eq" value="1">
         <div id="mydiv_<txp:article_id />">
      </txp:smd_if>

         <txp:image id="{id}" />

      <txp:smd_if field="{counter}" operator="eq" value="{totalimages}">
         </div>
      </txp:smd_if>
   </txp:smd_gallery>
</txp:article>

My request was for when you don’t have a way to generate a unique identifier (i.e. when using smd_gallery outside txp:article). The html_id attr will be helpful.

And the smd_if trick for opening/closing divs is a good one too.

Thanks Bloke!


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#296 2008-12-11 08:11:41

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 858
Website

Re: smd_gallery: super-flexible gallery generator

Bloke – you are my hero :)

Superb plugin – Thanks

Offline

#297 2008-12-11 17:17:09

mlarino
Member
Registered: 2007-06-29
Posts: 367

Re: smd_gallery: super-flexible gallery generator

Hi,
I am having a problem launching the slimbox gallery form one image.

The page has 4 different images that open 4 different galleries.
Sketchbook1 (opens sketchbook1 category images in slimbox)
Sketchbook2 (opens sketchbook2 category images in slimbox) etc…

All this works, each one opens the slimbox in the first image from their category, but the problem is that instead of stoping in their category, you can view every image from the rest of categories.

the code I have in the page is:

<txp:smd_gallery category=“sketchbook_paris” id=”?article_image” sublevel=“0” form=“gallery” thumblimit=“1” />

<txp:smd_gallery category=“sketchbook_2008” id=”?article_image” sublevel=“0” form=“gallery” thumblimit=“1” />

<txp:smd_gallery category=“sketchbook_2007” id=”?article_image” sublevel=“0” form=“gallery” thumblimit=“1” />

<txp:smd_gallery category=“sketchbook_2007” id=”?article_image” sublevel=“0” form=“gallery” thumblimit=“1” />

Offline

#298 2008-12-11 18:44:07

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,268
Website

Re: smd_gallery: super-flexible gallery generator

mlarino wrote:

instead of stoping in their category, you can view every image from the rest of categories.

You need to add something to the rel= attribute to stop the images from all being in the same “group”.

By default all images that have “lightbox” in their rel become one big group of images when you launch the lightbox. If you add something to the end of the rel that is unique to that particular gallery, you will only be able to navigate within that group.

Since you are only showing one category per smd_gallery, the category is in ideal candidate. So add:

rel="lightbox-{category}"

to the anchor in your gallery form. When you look at the page source you’ll see that all images in the first gallery have:

<a rel="lightbox-sketchbook_paris" id="...">

and ones in the next gallery have:

<a rel="lightbox-sketchbook_2008" id="...">

and so on.


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

#299 2008-12-15 17:14:27

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

Re: smd_gallery: super-flexible gallery generator

Bloke:

Hope all is well on your side of the pond.

I was wondering, have you ever come across a lightbox image viewer that has the capability to Auto Play when launched. The reason I ask, is that I have a client that really likes the flexibility of lightbox (ie not boxed into a set image size for a complete gallery) but they want it to play like a slideshow without requiring user input (but also having the flexability to require user input if they want.)

I have searched, but have not found such an anmial yet.

Any input from Bloke (or anyone on the board) would be much appreciated.

progre55

Offline

#300 2008-12-15 18:33:16

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

Re: smd_gallery: super-flexible gallery generator

What about this one? I’m sure that smd_gallery will work with it.

Example here


Keith
Blyth, Northumberland, England
Capture The Moment

Offline

Board footer

Powered by FluxBB