PDA

View Full Version : Displaying alternate photos, sometimes


lovebug
06-24-06, 06:09 AM
Hi Everyone!

This forum has been super-helpful to me in the last several weeks, but now it's time for me to ask a question.

Here's my situation:

On the PROD page, Product Display Layout, I have added javascript code to the full-sized image, which pops up a new window with an alternate picture (I learned that on this forum!) I also added text to display underneath the picture that says "Click for alternate view." (Example (http://lovebugstudios.com/mm5/merchant.mvc?Screen=PROD&Store_Code=LSO&Product_Code=WB-SQ-PS-01&Category_Code=WBK))

I quickly realized that this means that I have to "invent" primary & alternate images, even for products that don't need images, because the "Click for alternate view" displays on the page regardless of whether or not there is a photo. (Example (http://lovebugstudios.com/mm5/merchant.mvc?Screen=PROD&Store_Code=LSO&Product_Code=AO-Photo&Category_Code=AO))

So, my question is... is there a way to code this page so that it only displays the "click for alternate image" if I actually have an alternate image to display?

Here is the code snippet from the Product Display Layout Page:

<td align="center" valign="top" rowspan="5">
<mvt:if expr="NOT ISNULL l.settings:product:image">
<a href="javascript:window.open('graphics/00000001/&mvt:product:code;kit.jpg','Image','scrollbars=no,s tatus=no,width=415,height=450,titlebar=no').focus( );">

<img src="&mvt:product:image;" alt="&mvt:product:name;" border="0"></a>
<mvt:else>
&nbsp;
</mvt:if><br>
Click for alternate view
</td>

Thank you in advance!!

Vic - WolfPaw Computers
06-24-06, 06:26 AM
Create a custom product field and use it as a flag for whether or not it has additional images.

Then create a conditional to test for the value of the custom field, if greater than 0, show additional images.

In fact, you could make it a numerical value, and depending on that value, show the links for the number of extra images.

lovebug
06-25-06, 04:11 PM
Thanks Vic - that sounds like exactly what I need. For a relative neopyhte to MIVA programming, what would that look like? I mean, in that snippet of code, there's already an IF statement; would the conditional test surround the IF statement that's already there, or would I modify the current IF statement to include the new condition?

I'm going to try and see if I can figure it out on my own; I just don't want to screw it up! :)

Vic - WolfPaw Computers
06-25-06, 04:59 PM
Which is statement are you referring to?

Keep in mind you do have your 'rollback' feature in your templates if you do mess something up. Feel free to experiment.


Thanks Vic - that sounds like exactly what I need. For a relative neopyhte to MIVA programming, what would that look like? I mean, in that snippet of code, there's already an IF statement; would the conditional test surround the IF statement that's already there, or would I modify the current IF statement to include the new condition?

I'm going to try and see if I can figure it out on my own; I just don't want to screw it up! :)