Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#877 2012-01-10 09:53:49

skoria
New Member
Registered: 2012-01-10
Posts: 1

Re: smd_gallery: super-flexible gallery generator

Hi,

I’m trying to use smd_slimbox to display a lightbox of an image related to an article, but that then allows you to scroll to see other images related to it. I’ve tried various ways with that plugin and failed(it shows images not linked to the article as well, or shows all the images, and I only want one displayed until you click on it and show the lightbox). I wonder if it’s better to try with this plugin, and if so how you would suggest I do it?

I’m also trying to find a way to show a “featured” article which may be from one of 2 different categories – do you know if there is a way to do an “if”?

Thanks very much!

Ale

Offline

#878 2012-01-10 10:35:17

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

Re: smd_gallery: super-flexible gallery generator

skoria wrote:

I wonder if it’s better to try with this plugin, and if so how you would suggest I do it?

It’s definitely possible with this plugin. It has a feature thumblimit which will show you, say, one clickable thumb and then it’ll allow you to lightbox your way through the other “hidden” images on the page. Those images are selected by using the id, category, or author attributes.

I’m also trying to find a way to show a “featured” article which may be from one of 2 different categories – do you know if there is a way to do an “if”?

Yes you can. If the core tags can’t do what you want, there’s smd_if. Although if you’re doing featured articles, you might like to check out smd_featured instead.


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

#879 2012-01-10 11:52:51

JeroenC
Member
From: Finland
Registered: 2010-04-14
Posts: 30
Website

Re: smd_gallery: super-flexible gallery generator

could you write an example tag with thumblimit ?

I can’t seem to find it at your pages but it sounds like what I need.

<txp:smd_slimbox thumblimit="1" />

is what I would do, but that doesn’t work.

Last edited by JeroenC (2012-01-10 11:53:08)


Time to volunteer? Come and join us at a great project which is going to be opensource: https://www.caloom.com

Offline

#880 2012-01-10 12:20:35

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

Re: smd_gallery: super-flexible gallery generator

JeroenC wrote:

could you write an example tag with thumblimit ?

Look at example 2 in the help. Though it uses a form, you could use smd_gallery as a container instead. The key to making thumblimit work is the {object} replacement tag (the output of which you can customise with objectform if you don’t like the default).


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

#881 2012-02-01 15:38:00

jsanto
Member
From: New York, NY
Registered: 2005-07-30
Posts: 19
Website

Re: smd_gallery: super-flexible gallery generator

Hello, can I use a wildcard to include only certain image categories, without invoking an article field?

I need to be able to display a thumbnail only for image categories with the prefix “press-” in its name, while also excluding any image categories that lack this prefix, as well as images that do not have a category.

I tried this but it does not return any images:

<txp:smd_gallery category=“press-?” form=“pressGallery” thumblimit=“1” />

this is the pressGallery form:

<a rel=“lightbox-{category}” href=”{url}” title=”{caption}”>{object}</a>

I am running v0.62 on TXP 4.4.0

Thanks for a great plugin!

Offline

#882 2012-02-01 16:08:43

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

Re: smd_gallery: super-flexible gallery generator

jsanto wrote:

Hello, can I use a wildcard to include only certain image categories

Sadly no. Wildcards are not something I built in.

If you’re not too far into the project and don’t have a zillion categories (because doing this by hand in Txp is a real chore at the moment), you could restructure your categories so they were all children of a single parent category called ‘press’ — or whatever you like really. Then you can supply that parent cat to the plugin and use sublevel="1" (or higher) to ensure it picks only images in the parent and its subcats. Uncategorized images are automatically omitted.

Hope that helps.

Last edited by Bloke (2012-02-06 11:20:26)


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

#883 2012-02-04 14:52:23

jsanto
Member
From: New York, NY
Registered: 2005-07-30
Posts: 19
Website

Re: smd_gallery: super-flexible gallery generator

that is very helpful, because those categories are already under a parent category named PRESS — thank you!

Offline

#884 2012-02-06 11:18:01

Gallex
Member
Registered: 2006-10-08
Posts: 1,289

Re: smd_gallery: super-flexible gallery generator

i would like create gallery which pulls out all images from all categories (except those 4 inside ‘category’ tag ) into one gallery/album. and only last 4 added images are visible. my code below has one big bug – images are grouped into albums by category. i don’t want that.

<txp:smd_gallery category="!header-image, !site-design, !content, !toetajad" sort="date desc" thumblimit="4" thumbsize="48" grouptag="div" groupclass="pildid">
{grouptagstart}
<a class="fancybox" rel="fancy-{category}" href="{url}" title="{caption}">
{object}
</a>
{grouptagend}
</txp:smd_gallery>

Offline

#885 2012-02-06 11:24:50

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

Re: smd_gallery: super-flexible gallery generator

Gallex wrote:

images are grouped into albums by category. i don’t want that.

Try adding onchange="date". By default the onchange / group tags look for changes in category (the default sort order). Since you’ve altered the sort you need to alter the onchange to match. I should probably be more clever about that and set the onchange to the same as the sort column if you haven’t explicitly changed it. Might look into that for the next version.


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

#886 2012-02-06 11:48:25

Gallex
Member
Registered: 2006-10-08
Posts: 1,289

Re: smd_gallery: super-flexible gallery generator

<txp:smd_gallery category="!header-image, !site-design, !content, !toetajad" sort="date desc" thumblimit="4" thumbsize="48"  onchange="date" grouptag="div" groupclass="pildid">
{grouptagstart}
<a class="fancybox" rel="fancy-{category}" href="{url}" title="{caption}">
{object}
</a>
{grouptagend}
</txp:smd_gallery>

like this? now it creates album for each image. take a look

Offline

#887 2012-02-06 11:58:36

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

Re: smd_gallery: super-flexible gallery generator

Gallex wrote:

now it creates album for each image.

Oh, duh, yes, sorry.

Why are you grouping them at all if you want one album? grouptag will split your images into groups based on the onchange attribute. Try removing the {grouptagstart} and {grouptagend} replacements, and onchange / grouptag / groupclass attributes then see what you get.

Last edited by Bloke (2012-02-06 12:00:04)


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

#888 2012-02-06 12:55:00

Gallex
Member
Registered: 2006-10-08
Posts: 1,289

Re: smd_gallery: super-flexible gallery generator

almost there ;)

<txp:smd_gallery category="!header-image, !site-design, !content, !toetajad" sort="date desc" thumblimit="4" thumbsize="48" wraptag="div" class="pildid">
<a class="fancybox" rel="fancy-{category}" href="{url}" title="{caption}">
{object}
</a>
</txp:smd_gallery>

only thing: thumblimit="4" not working like i wanted to. it doubles thumbs number. cause i have 2 categories right now from which it pulls out the images??

Offline

Board footer

Powered by FluxBB