Problems, need help? Have a tip or advice? Post it here.
5 posts Page 1 of 1
Hi there,

I have run into a small issue which i hope you could help with.

I have two images types that need uploading for each product but are required in the same tag.

For example:

I have one product image which is sized 100x300 and another product image sized 200x300 which equals two types of products which belong to the same product type. One being portrait and another product being landscape.

Is there a way to select a field that would allow me to select the image type and output the correct sizing as per the above example.

Kind Regards
Alex
Hi Alex,

Apologies but couldn't understand the problem completely.
I have two images types that need uploading for each product but are required in the same tag.
Which tag?

Could you please explain the problem a bit more? Posting some rough mockups of what you want would be very helpful too.

Thanks.
Hi KK,

Sorry i have not explained very well.

I have created a editable tag for a static product item and the product has two image sizes that can be used. I would like to know if there is a way to use two different images sizes in one editable tag.

Code: Select all
<cms:editable 
    name='product_thumb'
    label='Product Thumb'
    crop='1'
    width='150'
    quality='100'
    show_preview='1'
    type='thumbnail'
    assoc_field='product_thumb'
    type='image'
    order='-3'/>


Code: Select all
<cms:editable 
    name='product_thumb'
    label='Product Thumb'
    crop='1'
    width='350'
    quality='100'
    show_preview='1'
    type='thumbnail'
    assoc_field='product_thumb'
    type='image'
    order='-3'/>


Notice the width of both, i would like them to belong to the same field in the admin and have a choice to select which image size i would like to use for each product.

I hope that is a better explanation

Regards
Alex
Hi Alex,

Thanks for the details. I think I understand it now :)

Unfortunately, it cannot be done the way you have envisaged.

and have a choice to select which image size i would like to use for each product.
The best way to do this would be to create two separate image regions (with the different dimensions).

While creating a product, fill only the region that has the dimension you wish for the product being edited. That is to say, each product will have only one of the two image regions filled.

On the frontend we can easily check which of the two regions has been used and output that image e.g. like this (we are assuming the two image regions are named 'product_image_150' and 'product_image_350' -
Code: Select all
<cms:if product_image_150 >
   <cms:show product_image_150 />
<cms:else />
   <cms:show product_image_350 />
</cms:if>

Hope this helps.

P.S. the definitions of the regions you posted in your last message are a little messed up (I think it was inadvertent) - the same region is defined as both 'image' as well as 'thumbnail'
<cms:editable
name='product_thumb'
label='Product Thumb'
crop='1'
width='150'
quality='100'
show_preview='1'
type='thumbnail'
assoc_field='product_thumb'
type='image'
order='-3'/>
KK,

Thank so much for the support, i really need to start paying attention to the else and if statements

Thank you again.

Alex
5 posts Page 1 of 1