Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#889 2012-02-06 13:22:05

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

Re: smd_gallery: super-flexible gallery generator

Gallex wrote:

almost there ;)

Great.

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

Ah yes. Here’s a snippet from the plugin help for thumblimit that might help:

if you are showing multiple categories from a single tag, you will see ‘thumblimit’ thumbnails at each change in category. If you don’t want this, set onchange to something else

So in this case you probably want to define onchange="" to shut it off.

Last edited by Bloke (2012-02-06 13:22:35)


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

#890 2012-02-06 13:44:24

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

Re: smd_gallery: super-flexible gallery generator

do i need to add something to onchange="" cause it solved the thumblimit issue, but now only shows images from last added category?

Offline

#891 2012-02-06 13:51:42

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

Re: smd_gallery: super-flexible gallery generator

Gallex wrote:

do i need to add something to onchange="" cause it solved the thumblimit issue, but now only shows images from last added category?

No, but you will need to remove the -{category} from your rel="fancy-{category}" because that’s telling the lightbox script that you only want to cycle through images with the same rel value.

Last edited by Bloke (2012-02-06 13:52:42)


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

#892 2012-02-06 14:07:45

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

Re: smd_gallery: super-flexible gallery generator

bingo! thank’s bloke!

Offline

#893 2012-02-12 14:54:33

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

Re: smd_gallery: super-flexible gallery generator

i would like to sort my gallery by category date – last added category would be first. did this:

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

but it sorts by category name :( category name starting with letter ‘a’ is last and category name starting with ‘s’ is first. take a look

hmm…..

Offline

#894 2012-02-12 19:21:11

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

Re: smd_gallery: super-flexible gallery generator

Gallex wrote:

i would like to sort my gallery by category date

There’s no such field, so you’re out of luck. Categories don’t have the concept of insertion order: they’re merely arranged into a hierarchical tree (internally stored as a modified preorder binary tree if you’re interested).

Hence sort="category desc" is giving you reverse category by name, and then date desc orders each category by reverse date.


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

#895 2012-02-13 10:32:11

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

Re: smd_gallery: super-flexible gallery generator

Bloke wrote:

There’s no such field, so you’re out of luck. Categories don’t have the concept of insertion order

pitty…

one more question: i use category based gallery (code above), is it possible to create category based navigation? display 10 categories per page for example

Offline

#896 2012-02-15 11:34:54

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

Re: smd_gallery: super-flexible gallery generator

is it?

Offline

#897 2012-02-15 12:00:51

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

Re: smd_gallery: super-flexible gallery generator

Gallex wrote:

is it possible to create category based navigation? display 10 categories per page for example

Can’t you use Txp for this? You can use /category/image/cat-name URLs now and use <txp:if_category>’s type attribute to detect an image cat list. Once you have detected that, you can render a gallery tag per cat (the container of <txp:category_list type="image"> maybe?). Txp should be able to page cat image lists using standard offset/limit and newer/older paging tags. As a last resort, smd_gallery’s paging options might do it.

I can’t recall trying it, but if you fiddle about along those lines something workable should pop out.

Last edited by Bloke (2012-02-15 12:02:09)


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

#898 2012-02-17 10:59:11

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

Re: smd_gallery: super-flexible gallery generator

this is too much for me… i’m afraid

Offline

#899 2012-03-23 10:32:56

ff0000.it
New Member
From: Italy
Registered: 2012-03-14
Posts: 9

Re: smd_gallery: super-flexible gallery generator

Hi all,

i’m new to TXP and I was (trying to) play with smd_gallery to build a slideshow for the frontpage, but it won’t work.
Here the tags:

<txp:if_section name="">
<txp:smd_gallery category="frontpage-slideshow" combo="imglist:{id}{ext}" collate="quote:{imglist}:{alt}" form="frontpage_slideshow" />
<script type="text/javascript">
var frontpage_slideshow = new Slideshow("frontpage-slideshow", { hu: "<txp:site_url />images/", images: [{imglist}], caption: [{alt}], type: "fade" });
</script>
</txp:if_section>

and the form:

<div id="frontpage-slideshow" class="slideshow">
 <img src="<txp:site_url />images/{id#1}{ext#1}"
     alt="{alt#1}" width="760" height="425" />
</div>

basically It’s the same as the slideshow example available on plugin’s help page.
I encounter two issues:

  • the smd_gallery tag expands to the first image only
  • the Javascript goes wrong and Firebug output is “invalid object initializer ‘images: [{imglist}]’”

where am i wrong?!?

Thanks,
ff0000.it

{Added Textile’s bc. for better code display. – Uli}

Last edited by uli (2012-03-23 10:58:25)

Offline

#900 2012-03-23 11:01:31

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,306

Re: smd_gallery: super-flexible gallery generator

It’s been a while since I last used smd_gallery but from what I see you’re using replacement tags outside the gallery tag. Try placing the script tag inside the form (try above or below the HTML, like I said: it’s been a while).


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

Board footer

Powered by FluxBB