WebsiteBaker Support (2.8.x) > Bakery Shop
Force thumb size in Item Detail
svsanchez:
Hello, Bakery users, hopefully this one is easy and will be usefull to other users as well: currently, I think Bakery only allows to use a few preset sizes for the Thumbnail (from 40x40 pixels to 150x150 pixels).
I would like to force the thumbnail size ONLY in the Item Detail to be something like 400 pixels wide, so that when people click on it the lightbox shows it bigger.
How can I do this?
Ruud:
If you are using Bakery 1.6.x series, go to the modify_page_setting s.php and add on line 178
--- Code: ---$SIZES['400'] = '400x400px';
--- End code ---
When using Bakery 1.7.x series there is a config.php in the bakery directory.
--- Code: ---$default_thumb_sizes['400'] = '400x400px';
--- End code ---
(you could even remove the other sizes if you do not want those).
Be sure to save the page settings because the default setting will stay 100px after creating a new bakery page.
svsanchez:
Hello Ruud, the problem is that by doing this it will set all thumbnails to 400x400, EVEN THOSE IN THE OVERVIEW which won't look great. I only want to show the 400 pixeles wide image in the ITEM DETAILS page. Is there a way to force that thumbnail / image to the size I want? Some code in the item details page that would turn [IMAGE] to something like [IMAGE width='400'] ?
Or something like "item_detail_thumbna il_size['400'] = '400x400px'; ?
Ruud:
No, that is not possible. You cannot just "make up" new variables and functionality.
Just use css to style the thumbs in the overview to the size you want.
In the overview the image will have the class "mod_bakery_main_thu mb_f", in the detail page it will have the class "mod_bakery_item_thu mb_f".
This should do the trick:
--- Code: ---.mod_bakery_item_thumb_f { max-width: 400px; }
.mod_bakery_main_thumb_f { max-width: 150px; }
--- End code ---
svsanchez:
Hello Ruud, that sounds amazing, unfortunately I couldn't make it work as the image appears in full size instead of 400 px (see http://www.ddneuropa.com/pages/bakery/silla-mt1-11.php). I think I have to specify what you said: in the detail page the image will have the class "mod_bakery_item_thu mb_f" but I don't know how to do this.
This is what I have in the bakery item detail footer, is it here where I have to specify that class? How do I specify it?
--- Code: ---[IMAGE]
<table border="0" cellspacing="0" cellpadding="5" class="mod_bakery_item_table_f">
<tr>
<td colspan="2" align="left" valign="top"><h2 class="mod_bakery_item_title_f">[TITLE]</h2></td>
</tr>
<tr>
<td align="left" valign="top"><span class="mod_bakery_item_price_f">[TXT_PRICE]:</span></td>
<td align="left" valign="top">[CURRENCY] [PRICE]</td>
</tr>
<tr>
<td align="left" valign="top"><span class="mod_bakery_item_shipping_f">[TXT_SHIPPING]:</span></td>
<td align="left" valign="top">[CURRENCY] [SHIPPING] </td>
</tr>
<tr>
<td align="left" valign="top"><span class="mod_bakery_item_full_desc_f"><p>[TXT_FULL_DESC]:</p></span></td>
<td align="left" valign="top">[FULL_DESC]</td>
</tr>
<form action="[SHOP_URL]" method="post">
[OPTION]
<tr>
<td align="left" valign="top"> </td>
<td align="left" valign="top">
<input type="text" name="item[ITEM_ID]" class="mod_bakery_item_input_f" value="1" size="2" />
<input type="submit" name="add_to_cart" class="mod_bakery_bt_add_f" value="[ADD_TO_CART]" />
</td>
</tr>
</form>
</table>
[PREVIOUS] | <a href="[BACK]">[TXT_BACK]</a> | [NEXT]
</center>
<br />
--- End code ---
Thanks a lot!
Navigation
[0] Message Index
[#] Next page
Go to full version