Hello There,
I had a post a while ago that I was trying to display images hosted on another server and I figured out how, but it was after 5am and need to get some sleep, but I'm back to explain.
You edit the tpl_modules_main_product_image file which is located in /includes/templates/template_default/templates (after editing the file it is good practice to put the edited file in your custom template folder)
The file stock looks like this (after the credits)
PHP Code:
<?php require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_MAIN_PRODUCT_IMAGE)); ?>
<div id="productMainImage" class="centeredContent back">
<script language="javascript" type="text/javascript"><!--
document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . zen_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $_GET['products_id']) . '\\\')">' . zen_image($products_image_medium, addslashes($products_name), MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT) . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>'; ?>');
//--></script>
<noscript>
<?php
echo '<a href="' . zen_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $_GET['products_id']) . '" target="_blank">' . zen_image($products_image_medium, $products_name, MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT) . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>';
?>
</noscript>
</div>
modified to grab pictures from an external source it looks like this:
PHP Code:
<div id="productMainImage" class="centeredContent back">
<?php
echo '<img src="http://content.com/images/'.$products_model.'.jpg">';
?>
<script language="javascript" type="text/javascript"><!--
document.write('<?php echo '<a href="http://content.com/images/'.$products_model.'.jpg" target="_blank">' . zen_image($products_image_medium, addslashes($products_name), MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT) . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>'; ?>');
//--></script>
<noscript>
<?php
echo '<a href="http://content.com/images/'.$products_model.'.jpg" target="_blank">' . zen_image($products_image_medium, $products_name, MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT) . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>';
?>
</noscript>
</div>
As you can see, the file name is dynamically filled in by the model number, which can be the part number or whatever, also I could have taken out more code, but it works so I left it in.
If you have any questions, please let me know.
thank you,
Steve
Bookmarks