5.7 Scaling and cropping image to specific size within composer
Permalink
What is the best way for an image to be scaled and cropped to a specific size within composer?
I just want my client to select an image within the composer form that will then be scaled and cropped to a size of my choosing.
Do i use thumbnails, attributes or an image block template? I have searched and haven't found a solution. It would of been easier if these options were included within the image block in composer.
Regards
Luke
I just want my client to select an image within the composer form that will then be scaled and cropped to a size of my choosing.
Do i use thumbnails, attributes or an image block template? I have searched and haven't found a solution. It would of been easier if these options were included within the image block in composer.
Regards
Luke
Thank you for clarifying this. What is the best way to include the coding on a composer page type?
I could just create a page template with the code included then use this within a page type but is there a smarter way without having to create an additional page template which seems excessive?
There may be a simple answer to this which I am just missing?
I could just create a page template with the code included then use this within a page type but is there a smarter way without having to create an additional page template which seems excessive?
There may be a simple answer to this which I am just missing?
If hardcoding it into a page template is overkill as you mentioned, you can instead create a 'Custom Template' for the image block and use the code I mentioned.
Some docs about using Custom Templates: https://www.concrete5.org/documentation/developers/5.7/working-with-...
Some docs about using Custom Templates: https://www.concrete5.org/documentation/developers/5.7/working-with-...
Thanks, it confirms what I thought maybe the answer.
This will by default scale and center your image, but you can later adjust the scaling and position of the crop by visiting the File Manager and editing the properties of your image. There will be a 'Thumbnails' option there.
Alternatively, if you just want to spit out an image that is x by y, you can do so: