Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

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

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,250
Website GitHub

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

Offline

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

dhmax88
New 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: 11,250
Website GitHub

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

Offline

#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: 11,250
Website GitHub

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

Offline

#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: 11,250
Website GitHub

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

Offline

#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

#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

Board footer

Powered by FluxBB