About this topic

  • Posted by elizabethanne 2 years ago. There are 10 posts. The latest reply is from byron.
  • This topic is resolved
  1. Hi there, sorry to bother again, I'm really hoping to get this working! I was wondering if there was any way to use PHP in the layout editor? I am working on a javascript display to update a large div based upon the clicked-upon thumbnail from the gallery and need to assign a counter to the image for navigation.

    thank you!

  2. Hey elizabethanne,

    Sorry no PHP in the layout editor at this time...I've thought about how to do it a couple of times, but haven't figured it out yet. I'm a little bit afraid of eval(); ...well, a lot afraid, actually.

    Could you use the image ID (it's an available field in custom layouts) if you're looking for something unique?

    Cheers,
    Byron

  3. hi byron! thanks again for your fast response. i tried that, but unfortunately it isn't sequential in the gallery and to do the navigation i can't figure out another way other than a javascript variable+1, variable-1 declaration. i tried a javascript loop with a setattribute for each of the images, and that works for the thumbnails clicking into the big div, but won't let me navigate from image to image, so i've hit my wall without php (as a java newbie).

    i think i might try a sql from the photosmash tables instead of the shortcode. not the best way, of course, but not sure what else might do the trick. thank you so much for being so responsive.

  4. actually, now that i have had a little while to think about it - any thoughts on me editing bwbps-layout.php and adding in some kind of shortcode to do it? does bwbps-layout loop thought each of the images? this is completely off the cuff, haven't looked at it at all.

  5. and, i promise this is my last post. i'd love to use a shortcode that references the $imgNum variable you have already for the pagination. i am going to try to work on it, but any guidance would be awesome. also, do you have a donation link? once i get this up and running i'd love to donate to your fabulous plugin.

  6. I assume you're using jQuery in your javascript since it is the most incredible thing ever...Have you considered using something like the .next() function in jQuery?

    You could set a class on one of the elements like <li class='my_navigator'> . As you guessed, the layout.php file does loop through the images, so all of the LI's would get the class. So, it would be easy to get the next li having that class by using something like: jQuery(".my_navigator").next()

    That would give you the next li sibling having the my_navigator class.

    Here's the jQuery documentation on that: http://docs.jquery.com/Traversing/next

    Donations are always appreciated...especially now that Apple's put their iPad out there ;-) Always fun to have something to save up for!

    I'll be thinking about a the use case for a sequential numbering in the layouts. Let me know a little more about what you're trying to accomplish if you don't mind.

    Thanks,
    BB

  7. naturally, that is so simple it just might work. i have lots of jquery in my site, so let me play. thanks for pointing me in a much better direction!

  8. Hope it works!

  9. got it! haven't styled it yet, but layered this on it: http://www.twospy.com/galleriffic/index.html

    functionality is working with the photosmash functions (so far anyway!). lots of work left to do but i am very hopeful. thanks byron, you rock!

  10. Welcome!

RSS feed for this topic