Textpattern Forum

You are not logged in. Register | Login | Help

#331 2009-01-09 23:03:59

jakob
Moderator
From: Germany
Registered: 2005-01-20
Posts: 1,923
Website

Re: smd_gallery: super-flexible gallery generator

Just gotta say, the more I use this plugin the more I love it! … And, of course, I have a query too:

Is there an easy way to trigger an onchange and new group based on a certain number of iterations, e.g. use one smd_gallery tag which onchanges after every nth picture break and use the group tags?

Explanation: I found myself in a similar situation to Dale’s back here with three parallel fade-in-out slideshows that should display randomly. The same picture should not appear twice so it’s not possible to call smd_gallery three times over each using random. At the time you offered a complicated php-based solution.

For the moment, I have found a solution using your other swiss-army-knife-of-a-plugin smd_if:

<!-- three flic-flac innerfade slideshows -->
      <ul class="slideshow">
<txp:smd_gallery category="frontpage" limit="9" sort="random">
<txp:smd_if field="{counter}" operator="in" value="4/7">
      </ul>
      <ul class="slideshow">
</txp:smd_if> 
       <li><a href="<txp:permlink id="{alt}" />"><img src="{url}" alt="" /><span>{title}</span></a></li>
</txp:smd_gallery>
      </ul>

smd_gallery generates a nice random assortment of 9 images from the ‘frontpage’ category and smd_if tests if the incremental counter is 4 or 7 and inserts a group-end and group-start tag if that is the case. By changing the limit attribute in smd_gallery and the value increments in smd_if one can control this nicely.

At first I tried using operator="divisible:NUM" value="3" with smd_if but it cuts in one too early. The insertion needs to occur after the counter that is divisible by three e.g. when counter = (divisible by 3) + 1.

Note: I’ve abused the alt tag to contain the Article-ID of the relevant article so that I can link to it.

One single call to jquery.innerfade is all that is needed to set off all three linked slideshows.

After doing all that, I wondered if you had already come up with an “onchange interval” solution?

[ Apologies if this was already dealt with in the past 17 pages and I missed it ].


TXP Builders – finely-crafted code, design and txp

Offline

#332 2009-01-10 00:48:23

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,933
Website

Re: smd_gallery: super-flexible gallery generator

Hi jakob, an excellent soution you came up with there. Ingenious use of the tags. Shame that — as you say — smd_if can’t render the +1 case, that would have made it an even more appealing approach.

However…

jakob wrote:

Is there an easy way to trigger an onchange and new group based on a certain number of iterations

You just never know when your wishes might come true:

<txp:smd_gallery category="frontpage" limit="9" sort="random" onchange="smd_every:3" grouptag="ul" groupclass="slideshow">
{grouptagstart}
   <li><a href="<txp:permlink id="{alt}" />"><img src="{thumburl}" alt="" /><span>{title}</span></a></li>
{grouptagend}
</txp:smd_gallery>

(well alright, that syntax is in v0.5 and generates the same as your code in the post above. Wanna try it out… get in touch)

EDIT: maniqui, I’ll get back to you on your proposal when I get a chance to digest it.

Last edited by Bloke (2009-01-10 00:58:55)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Online

#333 2009-01-10 08:54:07

jakob
Moderator
From: Germany
Registered: 2005-01-20
Posts: 1,923
Website

Re: smd_gallery: super-flexible gallery generator

onchange=“smd_every:3”

You never cease to amaze me: Excellent – that would be perfect!
I guess one could use grouptagend on its own too when one wants to add a manual break or clearing element? Would that simply be a matter of not specifying grouptagstart or giving it “” as a tag?


TXP Builders – finely-crafted code, design and txp

Offline

#334 2009-01-10 10:49:10

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,933
Website

Re: smd_gallery: super-flexible gallery generator

jakob wrote:

I guess one could use grouptagend on its own too when one wants to add a manual break or clearing element?

Yep, in theory. grouptagstart is blank by default so just setting a grouptagend would add a break every nth element (haven’t tried it, but it should).


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Online

#335 2009-01-14 16:14:05

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

Re: smd_gallery: super-flexible gallery generator

Is it possible to make a categorylist with 1 thumbnail and title,
and if you click on of those, you get all thumbnails from that category?

Offline

#336 2009-01-14 16:28:25

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 4,972
Website

Re: smd_gallery: super-flexible gallery generator

hi kreeltje

Yes it is. You can use txp’s article_image and you can call the rest of the category thumbnails within that article.


Yiannis
——————————
neme.org | neme-imca.org | hblack.net | LABS

Online

#337 2009-01-15 12:31:40

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

Re: smd_gallery: super-flexible gallery generator

Thanks for the quick reply colak :-)

But is it also possible to do this without having to make articles so i only use forms?

Offline

#338 2009-01-15 14:04:56

feragnoli
Member
From: the hague
Registered: 2005-02-10
Posts: 150

Re: smd_gallery: super-flexible gallery generator

@ Bloke:
I am having some trouble using the gallery…
I have a form of this kind:

<txp:smd_gallery id="?article_image" form="article_image" offset="1" pageform="article_image_nav" limit="1" debug="0" navclass="gallery_nav" />

so, as you see I should skip the first image and count the remaining ones to be displayed one per page. while the plugin seems to output all the images without offset…
any idea?
thanks

Last edited by feragnoli (2009-01-15 14:06:44)


what was that again…?

Offline

#339 2009-01-28 23:10:31

masa
Member
From: Reykjavik, Iceland
Registered: 2005-11-25
Posts: 1,079

Re: smd_gallery: super-flexible gallery generator

Bloke wrote:

And masa, I never thought of using overrides like that; great tip, thanks :-)

Re my previous comment on using different forms to provide a selection of gallery setups here

I have a client that might want to display a gallery as a Lightbox-style- or a more conventional one depending on the content. I can set up different forms for each to choose from the “form override” select, but I also want to hide all the other article forms that show up in there to make sure they can’t screw up.
Can I just set those article forms to type=misc without breaking anything?

The real questions is perhaps, what does the form type attribute do? Is it mainly for organising purposes or are there underlying, technical differences?

I know, only article forms can be previewed, but that doesn’t bother me.

Offline

#340 2009-01-28 23:21:14

maniqui
Moderator
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 2,989
Website

Re: smd_gallery: super-flexible gallery generator

The real questions is perhaps, what does the form type attribute do? Is it mainly for organising purposes or are there underlying, technical differences?

They are just for categorization, and they make sense for the “Tag generator” (on the left sidebar).
But there aren’t any underlying technical difference on how the form will work.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB