Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#733 2010-07-30 00:35:37

chrisgoodhue
Member
Registered: 2010-06-06
Posts: 20

Re: smd_gallery: super-flexible gallery generator

hey bloke,
here is the site i am working on (very much in progress):
http://chrisgoodhue.com/chris

not sure if taking a look at the source will give you any clues.

one column displays thumbnails of images in the “design” category. Clicking any of them should open up the “design” lighbox. Same goes for “photography.” I’m pretty sure the jQuery is good.

Bloke wrote:

chrisgoodhue wrote:

Everything I have been reading leads me to believe the info above is right, but it is not working for me.

It is right. It’s perfect. How is it “not working”? e.g. do you see the thumbnails? Does the HTML render as you’d expect? Are the category names being put in the rel attribute as you’d expect? Does it just not popup your lightbox?

images will only open when: <a rel="fancybox" href="{url}"> <txp:thumbnail id="{id}" /> </a>

In which case, my guess is that your jQuery start script needs modifying. Since you don’t have any classes defined, how are you initiating the lightboxes? You need to make sure you are targetting all your images. Wrapping them in a div and using $("myDiv a").fancybox(); should work (inside the usual DOM ready jQuery call).

Note that since you have no wrapper attributes, your galleries will be modged up together. You can combat this — and in fact make your page more efficent — by only using one smd_gallery tag, like this:

<txp:smd_gallery category="design, photography"
     sublevel="all" form="gal_a" wraptag="div"
     onchange="category_title" onchangewraptag="h3"
     sort="category" />

That’ll shove an h3 tag between each gallery, with the category title as its heading. You just lose the random sort within the categories. If that’s important to you then by all means stick with two tags.

Offline

#734 2010-07-30 08:03:38

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

Re: smd_gallery: super-flexible gallery generator

chrisgoodhue wrote:

one column displays thumbnails of images in the “design” category. Clicking any of them should open up the “design” lighbox. Same goes for “photography.”

The lightbox pops up for me on both groups, in Firefox. The only thing that may be a bug or a feature (depending on your stance) is that you can navigate between the groups once you have popped up the lightbox. So if you want to separate them you do need to get the rel="fancybox-{category}" thing working (assumption: that you have assigned the images to separate Image categories!)

What am I missing regarding what you expect vs what you’re seeing?


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

#735 2010-07-30 14:28:47

chrisgoodhue
Member
Registered: 2010-06-06
Posts: 20

Re: smd_gallery: super-flexible gallery generator

hi bloke,

the lightbox is working because currently i have rel=“fancybox” in place instead of rel“fancybox-{category}

when i use rel=“fancybox-{category}” i don’t have any response from the lightbox. the images are assigned to specific categories. this is the weirdest thing.

Offline

#736 2010-07-30 14:41:45

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

Re: smd_gallery: super-flexible gallery generator

chrisgoodhue wrote:

when i use rel=“fancybox-{category}” i don’t have any response from the lightbox.

That’s very strange indeed. When you add rel="fancybox-{category}" to your site and refresh the page, what does TXP spit out in the image/anchor tags HTML?

Long shot: does it work with rel="fancybox_{category}" or, since you’re using two smd_gallery tags, hard-code this into one: rel="fancybox-design" and this into the other: rel="fancybox-photography".

EDIT: what versions of smd_lib/smd_gallery are you using?

Last edited by Bloke (2010-07-30 14:42:39)


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

#737 2010-07-30 15:28:42

chrisgoodhue
Member
Registered: 2010-06-06
Posts: 20

Re: smd_gallery: super-flexible gallery generator

this is what txp spits out, which i’m assuming is what’s supposed to happen:

<a rel=“fancybox-photography” href=“http://chrisgoodhue.com/chris/images/12.jpg” title=“PHOTOGRAPHY: “>
<img src=“http://chrisgoodhue.com/chris/images/12t.jpg” alt=”“ width=“263” height=“150” /> </a>

i’m using version 0.62 of smd_gallery and .036 of smd_lib

Offline

#738 2010-07-30 15:36:35

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

Re: smd_gallery: super-flexible gallery generator

chrisgoodhue wrote:

this is what txp spits out, <snip>

Yup, perfect. But you need to update your jQuery start script as I mentioned a few posts ago. You’re currently doing this:

$("a[rel=fancybox]").fancybox({
...
});

which won’t match when you are using fancybox-something :o) You need to find some other way of starting your fancybox script off; either explicitly starting two of them:

$("a[rel=fancybox-design], a[rel=fancybox-photography]").fancybox({
...
});

Or by adding a class to all your anchors in the gallery Form and using:

$(".imgclass").fancybox({
...
});

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

#739 2010-07-30 16:02:19

chrisgoodhue
Member
Registered: 2010-06-06
Posts: 20

Re: smd_gallery: super-flexible gallery generator

that did the trick!!

thanks so much for your help. i’ve learned a lot

Offline

#740 2010-08-05 11:29:36

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

Re: smd_gallery: super-flexible gallery generator

my aim is quite similar to chrisgoodhue, but i’m using shadowbox and i want to wrap the whole code into smd_gallery tags

my template:

<txp:smd_gallery category="linnud" thumbsize="100">
   <a rel="shadowbox" href="{url}"
     title="{caption}">
 <txp:thumbnail id="{id}" />
</a>
</txp:smd_gallery>

almost get to work beside thumbsize=“100” and next/previous links won’t appear below of large images.
what’s wrong in my code?

Offline

#741 2010-08-05 13:52:04

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

Re: smd_gallery: super-flexible gallery generator

Gallex wrote:

next/previous links won’t appear below of large images.
what’s wrong in my code?

ok, this one i get to work – needed to use square brackets

<txp:smd_gallery thumbsize="100">
   <a rel="shadowbox[linnud]" href="{url}"
     title="{caption}">
<txp:thumbnail id="{id}" />
 </a>

but this thumbsize staff….

Offline

#742 2010-08-06 09:55:23

Bijay
Member
Registered: 2010-07-02
Posts: 17

Re: smd_gallery: super-flexible gallery generator

Hi Bloke .. i have used an smd_gallery plugins.. On my “slidebar” form i have used this code…

 <script type="text/javascript">
myShow1 = new Slideshow("slideshow1",
  { hu: "<txp:site_url />images/",
    images: [{imglist}],
    captions: [{alt}],
    classes: ["prev","next","active"],
    type: "fade"
  });
</script>

But i didn’t get the result. it shows “myShow1” error when i turn on firebug..
So can you tell me how should i solve this problem and make plugin to work..
thanx

Offline

#743 2010-08-06 10:22:16

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

Re: smd_gallery: super-flexible gallery generator

this is the page i’m working

i would ike to display only first image from both albums. and here is code i’m using:

page:

<txp:smd_gallery category="linnud, eksponaadid" form="shadowbox" thumblimit="1" thumbsize="380,300" onchange="category_title" onchangewraptag="h3" grouptag="div" groupclass="pildid" />

form:

{onchange:category_title}
{grouptagstart}
<a rel="shadowbox[category]" href="{url}" title="{caption}">
{object}
</a>
{grouptagend}

everything ok, but it doesn’t recognize the image category correctly. it outputs same images in both albums

the html output

<a rel="shadowbox[category]" href="http://www.hm-kodulehed.ee/images/44.jpg" title="Hallpea-rähn">
<img src="http://www.hm-kodulehed.ee/images/44t.jpg" alt="emaslind männioksal" width="380" height="300" />
</a>

but should be

<a rel="shadowbox[linnud]" href="http://www.hm-kodulehed.ee/images/44.jpg" title="Hallpea-rähn">
<img src="http://www.hm-kodulehed.ee/images/44t.jpg" alt="emaslind männioksal" width="380" height="300" />
</a>

any ideas what could be wrong in my code?

Offline

#744 2010-08-07 08:54:38

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

Re: smd_gallery: super-flexible gallery generator

switched to slimbox2 and get it work propely

Offline

Board footer

Powered by FluxBB