Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#301 2008-12-15 19:02:08

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

Re: smd_gallery: super-flexible gallery generator

progre55 wrote:

Like keith says, jQuery cycle is amazing for creating slideshows (jQuery lite if you only want fades) and is the one I’ve used most often recently. The other one I heartily recommend for lightboxing is shadowbox which is totally awesome. And then some.

Perhaps combing the two you can have a slideshow that auto-plays on the page and — when/if it is clicked — will launch a lightboxed version of the same slideshow?

The best thing about shadowbox is that it autosizes to your display res so you don’t get images falling off the edge of the page. The only thing I’ve found lacking is the fact that the caption is forced to be at the top (as far as I can tell; it’s resisted all my advances to move it to date) so if you have long captions they disappear behind the image.


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

#302 2008-12-19 04:42:06

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

Re: smd_gallery: super-flexible gallery generator

I’m trying to add a caption underneath the thumbnail but I’m using “thumblimit=“1” but if I have 4 images, 1 thuhumb is displaying but 4 captions.

I may be creating the captions incorrectly this is what I have:

This is my thumb for to launch the images (I have also tried just adding the text its self.

<a rel="shadowbox[<txp:article_id />];options={counterType:'skip',continuous:true,animate:false,animSequence:'sync'}" href="{url}" title="{alt}">{object}<br />{title}</a>

And this is my code for placing the gallery on the page:

<txp:smd_gallery form="cs-shadow" thumblimit="1" id="?article_image" wraptag="div" class="thumbs" />

So what is happening is that the thumbs are working and only showing 1 – but the other information doesn’t work…

Is there a way around this – or another way to do this?

Also is it possible to use {object} and {text} together?

Offline

#303 2008-12-19 09:17:12

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

Re: smd_gallery: super-flexible gallery generator

tye wrote:

using “thumblimit=“1” but if I have 4 images, 1 thuhumb is displaying but 4 captions.

No, you are doing stuff (mostly) right. What you are seeing is an unfortunate side-effect of the {object} tag and thumblimit. Bit of a pain I know, and I’m sorry it’s not more intelligent but since TXP lacks “encapsulation” of an image object (like the way upm_image or my image patch works) we’re stuck with this system.

All is not lost, however. With some cunning it is possible to do what you want. But firstly, I noticed that for some reason your example does not render properly on my test system. It stems from embedding the <txp:article_id /> tag. For reasons I haven’t figured yet (it may be my new version of smd_gallery that I’m testing right now) if you embed a TXP tag it goes barmy and gets the quotes all wrong. I’ll have to look into that.

But if you do ever find this problem, you can get round it by declaring a combo like this to hold the item you want (in this case the article ID, which is conveniently available to use as the variable thisid):

<txp:smd_gallery id="?article_image" wraptag="div" class="thumbs" thumblimit="1" combo="artid:?thisid" />

Thus you can then use {artid} in your container/form to output the article ID.

The second problem is to show the captions in shadowbox. I traditionally do this by assigning the title="{title}" attribute of the anchor. You are using title="{alt}" which may not be what you want.

Finally, to display that pesky first caption, you are right that if you use thumblimit you are pretty much confined to using {object}. So what we need to do is employ cunning using, say, smd_if to only show 1 caption. Thus a different way of doing what you wanted is this:

<txp:smd_gallery id="?article_image" wraptag="div" class="thumbs" thumblimit="1" combo="artid:?thisid" />
   <a rel="shadowbox[{artid}];options={counterType:'skip', continuous:true, animate:false, animSequence:'sync'}" href="{url}" title="{title}">
      {object}
      <txp:smd_if field="{counter}" operator="eq" value="1">
         <br />{title}
      </txp:smd_if>
   </a>
</txp:smd_gallery>

And no, {object} and {text} are mutually exclusive :-(

I’ll see if I can track down the problem in my latest version of why the quotes go mental if you embed a tag — it certainly shouldn’t be doing that. EDIT: it was just me; I was using the smd_gallery tag in an article and had neglected to tell the system to ‘Leave text untouched’. D’oh.

If the above doesn’t work for you, let me know and I’ll see if I can address it.

Last edited by Bloke (2008-12-19 09:33:59)


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

#304 2008-12-22 03:26:53

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

Re: smd_gallery: super-flexible gallery generator

Bloke – that works perfectly – although I’m not sure what happened, as I haven’t used smd_if before… but if its doing what I think, then that is indeed another great plugin :)

Thanks for the help :)

Offline

#305 2008-12-23 14:23:06

Kreeltje
Member
Registered: 2008-12-23
Posts: 21

Re: smd_gallery: super-flexible gallery generator

Hello everybody!

Thanks for this great plugin!
I’am using this one in the “launch from one image-way”. But my question is(maybe stupid):
How do i tell the categorytag to show all image categories? So i don’t need to specify those?

Thanks for so far.

Offline

#306 2008-12-23 14:40:49

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

Re: smd_gallery: super-flexible gallery generator

Kreeltje wrote:

How do i tell the categorytag to show all image categories?

Don’t use category and it’ll use every image in the database ;-)

The only thing I haven’t fixed yet (but should be in the next revision) is to be able to choose assigned/unassigned categories. In other words “give me all the images that have not been given a category”.

Does that help?


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

#307 2008-12-23 14:52:51

Kreeltje
Member
Registered: 2008-12-23
Posts: 21

Re: smd_gallery: super-flexible gallery generator

Mmm… if i don’t use category i don’t get to see anything :-)

This is my pagecode:
<txp:smd_gallery form="gallery" thumblimit="1" id="?article_image" wraptag="div" />

And this is my form named gallery:
<a rel="shadowbox[gallery]" href="{url}" title="{title}"> {object} </a>

What am i doing wrong?
When i specify the category it works..

P.S. Thanks for the quick reply!

Offline

#308 2008-12-23 15:06:52

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

Re: smd_gallery: super-flexible gallery generator

Kreeltje wrote:

Mmm… if i don’t use category i don’t get to see anything :-)

Ah, right, that’s because you’re using id. You’re telling it to show you a gallery of the image(s) given in the article’s Article image field. If that has a number (or list of numbers) in it you will see a gallery. If, however, it is empty you will see nothing because you have asked for the image ID and there isn’t one.

When i specify the category it works..

Yes, because the gallery is made up of the combination of all images from both category and id. So:

<txp:smd_gallery />    >>>> all images
<txp:smd_gallery id="some, IDs" />    >>>> gallery of given image IDs 
<txp:smd_gallery category="some, cats" />    >>>> gallery of given categories
<txp:smd_gallery id="some, IDs" category="some, cats" />    >>>> gallery of given image IDs + categories

In the latter three cases, if you specify a bunch of places to look and they’re all empty, you get nothing back.

Last edited by Bloke (2008-12-23 15:07:30)


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

#309 2008-12-23 15:28:02

Kreeltje
Member
Registered: 2008-12-23
Posts: 21

Re: smd_gallery: super-flexible gallery generator

Stupid…. You’re my hero for this one ;-)

Thanks man!

Offline

#310 2008-12-24 14:22:55

curiouz
Member
Registered: 2006-06-20
Posts: 56

Re: smd_gallery: super-flexible gallery generator

Bloke! I’m trying to get a paginated gallery going in MLP, but it’s not working. Is this a known issue or is smd_gallery not compatible with MLP yet?

Last edited by curiouz (2008-12-24 14:23:24)

Offline

#311 2008-12-24 19:07:00

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

Re: smd_gallery: super-flexible gallery generator

@curiouz,
smd_gallery is not compatible with MLP yet. I’ve read somewhere else that Bloke is working on making it compatible.

@Bloke,

My brain is overheating about how to do the following:
I want the end-user to have an easy way to add just a single txp:tag somewhere on the article body and have an image rendered on that place.
I would also want to give the end-user some basic flexibility to be able to align (float) the image to left or right.
Of course, the candidates to do this task are smd_gallery or upm_image.

What I cannot figure out is how to pass some class value as an attribute and then be able to use it inside the form.
Example:
the end-user inserts just this:

<txp:upm_image id="5" form="captioned-image" class="floatright" />

And then in the form captioned-image:

<div class="{class}">
...
</div>

I would love to do it using upm_image because smd_gallery seems a bit overkilling for displaying just one image.

But probably smd_gallery and its killer combos may be the answer (that come while writing this post):

<txp:smd_gallery id="5" form="captioned-image" combo="class:floatright" />

And then in the form captioned-image:

<div class="{class}">
...
</div>

I have yet to test this, but I’m confident your crazy plug-in is capable of doing this :D

<feed-crazy-ideas-to-the-tiny-alien-whispering-inside-bloke's-brain-before-opening-a-feature-request-to-be-probably-rejected-by-core-devs>

I think txp tags that use a form attribute (or that can act as container tags) could benefit from having this posibilities:

self-awareness (“wtf did he say?”)
So, code inside the called form (or inside the container tags) can access the values of some (all?) attributes and so, then you can do mighty magic using txp:variable and conditionals.

attributes on the fly (and then, the values assigned can be used inside the called form)
The idea is similar (but not really related) to custom field name used as attribute name on txp:article and txp:article_custom.

In other words, txp:tags that can use/be forms/containers should act as a function where arguments can be passed as parameters and so, they can be used inside the form.

BTW, tiny alien inside bloke’s brain, taste this one, did you like it?

</feed-crazy-ideas-to-the-tiny-alien-whispering-inside-bloke's-brain-before-opening-a-feature-request-to-be-probably-rejected-by-core-devs>

Last edited by maniqui (2008-12-24 19:32:48)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#312 2008-12-24 19:25:41

curiouz
Member
Registered: 2006-06-20
Posts: 56

Re: smd_gallery: super-flexible gallery generator

great news! thanks maniqui

Offline

Board footer

Powered by FluxBB