Image_preset

Image_preset

{{ image_preset }}

Name Type Description
object_type String Will always be datastore_item
is_valid Boolean True if this references a published image_preset
guid String The unique identifier for this image_preset
value String Contains the same value as guid
code String The unique code for this image preset
query_string String The settings for this image preset represented as a query string
extension String The extension that filenames should end with for images that use this image preset, if it may be used to change the image format
settings dictionary Contains all of the settings that this image preset will apply to images when used
field_id String The identifier for this field
label String The label for this field
output String The default output that the image_preset produces when output directly to the template, which is currently the preset code. The default output may change at any time. Template developers should avoid using this and should handle the output of image presets themselves

{% image_preset %}

{% image_preset
var|set|assign
 
Optional. Specify either "var", "set" or "assign" to change which scope this image_preset is stored on. "var" is the default behavior.
variable_name
 
Specify a variable name in order to save this image_preset to a variable. If not specified, it will be output to the template instead.
output_to_template
 
If included the image_preset will be output directly to the template.
=
%}

Examples

Image_url with presets

Copy
Template: {% image_url img_path = page.banner_image name:"home-banner" preset:"banner-size" preset:"sepia-simple" %} Output:

Image_url altered

Copy
Template: {% capture imageCode %}thumb-{{size}} border-{{bordercolor}}{% endcapture %} {% image_url img_path output_to_template = img extension:"png" preset:"transparent20" preset:"border10" imageCode %} Output: "http://domain.com/path/to/altered/img.jpg"