Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#331 2009-01-09 23:03:59
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
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. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#333 2009-01-10 08:54:07
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
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. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#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
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 | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#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: North Wales, UK
- Registered: 2005-11-25
- Posts: 1,095
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
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.
Offline
#341 2009-01-28 23:26:25
- masa
- Member
- From: North Wales, UK
- Registered: 2005-11-25
- Posts: 1,095
Re: smd_gallery: super-flexible gallery generator
Thanks Julián, much appreciated!
Offline
#342 2009-02-13 13:31:31
- progre55
- Member
- Registered: 2006-05-02
- Posts: 668
Re: smd_gallery: super-flexible gallery generator
Bloke (or anyone else)
I Have come across a problem that I am hoping I can get some assiatnce on. I am using smd_gallery which is awsome in conjunction with Aaron’s Slideshow2. See Sample Here The integration and everything else is working great. Please over look the minor details (ie thumbnails are not displaying fully) since this is only a sample.
My problem is this: If you put “www” in front of the domain name, it works perfect in IE and Firefox. If I take out “www” it works fine in IE, but does not work in Firefox. Now to add one more niggle to the equation, I can get it to work fine in Firefox without the “www” if I change the root field in TXP and remove the “www”, but then it breaks IE.
So the short of it is, I am not sure if this is a browser issue, a TXP, Aaron’s code; Bloke’s code (highly doubt it) or a combination. Any and all assitance would be appreciated.
I have listed below the code I am using just in case it helps:
HEADER CODE:
<script type="text/javascript" src="mootools.js"></script>
<script type="text/javascript" src="slideshow.js"></script>
PAGE CODE:
<txp:smd_gallery category="slideshowBloke" form="slideshowBloke"
combo="imagecap::'{imagedef}': { 'caption': '{title}' }" collate="1" paramdelim="::" />
FORM CODE:
<div id="show" class="slideshow">
<img src="{imagepath#1}{imagedef#1}" alt="{alt#1}" />
</div>
<script type="text/javascript">
var data = {{imagecap}};
var myShow = new Slideshow('show', data, {captions: true, controller: true, height: 533, hu: '{imagepath#1}', thumbnails: true, width: 800 });
</script>
TXP ADMIN SITE URL SETTING:
www.progressivetechnology.net
Thanks in advance for your assistance.
Also, Bloke did you get my email? Let me know, because I have a question offline kinda about that same subject.
Last edited by progre55 (2009-02-13 13:34:44)
Offline
#343 2009-02-13 13:40:11
Re: smd_gallery: super-flexible gallery generator
progre55 wrote:
If you put “www” in front of the domain name, it works perfect in IE and Firefox. If I take out “www” it works fine in IE, but does not work in Firefox.
This domain / subdomain issue has been mentioned somewhere in this thread (I think) but of course I can’t find it now. Typical!
From what I recall, it boils down to trust. If the way you specify the site domain, and/or the images, and /or the flash component don’t all match, the slideshow throws a fit becaues it thinks you are trying to scam it from a different domain.
Quite why it behaves differently in different browsers I have no idea. I think I’ve fixed it in the past by making sure that my site URL does not have a ‘www’ in it, and then forcing all URLs to remove ‘www’ via a fairly standard two-line .htaccess rule. Once everything was using the same system the problem went away (if you prefer, you can of course force the ‘www’ to be present). Try that and see if it helps. Check the source code of the page is rendering the images with/without the ‘www’ and everything is coherent.
And yes I did get your message yesterday thanks. Didn’t get a chance to look at it last night but I’ll try again later.
Last edited by Bloke (2009-02-13 13:42:25)
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
#344 2009-02-13 13:43:28
- progre55
- Member
- Registered: 2006-05-02
- Posts: 668
Re: smd_gallery: super-flexible gallery generator
Bloke:
Thanks for the quick response, I thought I had seen it to, but cannot find it myself in the thread.
I have tried several .htaccess versions (figuring that may be the answer) but each one I do breaks the site. If you would be so kind to post the .htaccess the code you would use it would be much apprecaited.
Once you have had a chnace to take a look at the other stuff, give me a shout.
progre55
Last edited by progre55 (2009-02-13 13:43:58)
Offline
#345 2009-02-13 13:49:09
Re: smd_gallery: super-flexible gallery generator
progre55 wrote:
If you would be so kind to post the .htaccess the code you would use it would be much apprecaited.
My usual one is something along the lines of:
RewriteCond %{HTTP_HOST} ^www\.site\.com$ [NC,OR]
RewriteRule ^(.*)$ http://site.com/$1 [R=permanent,L]
Whether that’s the most efficient or best route is something I haven’t a clue about. .htaccess is a dark art. It just worked, so I never questioned it :-)
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