Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#691 2010-05-21 14:24:20
Re: smd_gallery: super-flexible gallery generator
Hi hablablow,
If you have a few extra minutes, please, do you think you could explain what are you doing with that code? (I’ve read it and re-readit a few times, but haven’t grasped yet what is going on behind the curtains). I’m curious about what it does and how it works.
If there are no exta minutes, don’t worry then.
Thanks!
Offline
#692 2010-05-21 14:57:33
Re: smd_gallery: super-flexible gallery generator
Si Julian es un poco complicado pero bueno…
What I do is list article images within a defined section and then paginate them with the use of Stef’s plugin.
I filter my article list the way I want to with the use of article_custom then I pull the article image with the use of the upm_image plugin.
Stef’s plugin allows me to paginate my resulting list.
Easy.
Except that we need to build also an array based on article ID to store the article image order.
That’s why Stef suggested this:
<txp:article_custom>
<txp:php>
global $article_info;
$article_info[upm_img_id(array())] = array(
'id' => article_id(array()),
'title' => title(array()),
'category' => category1(array()),
'category_t' => category1(array('title' => '1')),
'section' => section(array()),
);
</txp:php>
</txp:article_custom>
<txp:smd_gallery form=“smd_call” />
Then in the txp:smd_gallery form call, for example:
<img src=”#” alt=”<txp:php> global $article_info; $href = permlink(array(‘id’ => $article_info[{id}][‘id’])); echo $article_info[{id}][‘title’];</txp:php>” />
So this two step process would output a list of paginated article images based upon the upm_image plugin.
Ya Julian… No se si te parece mas claro asi… Ojala ayudo un poco.
Chau !
_
_I plant seeds for future visions. Farmer of your eyes. Subliminal engineer of your minds. eion founder__
Offline
#693 2010-05-21 15:43:04
Re: smd_gallery: super-flexible gallery generator
Thanks, Guillaume.
It helped, although I must confess I still don’t get it very well, but don’t worry about that.
I wonder if it couldn’t be done in just one round and by using just plain TXP & smd_ plugin tags, discarding upm_image.
Something like:
<txp:article_custom><!-- fetch the articles -->
<txp:smd_gallery id="?article_image"><!-- pull the article images field -->
<!-- ... do stuff here... -->
</txp:smd_gallery>
</txp:article_custom>
Except that we need to build also an array based on article ID to store the article image order.
This is one thing I didn’t get. Do you want the images sorted in the order that articles were pulled? Which is the sorting criteria for articles and/or article images then?
I’m just thinging loud, don’t feel like you have to give an answer.
BTW: your Spanish is pretty good.
Offline
#694 2010-05-21 15:45:24
Re: smd_gallery: super-flexible gallery generator
Well, I’ll look into your original request to have a better understanding of your goal. :)
Offline
#695 2010-05-21 15:52:50
Re: smd_gallery: super-flexible gallery generator
I wonder if it couldn’t be done in just one round and by using just plain TXP & smd_ plugin tags
Probably, but I needed it to fit my special case…
Which is the sorting criteria for articles and/or article images then
The one you need: use all the power of article_custom to filter your lists the way you want to.
BTW: … Si gracias, y me encantan los Havanas blancos ;)
Last edited by hablablow (2010-05-21 15:53:08)
_
_I plant seeds for future visions. Farmer of your eyes. Subliminal engineer of your minds. eion founder__
Offline
#696 2010-05-29 07:50:07
Re: smd_gallery: super-flexible gallery generator
Is it possible to user replacement for my new columns in txp_image table? I’ve added column code_left and use some value in it – how do i show this value inside smd_gallery form, like {code_left}?
Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?
Offline
#697 2010-05-29 08:17:01
Re: smd_gallery: super-flexible gallery generator
the_ghost wrote:
how do i show this value inside smd_gallery form, like
{code_left}?
Exactly. Just make sure you tell the plugin about the new column via the columns attribute.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#698 2010-06-02 10:32:48
Re: smd_gallery: super-flexible gallery generator
sort="random" doesn’t work on ‘root’ server … !?
OK … maybe it has been asked before but I’ve a problem with the browser cache and the plug-in … I think!
And it’s a bit weird. When this site was on a subdirectory on the same server everything was working fine. Yesterday the site went ‘online’ and now the images at the top doesn’t sort at random any more. The plug-in (!) still renders the same image. Only when I disable the cache I get a new image … only for that moment.
The code:
<txp:smd_gallery category="banner" form="banner" limit="1" sort="random" />
The form:
<img src="{url}" alt="{alt}" title="{alt}" width="{width}" height="{height}" />
Any help is appreciated.
Last edited by RedFox (2010-06-03 07:18:02)
Offline
#699 2010-06-18 01:59:57
Re: smd_gallery: super-flexible gallery generator
Hi I’m havin’ a problem creating an additional slideshow with different dimensions.
In the slideshow css file I’ve copied all the slideshow classes to slideshowthree with new dimensions. But the slideshow just shows the alternate content image. So i must be missing something but i can’t see anything in the css file that i’m missing.
<txp:smd_gallery controller = "{duration: 2000, transition: Fx.Transitions.Elastic.easeOut}"
category="3colslideshow" form="3colslide"
combo="imglist:{id}{ext}"
collate="quote:{imglist}:{alt}" />
3colslide form:
<div class="slideshowthree" id="slideshowthree">
<img src="<txp:site_url />images/{id#1}.jpg" alt="{alt#1}"/>
</div>
<script type="text/javascript">
var myShow = new Slideshow('slideshow', [{imglist}], {hu: '/images/', resize: false, duration: 2000 });
</script>
its a bad hen that wont scratch itself.
photogallery
Offline
#700 2010-06-18 03:14:09
Re: smd_gallery: super-flexible gallery generator
Brilliant! I’ve done simple galleries/slideshows with this before.
Today, I’m working on a bit of a complicated slideshow and whaddya know – smd_gallery has everything I need.
Thanks Stef!
—
Tom
Offline
#701 2010-06-25 12:31:15
Re: smd_gallery: super-flexible gallery generator
trying to trouble shoot a slideshow that’s not working using smd. Rechecked everything not sure what the problem is:
Txp gernerates this debbugging code:
Tag error: <txp:smd_gallery controller = "{duration: 2000, transition: Fx.Transitions.Elastic.easeOut}"category="homeslideshow" form="homeslideshow"
combo="imglist:{id}{ext}"collate="quote:{imglist}:{alt}" /> -> Textpattern Notice: Unknown tag attribute: controller on line 699
the js in the html renders like this:
<script type="text/javascript"> var myShow = new Slideshow('slideshow', ["5.jpg","4.jpg"], {hu: '/images/', resize: false, duration: 2000 });
</script>
All my links are in the head. Not sure how to trouble shoot this. Any ideas?
its a bad hen that wont scratch itself.
photogallery
Offline
#702 2010-06-25 12:48:27
Re: smd_gallery: super-flexible gallery generator
kvnmcwebn wrote:
Unknown tag attribute: controller on line 699
For some reason your smd_gallery tag is thinking that your javascript definition for the controller is a tag attribute. Probably something to do with quotes in the tag. Can you post your actual smd_gallery tag please and any associated forms?
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#703 2010-06-25 14:42:54
Re: smd_gallery: super-flexible gallery generator
thanks steph,
here’s my form:
<div class="slideshow" id="slideshow">
<img src="<txp:site_url />images/{id#1}.jpg" alt="{alt#1}"/>
</div><script type="text/javascript">
var myShow = new Slideshow('slideshow', [{imglist}], {hu: '/images/', resize: false, duration: 2000 });
</script>
and my article:
<txp:smd_gallery
controller = "{duration: 2000, transition: Fx.Transitions.Elastic.easeOut}"
category="homeslideshow" form="homeslideshow"
combo="imglist:{id}{ext}"
collate="quote:{imglist}:{alt}" />
its a bad hen that wont scratch itself.
photogallery
Offline
#704 2010-06-25 15:12:31
Re: smd_gallery: super-flexible gallery generator
kvnmcwebn wrote:
controller = “{duration: 2000, transition: Fx.Transitions.Elastic.easeOut}”
Hmmm, what’s that supposed to be? controller isn’t an smd_gallery attribute, which is why it’s complaining.
You’re not using the word controller in your form so it’s not like it’s even a botched custom combo definition. What’s it supposed to control? And where did you get the example code from? I’m not very familiar with slideshow; maybe somebody else here is?
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#705 2010-06-25 15:25:13
Re: smd_gallery: super-flexible gallery generator
What’s it supposed to control?
good question… I don’t know exactly….it’s just mootools slideshow attributes that controls the length of the fades and stuff. I got it off the slideshow mailing list/forum actually I’ve used the exact same article on another site and it’s working with or without the controller attributes.
Also I’ve now taken it out of the site in question and the error message does go away thanks.
The slideshow is still not working though and i am at a loss as to why. Must be something silly on my end. Thanks again steph.
its a bad hen that wont scratch itself.
photogallery
Offline