New Page on Thumbnail click

largelylivinlargelylivin Registered Users Posts: 561 Major grins
I've created a gallery of dummy business cards that I am showing as an allthumbs gallery style. http://smile-123.smugmug.com/gallery/3551211

I need to be able to bring-up a vendors homepage when a thumbnail is clicked on. Initially I thought I could use a gallery style redirect, but I think I would need to rewrite the redirect JS to use /photo instead of /gallery, and also figure out how to include a target parameter.

Is this a good approach? Suggestions?
Brad Newby

http://blue-dog.smugmug.com
http://smile-123.smugmug.com
http://vintage-photos.blogspot.com/

Canon 7D, 100-400L, Mongoose 3.5, hoping for a 500L real soon.

Comments

  • jfriendjfriend Registered Users Posts: 8,097 Major grins
    edited September 28, 2007
    I've created a gallery of dummy business cards that I am showing as an allthumbs gallery style. http://smile-123.smugmug.com/gallery/3551211

    I need to be able to bring-up a vendors homepage when a thumbnail is clicked on. Initially I thought I could use a gallery style redirect, but I think I would need to rewrite the redirect JS to use /photo instead of /gallery, and also figure out how to include a target parameter.

    Is this a good approach? Suggestions?

    Rather than a gallery style redirect, it's probably easier to just write some JavaScript that changes the links in the thumbs on this page.

    Conceptually, the JavaScript would do the following:
    • Check to see if the script is running on the page that you want it to be active on
    • Iterate through all the thumb images on the page (you can use the div of #photos as a container to iterate and look for A links with a class of "photo")
    • For each thumb link you find, parse the imageID out of the link and look it up in your own JavaScript table to get the URL of that customer's home page
    • Change the href on the URL to point to the customer's home page
    You would then, at this point, have a page where clicking every image took you directly to that customer's home page. To add a new customer to the page, you'd add their image to the gallery and that gallery ID and their home page URL to your JavaScript table.
    --John
    HomepagePopular
    JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
    Always include a link to your site when posting a question
  • denisegoldbergdenisegoldberg Administrators Posts: 14,385 moderator
    edited September 28, 2007
    I've created a gallery of dummy business cards that I am showing as an allthumbs gallery style. http://smile-123.smugmug.com/gallery/3551211

    I need to be able to bring-up a vendors homepage when a thumbnail is clicked on. Initially I thought I could use a gallery style redirect, but I think I would need to rewrite the redirect JS to use /photo instead of /gallery, and also figure out how to include a target parameter.

    Is this a good approach? Suggestions?
    Another option would be to use the method that Allen posted in this thread: http://www.dgrin.com/showthread.php?t=72375. Here's the link to Allen's sample gallery: http://allen-steve.smugmug.com/gallery/3539056

    It uses a table to show both thumbs and a caption, with links from both (or either) to pages that could be within smugmug or to an outside site.

    --- Denise
Sign In or Register to comment.