Generating thumbnail images
I have a need to generate a custom sized thumbnail image that isn't defined in the catalog edit page.
In other words, I have a product catalog where I provide a place to choose/upload an image file that serves as the "Main Image" for the product. This image is used in a varety of places (product list, the main product page, etc). The main reader page the size is defined in the field definition and the list pages are using the override setting in the module. However, I am setting up a secondary reader page with an alternate layout where the default size I set will not work.
Can I call the "Raw" image in the template and give it the new dimensions and make the appropriate thumbnail?
So, for example, the current code I have for displaying the image is:
Code:
<?php echo $entry['data']['product_image']['value'];?>
What would I do to override in the template the current image size and give it something specific for the new reader page? I'm not interested in having it customized per item, this would be the same for all items.
Re: Generating thumbnail images
I use this code in my template to bring in images:
You can hardcode the width and height and bring in the image stored in the tl_files folder rather than the resized image the module settings create. This may take longer to load but should work.
If you use the print_r ($this); in your template you can see the options. Think it would be something like:
Code:
[img]<?php echo $entry['data']['image'][raw]; ?>[/img]" title="<?php echo $entry['data']['name']['value']; ?>" >[img]<?php echo $entry['data']['image'][raw]; ?>[/img]" width="200" height="200" /></a>
['image'] being the field name of your image field set in the catalog
Re: Generating thumbnail images
Why not use the insert tag that automaticly resizes images on the fly?
For example:
Code:
{{image::<?php echo $entry['data']['image']['meta'][0]['src']; ?>?width=136&height=136}}
Documentation for Insert tags
Re: Generating thumbnail images
I Love you. Thank you, the Insert Tags worked perfectly.
Re: Generating thumbnail images
Well I think I will be using that in the future too.
Re: Generating thumbnail images
Now you can thank me for getting the image inserttag I created, implemented into the core... That's such a neat inserttag, right...