Textpattern CMS support forum

You are not logged in. Register | Login | Help

#561 2009-09-22 11:29:34

Si
Member
From: Kiev
Registered: 2008-08-31
Posts: 45
Website

Re: smd_gallery: super-flexible gallery generator

After reading the manual %) for the Slideshow I found that each image can be actually linked individually, like in this example:

<script type="text/javascript">var data = {'1.jpg': {caption: 'Keylin', href: 'keylin.html'}, '2.jpg': {caption: 'Gustavo', href: 'gustavo.html'}, '3.jpg': {caption: 'Amalia', href: 'amalia.html'}};
var myShow = new Slideshow('my_show', data, {captions: true, controller: {duration: 1000, transition: Fx.Transitions.Elastic.easeOut}, hu: 'images/'});</script>

but would it be possible to call the href value from the alt field of each image?

Offline

#562 2009-09-23 16:14:20

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

Re: smd_gallery: super-flexible gallery generator

I am going a little more complex in my last gallery, and I am having a problem with the pagination links…

I made a gallery showing 27 thumnails, (floating divs using the form) and left the space for the 28th for another floating div, the “NEXT” button.
The problem is, I cant figure out a way to use images with {navnext}
is it posible?
here is a little mockup of what I am trying to make.
image

I also want the second page to display instead of 27 thumnails, 26, to make room for the {navnext} and {navprev} is it posible to do something like that?
like this:
image

Last edited by mlarino (2009-09-23 16:16:53)

Offline

#563 2009-09-24 20:10:19

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

Re: smd_gallery: super-flexible gallery generator

I thought this was going to work, but no :(

<a href="{navnext}"><img src="http://www.xxx.com/santy/images/next.jpg" /></a> 

outputs this:

<a href="<li><a href="/santy/illustration?smd_glry_4594=2">&raquo;</a></li>">
<img src="http://www.xxx.com/santy/images/next.jpg" /></a>

been testing using your explanation "here":http://forum.textpattern.com/viewtopic.php?pid=180377#p180377
using {navnextpageurl} but that doesnt do anything at all :(

no way it could be as easy as writing {navnext:<txp:image id="191" />}   ?? :)

Last edited by mlarino (2009-09-25 00:04:12)

Offline

#564 2009-09-25 00:10:00

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

Re: smd_gallery: super-flexible gallery generator

Great!
after 14 hours of testing and testing…..

<a href="{navnextpageurl}"><txp:image id="59" /></a>

did the trick!!!!!!

I was starting to think this was imposible to make :)
is there anything you cant do with this plugin?

So my next questions are…

1.- {navnextpageurl} outputs the RAW URL, so the attribute “emptyclass” is useless here…
How can I hide the “previews” or “next” buttons when there is no previews or next pages?

2.- Can smd_if or the COUNTFORM help me in creating pages with different thumbnail limits?

if page1 ——> limit=“27” (so there is room for the “next page button”)
if page2 ——> limit=“26” (so there is room for the “ next and previews page buttons”)
[…]
if last page -> limit=“27 again” (so there is room only for the “previews page button” because the “next button” will disapear)

Last edited by mlarino (2009-09-25 01:14:14)

Offline

#565 2009-09-25 20:20:51

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,948
Website

Re: smd_gallery: super-flexible gallery generator

mlarino

Glad you got the first part of your problem sorted.

{navnextpageurl} outputs the RAW URL, so the attribute “emptyclass” is useless here…

Yes, if you roll your own navigation that’s what will happen :-(

Can smd_if or the COUNTFORM help me in creating pages with different thumbnail limits?

I don’t think either can help (though I haven’t tried) because you need to know the limit before the container/form is parsed. Plus the number of images per page varies depending on which page you are viewing. Currently the replacement variables and stuff are only set up inside the container/form, so once your limit is set, that’s it. I’ll have a think about it, but…

is there anything you cant do with this plugin?

Yes, currently this request ;-)


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

#566 2009-09-27 14:18:59

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

Re: smd_gallery: super-flexible gallery generator

Thanks Bloke!

All I need to know is that in the first and last page there will be one navigation button, and the rest will have 2.
I will keep trying.

There is no way to use the normal navigation buttons with customized images right? that will be even more helpfull.
:)

Offline

#567 2009-09-28 14:55:25

decoderltd
Member
From: London
Registered: 2006-06-20
Posts: 248
Website

Re: smd_gallery: super-flexible gallery generator

Hi,

I’m using smd_gallery and smd_if on a site and I’ve added a few conditional if statements as you’ll see below. I’ve run into a problem with one particular option, basically I want specfic images to appear depending on the section and this works fine. However there’s a category within one of the sections (testimonials) which needs it’s own image so I’ve tried to use if_category without any success, does anyone have any ideas on how I can get it to work?

In addition, it would be handy to have a generic image that was used if none of the conditions are met, but I can’t use another <txp:else /> tag. Is there another way to achieve this? Thanks.

<txp:smd_if field="article_image" operator="isused">
   <txp:smd_gallery id="?article_image" wraptag="div" html_id="fade" class="pics" >
   <txp:image id="{id}" />
   </txp:smd_gallery>

<txp:else />

   <txp:if_section name="garden-notebook">
     <txp:image id="12" />
   </txp:if_section>

   <txp:if_section name="services">
     <txp:image id="13" />
   </txp:if_section>

   <txp:if_section name="resources">
     <txp:image id="14" />
   </txp:if_section>

   <txp:if_category name="testimonials">
     <txp:image id="14" />
   </txp:if_category>

</txp:smd_if>

Offline

#568 2009-09-28 15:03:29

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,948
Website

Re: smd_gallery: super-flexible gallery generator

decoderltd

Does if_article_category help? Or are you not dealing with an article in this case? if_category only triggers if you’re using /category/name (or ?c=name) in the URL.

As for the default option, at the expense of using another plugin you could try smd_multi_choice which has the benefit of being able to handle all your if_section stuff below and the default case as well.


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

#569 2009-09-28 15:43:02

decoderltd
Member
From: London
Registered: 2006-06-20
Posts: 248
Website

Re: smd_gallery: super-flexible gallery generator

Perfect, thanks Stef, the if_article_category tag worked. Must have a look at smd_multi_choice, don’t you ever sleep!

Offline

#570 2009-09-28 15:53:20

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,781
Website

Re: smd_gallery: super-flexible gallery generator

Stef is not an actual human person. He is more of a Mechanical Turk, continually spinning out — inter alia — code, advice, and strange photographs, to the wonderment of all.


Code is topiary

Offline

Board footer

Powered by FluxBB