Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#853 2011-09-01 16:56:01

renobird
Member
From: Gainesville, Florida
Registered: 2005-03-02
Posts: 786
Website

Re: smd_gallery: super-flexible gallery generator

doh!

Beat me to it Stef.

:)

Offline

#854 2011-09-01 16:58:52

renobird
Member
From: Gainesville, Florida
Registered: 2005-03-02
Posts: 786
Website

Re: smd_gallery: super-flexible gallery generator

Will that parse correctly? or does he need single quotes like so:

<a href='<txp:custom_field name="article_image" />'><img src='<txp:custom_field name="article_image" />' width="179" /></a>

I can’t remember if that’s still necessary — just a habit at this point.

Offline

#855 2011-09-01 17:04:53

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

Re: smd_gallery: super-flexible gallery generator

renobird wrote:

Will that parse correctly?

Should do — it’s not a Txp tag-in-tag so the single quotes shouldn’t be necessary. Won’t hurt though and, if using it directly in an article then Textile might get confused with all the double quotes so some kind of remedial ‘turn-off-textile-processing-here’ may be required.


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

#856 2011-09-01 19:20:54

drudog
Member
Registered: 2011-02-01
Posts: 20

Re: smd_gallery: super-flexible gallery generator

Whoa. Quick draw McGraw!

Thanks a million, gents!

Offline

#857 2011-10-04 13:52:25

pafruu
Member
From: New Brunswick, Canada
Registered: 2010-01-14
Posts: 65

Re: smd_gallery: super-flexible gallery generator

Yep, me again,

I am trying to create a gallery where on the right we have a list of thumbnail listed from the same category. When clicking on the thumbnail, the placeholder on the left shows us a bigger image of that thumbnail. And if you want to see a full size image, click on the placeholder and you get the lightbox effect with a full view image.

Right now what I have is the article image as placeholder, a list of thumbnail where when you click on them, the lightbox effect shows up.

Here is the code

This is the article form named galle :

<a href="{url}" onmousedown="document.getElementById('fullsize').src = this.href; return false;" rel="lightbox-smd"> 
<img src="{thumburl}" alt="{alt}" />
</a>

and the ouput form that calls to it:

<div style="float:left;padding-right:10px;"><txp:article_image html_id="fullsize" thumbnail="0" width="480" height="360" /></div><txp:smd_gallery category='<txp:custom_field name="image gallery" />' form="galle" break="div" breakclass="galPict" wraptag="div" class="galList" />

how can I achieve the effect that I want?

edit:

I actually found a way to get the thumbnails to show in placeholder after a click with this:

<img src="{url}" alt="{alt}" onmousedown="document.getElementById('fullsize').src = this.src;" width="100" height="80">

now the only thing that is left for me to figure out is to have the lightbox show after clicking on the placeholder with the respective image

Last edited by pafruu (2011-10-04 18:03:33)


I try, and I try, and I try…. and sometimes I achieve

Offline

#858 2011-10-06 14:38:57

pafruu
Member
From: New Brunswick, Canada
Registered: 2010-01-14
Posts: 65

Re: smd_gallery: super-flexible gallery generator

ok After a lot of research I kinda made it work.

Here is how:

first in the header part of the page I put this code:

<script type="text/javascript">
 function swaphref(imagehref) {
var image = document.getElementById('imager');
image.setAttribute('href', image.src);
document.getElementById('imagehref').setAttribute('href', image.src);
//window.alert(document.getElementById('imager').src);
//window.alert(document.getElementById('imagehref').href);
}
</script>

then in my output form I type in this code:

<div style="float:left;padding-right:10px"><txp:smd_gallery limit="1" id="?article_image" category='<txp:custom_field name="image gallery" />'><a href="#" id="imagehref"     onclick="swaphref(this)"  rel="lightbox-smd" ><txp:article_image thumbnail="0" width="480" height="360" html_id="imager" /></a></txp:smd_gallery></div>
<txp:smd_gallery category='<txp:custom_field name="image gallery" />' form="galle" break="div" breakclass="galPict" wraptag="div" class="galList" />

works like a charm the only thing that I need to figure out now is how to make the fullsize images scroll from one onto the other with the next and previous links.

Any ideas for that?

Last edited by pafruu (2011-10-06 14:48:32)


I try, and I try, and I try…. and sometimes I achieve

Offline

#859 2011-11-24 13:19:11

Gallex
Member
Registered: 2006-10-08
Posts: 1,308

Re: smd_gallery: super-flexible gallery generator

can’t figure out why it recreats the albums after adding some new images into existing album? the page
i think, i need to change something in a onchange attribute, but what? could anybody help me?

my page:

<txp:smd_gallery category="!header, !kuelavilla-header, !site-design, !content" sort="date desc" thumblimit="5" thumbsize=" ,60" onchange="category_title" onchangewraptag="h3" grouptag="div" groupclass="pildid">
{grouptagstart}
{onchange:category_title}
<a rel="lightbox-{category}" href="{url}" title="{caption}">
{object}
</a>
{grouptagend}
</txp:smd_gallery>

Last edited by Gallex (2011-11-24 14:38:10)

Offline

#860 2011-11-24 17:45:39

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,743
Website

Re: smd_gallery: super-flexible gallery generator

only had a quick look so could be wrong, but take a look at your sort attribute: it looks like you need to sort by category first, then date.


TXP Builders – finely-crafted code, design and txp

Offline

#861 2011-11-25 08:07:14

Gallex
Member
Registered: 2006-10-08
Posts: 1,308

Re: smd_gallery: super-flexible gallery generator

that was it! thank you jakob!

Offline

#862 2011-11-25 18:52:11

pafruu
Member
From: New Brunswick, Canada
Registered: 2010-01-14
Posts: 65

Re: smd_gallery: super-flexible gallery generator

hello guys,

great plugin as always although I am at a loss here.

I am showing my thumbnail for the gallery and when clicked the java is happening for height but not for the width of the image. As seen here:

http://armorfarm.com/diorama_products/9/forest-litter

At first, I commented out some javascript that I thought would be conflicting with the script but that wasnt it, then I checked the css files to see if anything was specified there, again nothing.

What am I missing?

forgot to mention that when I click on the next image link, then the image is properly displayed.

Last edited by pafruu (2011-11-25 19:36:20)


I try, and I try, and I try…. and sometimes I achieve

Offline

#863 2011-12-07 12:54:54

Gallex
Member
Registered: 2006-10-08
Posts: 1,308

Re: smd_gallery: super-flexible gallery generator

right now my albums launch from the single thumbnail, but is it possible to launch albums from the album’s title (from h6 in my example page)?

my code:

<txp:smd_gallery category="!header, !kuelavilla-header, !site-design, !content" sort="category date desc" thumblimit="1" thumbsize="70" onchange="category_title" onchangewraptag="h6" grouptag="div" groupclass="pildid">
{grouptagstart}
{onchange:category_title}
<a rel="lightbox-{category}" href="{url}" title="{caption}">
{object}
</a>
{grouptagend}
</txp:smd_gallery>

here is my example gallery

i would like to create album’s list without any thumbnails there, just album’s title list

Offline

#864 2011-12-07 13:12:34

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

Re: smd_gallery: super-flexible gallery generator

Gallex wrote:

is it possible to launch albums from the album’s title (from h6 in my example page)?

Investigate smd_gallery’s text attribute and put the contents of the h6 in there. That should do what you want.

EDIT: scratch that, use objectform instead and put the h6 inside that nominated form. I missed the fact you’re launching more than one gallery.

Last edited by Bloke (2011-12-07 13:15:23)


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

Board footer

Powered by FluxBB