Good morning all. :) I have a question about doing an if statement to display my product info images one way if there are additional images and another way if there are no additional images.
I have an if statement written but I have no idea what to put as the condition, or even if this will work. here is the code:
PHP Code:
<!--bof image if statement-->
<?php if(condition) { ?>
<div id="image_container">
<?php
if (zen_not_null($products_image)) {
?>
<?php
/**
* display the main product image
*/
require($template->get_template_dir('/tpl_modules_main_product_image.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_main_product_image.php'); ?>
<?php
}
?>
<!--eof Main Product Image-->
<!--bof Additional Product Images -->
<?php
/**
* display the products additional images
*/
require($template->get_template_dir('/tpl_modules_additional_images.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_additional_images.php'); ?>
<!--eof Additional Product Images -->
</div>
} else {
<div id="image_container_alone">
<?php
if (zen_not_null($products_image)) {
?>
<?php
/**
* display the main product image
*/
require($template->get_template_dir('/tpl_modules_main_product_image_alone.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_main_product_image_alone.php'); ?>
<?php
}
?>
<!--eof Main Product Image-->
</div>
<?php } ?>
<!--eof image if statement-->
So basically I made a new tpl file as seen above for the product image by itself and made the changes to the test style sheet.
So I guess my questions are:
1. will this work?
2. what do I put as my condition, where do I define it, and perhaps a tip on what to define it as?
Here are links to what I have now:
Product with additional images This layout is fine the way it is.
Product with no additional images. This is the layout in question. I want to set it up so that when there are no additional images that main picture is centered.
Thanks in advance and have a great day. :)
Kate