Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Code for gallery images? 
 
sherrie
Moderator
 
Avatar
Total Posts:  1655
Joined:  2007-12-14
Waterloo, ON
 

I need to know how to pull out gallery images so that I can use them in a slideshow format similar to http://www.hotnessfactory.com/store/fragileheart and http://www.bustedtees.com/hansguitarsolo

I have the js (http://www.dhtmlgoodies.com/index.html?whichScript=image_slideshow) and everything in place, I just need to know how to call the images through the php.  I would like to be able to pull individually any that are not checked as “Excluded” so that I can use a different graphic for the tab like in the attached image.

Any ideas?

My file currently looks like this

<?php $_product $this->getProduct() ?>
<?php 
if (count($this->getGalleryImages()) > 0): ?>

<div class="custom_gallery">
  <
div class="custom_gallery_main">
    <
div id="previewPane"> <img src="<?php echo $this->helper('catalog/image')->init($_product, 'image'); ?>" /> </div>
    <
div id="galleryContainer">
      <
div id="theImages">
        <!-- 
Thumbnails -->
        
<?php foreach ($this->getGalleryImages() as $_image): ?>
        
<a href="#" onclick="showPreview('<?php echo $this->helper('catalog/image')->init($_product, 'image'); ?>',this);return false;"><img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile()); ?>" alt="<?php echo $this->htmlEscape($_image->getLabel()) ?>" title="<?php echo $this->htmlEscape($_image->getLabel()) ?>"/></a>
        
<?php endforeach; ?>
        
<!-- End thumbnails -->
        <
div id="slideEnd"></div>
      </
div>
    </
div>
  </
div>
</
div>
<?php endif; ?>
<script type="text/javascript" src="<?php echo $this->getUrl('js/slideshow/image-slideshow.js') ?>"></script>
Image Attachments
gallery.jpg
 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Moderator
 
Avatar
Total Posts:  1655
Joined:  2007-12-14
Waterloo, ON
 

Anyone have any ideas? I feel like this shouldn’t be that complex ...

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Moderator
 
Avatar
Total Posts:  1655
Joined:  2007-12-14
Waterloo, ON
 

Ok, I’m really really close now ... I have two problems left:

1. It’s pulling the base image to start with instead of the first gallery image.
2. I need to be able to have the tab images for the thumbnails and currently it’s setup as a foreach statement so it wants to use the same tab for all of them.

This is my current code:

<?php $_product $this->getProduct() ?>
<?php 
if (count($this->getGalleryImages()) > 0): ?>

<div id="dhtmlgoodies_slideshow">
<
div id="previewPane"> <img id="image" src="<?php echo $this->helper('catalog/image')->init($_product, 'image')->resize(302); ?>" alt="<?php echo $this->htmlEscape($_product->getName()) ?>"/> </div>
<
div id="greybar">&nbsp;</div>
<
div id="galleryContainer">
  <
div id="theImages">
    <!-- 
Thumbnails -->
    
<?php foreach ($this->getGalleryImages() as $_image): ?>
    
<a href="#" onclick="showPreview('<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile()) ?>', 'gallery');return false;"><img src="<?php echo $this->getSkinUrl('images/');?>pd_minibs_01.gif" alt="<?php echo $this->htmlEscape($_image->getLabel()) ?>" title="<?php echo $this->htmlEscape($_image->getLabel()) ?>"/></a>
    
<?php endforeach; ?>
    
<!-- End thumbnails -->
    <
div id="slideEnd"></div>
  </
div>
</
div></div>
<?php endif; ?>
<script type="text/javascript" src="<?php echo $this->getUrl('js/slideshow/') ?>image-slideshow.js"></script>
 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Moderator
 
Avatar
Total Posts:  1655
Joined:  2007-12-14
Waterloo, ON
 

I’ve got the tabs resolved - all I have left is the default image now - I know the code in there is for the base image, but I can’t seem to find the right one to replace it.

 
Magento Community Magento Community
Magento Community
Magento Community
 
brankonagy
Jr. Member
 
Avatar
Total Posts:  16
Joined:  2008-05-20
Odranci, Slovenia
 
sherrie - 18 June 2008 04:13 AM

I feel like this shouldn’t be that complex ...

agreed ...

set of thumb images, enlarged on event - ajax/javascript - in reserved ‘space’ like default picture ... I can play with that

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Moderator
 
Avatar
Total Posts:  1655
Joined:  2007-12-14
Waterloo, ON
 

I actually JUST got it all figured out, but thank you!!!  Am looking forward to your email about the gallery sets though.

 
Magento Community Magento Community
Magento Community
Magento Community
 
havocware
Jr. Member
 
Avatar
Total Posts:  13
Joined:  2008-04-09
Chicago, IL
 

Hey Sherrie, hoping you could help me with my gallery mod quest.

I’ve started a post at http://www.magentocommerce.com/boards/viewthread/10715/ -> can you take a look thru when you have a min, and let me know what you think?

Thx!

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Moderator
 
Avatar
Total Posts:  1655
Joined:  2007-12-14
Waterloo, ON
 

Oops, sorry - I forgot to reply to this when I got the email notification - I just replied in your thread.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top