Textpattern CMS support forum

You are not logged in. Register | Login | Help

#11 2008-03-15 12:44:23

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

Re: smd_gallery: super-flexible gallery generator

jstubbs wrote:

Stef, on this site the idea is to replace smd_slimbox with the new smd_gallery – so its not necessary for the two to live together.

OK, but if you have any other smd_ plugins that require smd_lib then it may be a problem – see my edit above for another random thought I had on the issue. Perhaps deleting smd_gallery and re-installing it will give it a higher ID in the database and thus they’ll load in the correct order (stab in the dark here). Or maybe it’s the order the calls to the smd_ plugins are on the page? Maybe if slimbox occurs first the problem goes away?

I am currently testing _gallery with the Fancy Zoom script. Is it best to use the example #1 in the plugin help for a lightbox/fancy zoom gallery?

According to the FancyZoom docs that should be enough. You don’t appear to need to ‘tag’ the images with any special class in order for the script to work (which is very odd — what if there are linked images on the page you don’t want FancyZoom to touch? Perhaps I missed something in the docs). So that example#1 code should work fine. It may even be overkill, e.g. you might not even need the rel part.


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

#12 2008-03-15 13:06:56

jstubbs
Moderator
From: Hong Kong
Registered: 2004-12-13
Posts: 2,392
Website

Re: smd_gallery: super-flexible gallery generator

Stef, on this site there are no other smd_ plugins, only the gallery plugin. I turned the smd_lib and smd_slimbox off, and all works fine.

I have now got the gallery working, with this form (using Fancy Zoom):

<txp:if_different>
<h3>{category_title}</h3>
</txp:if_different>
<a href="{url}" title="{title}" <img src="{thumburl}" alt="{alt}" /></a>

Here is the URL for a quick peek. Looks good to me so far – thanks for the excellent plugin!

Last edited by jstubbs (2008-03-15 13:08:05)

Offline

#13 2008-03-15 13:09:48

jstubbs
Moderator
From: Hong Kong
Registered: 2004-12-13
Posts: 2,392
Website

Re: smd_gallery: super-flexible gallery generator

Bloke wrote:

what if there are linked images on the page you don’t want FancyZoom to touch?

From the Fancy Zoom page:

“If you explicitly don’t want an image to zoom, add a rel=“nozoom” tag to your href.”

Last edited by jstubbs (2008-03-15 13:10:15)

Offline

#14 2008-03-15 15:21:26

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

Re: smd_gallery: super-flexible gallery generator

jstubbs wrote:

I turned the smd_lib and smd_slimbox off, and all works fine.

Cool, I’d still like to know why in your case it caused a problem. If I was a betting man I’d say it was either execution order on the page or plugin load order. I’ll do some testing to find out and offer a fix in smd_lib for those that want to run both. Thanks for bringing it to my attention; I’d probably never have spotted this otherwise.

If you have any other improvements or better defaults/docs/examples you think the plugin should have, feel free to share them.

for a quick peek. Looks good to me so far

Hey, nice. Glad it worked out for you.

I’m not sure why sometimes the fullsize images don’t appear — I just get the ‘x’ in the middle of the screen — but by clicking the thumbnail again the pic zooms in properly. I think it’s a problem with FancyZoom itself (or my Firefox/Win) because it does it to me on the demo page as well. Only occasionally, and seemingly randomly.

Y’know, looking at it more closely I can’t believe he coded all that by hand. Kudos to the guy, but it’d be about 1/10th of the size with jQuery instead of around 1000 lines of code, and the cross-browser parts would be handled automatically! I looked to see if anyone’s ported it yet and found one but it’s not finished (no IE support), nor could I get it to work properly :-( I did find this magnifier too, in a different bracket but still useful for product sites I guess.

If you explicitly don’t want an image to zoom, add a rel=“nozoom” tag to your href.

Ah, gotcha. Didn’t see that, thanks for the info. I’d have done it the other way round (rel=“zoom” to enable it) but that’s just me.


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

#15 2008-03-15 16:04:02

Gocom
Plugin Author
Registered: 2006-07-14
Posts: 4,524
Website

Re: smd_gallery: super-flexible gallery generator

Bloke wrote:

I’m not sure why sometimes the fullsize images don’t appear — I just get the ‘x’ in the middle of the screen — but by clicking the thumbnail again the pic zooms in properly. I think it’s a problem with FancyZoom itself (or my Firefox/Win) because it does it to me on the demo page as well. Only occasionally, and seemingly randomly.

One of those is caused by at pageload:

As far I can see, the plugin uses onLoad. So it doesn’t wait or doesn’t act like it should – it just loads onLoad. It should load corretly not like it loads currently: incorrectly. It can be easily fixed by using jquery ($(document).ready(function()) or by fixing the loading.

Second one is possibly caused by almost same kind of thing. The script doesn’t preload (wait for) images before the efects come up – the efect is just stoned – or it can be that i have missed something… but it looks like that.

Last edited by Gocom (2008-03-15 16:12:20)

Offline

#16 2008-03-17 13:37:04

secundar
New Member
From: Pittsburgh
Registered: 2004-06-02
Posts: 8
Website

Re: smd_gallery: super-flexible gallery generator

Are there any examples for reading images from a directory? I’m receiving this error…

Tag error: <txp:smd_gallery directory="/images/gwar" match="JPG" form="gallery2" thumbsize="128," debug ="4" /> ->  Notice: Undefined variable: randsort  on line 205

Offline

#17 2008-03-17 15:18:53

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

Re: smd_gallery: super-flexible gallery generator

secundar wrote:

Are there any examples for reading images from a directory?

Err, currently no, sorry. But that error is just a warning due to me forgetting to set something in directory mode. When you put your site to Live it’ll disappear, but I will fix it in the next release. Thanks for letting me know.

My guess at the reason your directory version isn’t working is because of the way directories work in web land. If you specified the full server path to your images it’d work (e.g. /home/secundar/www/my_site/images/gwar). If your host has allowed fopen_url support you should also be able to specify the directory with the full URL as http://my_site.com/images/gwar. Unfortunately I am unable to test this because my hoster doesn’t allow it. Grrrr.

If you have asy_wondertag installed you may also be able to wrap it round smd_gallery and use: directory="<txp:site_url />images/gwar".

I’d be very interested in your experiences and whether it works because it’s almost totally untested at the moment. I threw it in the code because I thought it might be useful one day.

Sorry I can’t be of much more help right now but if you have any more problems with it, please let me know the details and I’ll try and fix the code based on your error messages and feedback. If you do get it working and would like to let me know how you got it going (tag/form etc) I can add it to the help file as an example too.

btw, is that ‘gwar’ as in the mad thrash metal band of the late 80s? ROCK :-)


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

#18 2008-03-17 16:13:47

secundar
New Member
From: Pittsburgh
Registered: 2004-06-02
Posts: 8
Website

Re: smd_gallery: super-flexible gallery generator

Thanks Stef,

I changed the site to Live and here’s what i get:

Fatal error: Call to undefined function smd_split() in /var/www/textpattern/lib/txplib_misc.php(574) : eval()'d code on line 258

Yes, it is the Gwar you speak of! I’ve got quite a few images I need to get up in a gallery so it looks like I’ll have to get them into the image tab to move forward today… And thanks for your plugin — very nice, and I’ll look forward to being able to use directories.

Cheers!

Offline

#19 2008-03-17 16:44:12

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

Re: smd_gallery: super-flexible gallery generator

secundar wrote:

Call to undefined function smd_split()

D’oh! Missed that one. Fix for that and the other warning is in v0.32 [ compressed ]

It’s just occurred to me looking through the code that I have not implemented sorting in directory mode either yet. I’ve added it to the ToDo list and when I get some feedback on how well (or not) the facility works I’ll expand its features. Thanks for being patient in these early stages.

Yes, it is the Gwar you speak of!

Sweeeeet. All hail the mighty GWAR and their unique brand of screaming vocals. And flinging dubious things into the crowd. Never made it to a gig but my friend at school said they were great.


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

#20 2008-03-17 17:57:58

secundar
New Member
From: Pittsburgh
Registered: 2004-06-02
Posts: 8
Website

Re: smd_gallery: super-flexible gallery generator

Ok, I gave it one last try with asy_wondertag as you recommended:

<txp:asy_wondertag><txp:smd_gallery directory="<txp:site_url />images/gwar"  form="gallery2" pageform="gallerypage"  limit="20" thumbsize="128," /></txp:asy_wondertag>

But it does not render the gallery images, nor does it give an error. The tag simply doesn’t like directory=“http://…” or directory=”/images/…”. Using the complete path on the server rendered the proper html but my server will not display images referenced like so: /var/www/images/gwar/…

I can continue testing if you can give me some tips but I’ll also need to continue setting up my pagination using the images I’ve added to the images tab. EDIT: I guess I didn’t quite understand pagination from the start: What I want to do is present the thumbnail index, then, clicking on a thumbnail will bring up a page (no popup) with the full-size image, with next and previous navigation below.

I hope I’m making sense. I don’t do much web design these days so I’m a little rusty.

Last edited by secundar (2008-03-17 18:11:20)

Offline

Board footer

Powered by FluxBB