UNSOLVED - Can't Get Galleries To Work On Chyrp

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

UNSOLVED - Can't Get Galleries To Work On Chyrp

Kasim
This post was updated on .
I installed the Shadowbox module for Chyrp and have spent the last few hours trying to get a gallery to work. I haven't had the slightest bit of luck. What I did notice, however, is that when I post a link with rel="shadowbox[NAME]", I only see rel="shadowbox" in Chrome's Developer Tools. Could this be just an issue with Chyrp? If so, is there anyway I can fix it?

If you need to see it yourself, please go to my website: http://kasimahmic.koding.com/blog/ and login with this account:

Username: Testing
Password: password

It'll let you see the post that I'm having trouble with.
Reply | Threaded
Open this post in threaded view
|

Re: Can't Get Galleries To Work On Chyrp

Kasim
OK so I managed to figure something out. This code in shadowbox.php seems to be causing my problem:

                $("#content img").each(function(e){
                    var a = $(this).parent();
                    if (a.attr("class")!="liked" && a.attr("class")!="like")
                       a.attr("rel","shadowbox");
                });

Since those lines set the rel attribute of the links to shadowbox, I can't change it by simply adding rel="shadowbox[NAME]" in the HTML. Is there anyway that I can target only single images here and then write the HTML myself for galleries?
Reply | Threaded
Open this post in threaded view
|

Re: Can't Get Galleries To Work On Chyrp

Kasim
In reply to this post by Kasim
OK So I managed to get somewhat fixed but it's not good enough.

                    $("#content img").each(function(e){
                        var a = $(this).parent();
                        var b = a.attr("class");
                       
                        if ( a.hasClass("GTA") ) {
                            a.attr("rel","shadowbox[" + b + "]")
                        } else {
                            a.attr("rel","shadowbox");
                        }
                    });

This script detects if an element has the class GTA and if it does, it adds rel="shadowbox[ that class ] to the link. Now, how would I make this work so that it detects any and all classes rather than just GTA?