Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#551 2009-08-30 11:27:10

dhmax88
Member
Registered: 2009-08-30
Posts: 7

Re: smd_gallery: super-flexible gallery generator

Thanks Maniqui i was having the same problem…now to try the fix.

Last edited by dhmax88 (2009-08-30 11:32:11)

Offline

#552 2009-08-31 18:01:01

dhmax88
Member
Registered: 2009-08-30
Posts: 7

Re: smd_gallery: super-flexible gallery generator

Hi guys Im working on a site over at Rose Fay Illustrator

And i’m getting really stressed about getting smd_gallery and shadowbox to work how I want them to. Basically I have categories of images for each tab along the top of the image content. Only one of the images in the category has a thumbnail and thats what I want to be displayed at the front of each category. (the site should give you an idea of what I mean). But at the moment textpattern is trying to drag thumbnails of all the images even though they don’t exist which is fine in Firefox because they don’t show up but in safari and IE it messes up. So basically,

how do i only get textpattern to get the thumbnails which actually exist!?

Not sure what code you need but this should do :

GALLERY:

<div id="<txp:category1 />" >
<txp:smd_gallery category='<txp:category1 title="0" />'  form="gallery" thumblimit="6" />
</div>

and the gallery FORM:

<a href="{url}" title="{title}" rel="shadowbox[{category_title}]">
<txp:soo_image_select category='<txp:category1 />'>
<txp:soo_if_image_thumbnail><img class="img" src="<txp:site_url/>images/{thumbdef}" alt="{alt}" />
<txp:else /></txp:soo_if_image_thumbnail>
</txp:soo_image_select></a>

This is my last attempt trying to use soo_if_image_thumbnail…
Any idea? Thank you so much for your help in advances!

JD

Last edited by dhmax88 (2009-08-31 18:03:37)

Offline

#553 2009-08-31 18:19:10

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,468
Website

Re: smd_gallery: super-flexible gallery generator

dhmax88 wrote:

I think (a guess) that using both soo_image and smd_gallery like this is going to cause problems. You should probably choose one or the other. If you elect to use smd_gallery then you can utilise a txp:variable or smd_if and test the {hasthumb} replacement variable. For example (untested):

<a href="{url}" title="{title}" rel="shadowbox[{category_title}]">
<txp:variable name="has_thumb" value="{hasthumb}" />
<txp:if_variable name="has_thumb" value="1">
  <txp:thumbnail id="{id}" />
</txp:if_variable>
</a>

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

Online

#554 2009-08-31 18:26:47

dhmax88
Member
Registered: 2009-08-30
Posts: 7

Re: smd_gallery: super-flexible gallery generator

Incredible! Thank you so much, it works! I’ve been racking my brain for hours.

While I’m at it…is there anyway of ordering images within image categories? Or do I just need to sort my name and then rename the images? Because as you will notice when you click on a thumbnail it isn’t necessarily the first image shown in the shadowbox…

Last edited by dhmax88 (2009-08-31 18:28:39)

Offline

#555 2009-08-31 18:39:54

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,468
Website

Re: smd_gallery: super-flexible gallery generator

dhmax88 wrote:

Incredible! Thank you so much, it works!

No worries, glad it worked.

is there anyway of ordering images within image categories?

Not really. It’s either down to your naming convention or specifying a fixed list of image IDs and then using sort="fixed" I think. Someone else might have some cool ideas on sorting, though.


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

Online

#556 2009-08-31 21:17:55

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: smd_gallery: super-flexible gallery generator

Can smd_gallery now (from the beginning the 4.2.x age) output thumbnails width\height? Currently i solved this task with this php code in smd_gallery form:

<txp:php>$x=getimagesize("{thumburl}");echo $x[3];</txp:php>

Maybe this can help in some way…


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

#557 2009-08-31 21:27:20

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,468
Website

Re: smd_gallery: super-flexible gallery generator

the_ghost wrote:

Can smd_gallery now (from the beginning the 4.2.x age) output thumbnails width\height?

Not yet, but it’s on the cards along with one or two other nice features. Got a whole shedload of stuff on right now (and the new version of smd_calendar is taking priority too) but when I get a bit of free time it will be able to natively read the thumb info in the DB pretty soon.


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

Online

#558 2009-09-11 14:26:01

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

Re: smd_gallery: super-flexible gallery generator

Hi guys,

I’m implementing Aeron’s Slideshow 2 with smd_gallery (test page: http://ih.kiev.ua/en/test) and I would like each image in the slideshow to link to a different article.

My idea is to store the link in either “Alt” or “Caption” field in the image description and use it somehow like this in the gallery form:

<div id="my_show" class="slideshow"> <a href="{alt}"><img src="{imagepath#1}{imagedef#1}" alt="" /></a></div>

<script type="text/javascript"> var data = [{imagedef}]; var myShow = new Slideshow('my_show', data, {controller: true, hu: '{imagepath#1}', linked: false}); myShow.start(); </script>

However this part <a href="{alt}"> doesn’t work as it produces a comma-separated list of values.

Any ideas how to link these images to different articles properly?

Offline

#559 2009-09-11 16:48:00

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,468
Website

Re: smd_gallery: super-flexible gallery generator

Si wrote:

I would like each image in the slideshow to link to a different article.

Is this even possible in slideshow2? If it is, find out how you specify the syntax (in javscript/html) and then we’ll go from there constructing the gallery to do your bidding.

The way you have it now, you’re telling the start image to link to everything in all alt fields. Remember that collate mode only calls the form/container once after the last image has been found. I suspect we’ll end up making a hybrid solution and building our own image list using txp:variable, then outputting the javascript bit at the end (outside the form).

The other possible way is using slideshow2’s callback mechanism (or some jQuery) that changes the link around the image depending on the alt tag of the image currently being displayed.


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

Online

#560 2009-09-14 16:04:38

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

Re: smd_gallery: super-flexible gallery generator

Thanks, Stef, though it sounds more complicated than expected to a Javascript noob like me!
Apparently Slideshow 2 can only link each image to their full-sized ones, or the whole show to the link specified by the default image’s ‘href’ element.
I guess it would be easier to go with an external solution, like JD gallery or else

Offline

Board footer

Powered by FluxBB