column
The column object is accessible in the columns/_column.plate
theme file, if it’s rendered by the {% render_content %}
tag inside the {% content_for row %}
block. Read more on how content_for
works here.
column.elements
Returns array of elements that have the column object as parent.
{{ column.elements }}
column.viewport_options
Returns an object with the column’s viewport options. De available options are:
grid
: returns the column’s grid size. Usually 1 to 12.relative_width
: returns the column’s relative width (grid / columns count). E.g. 0.25 when the grid size is 3.avg_image_width
: returns the column’s average image width for every viewport, or for a specific viewport.
Input:
{{ column.viewport_options.avg_image_width }}
Output:
[360, 354, 466, 570]
Input (call for md viewport):
Output:
If the viewport breakpoint is < 768px
it is assumed the viewport is intended for mobile devices. In this case avg_image_width
returns 360
, since most mobile devices are not wider than 360px
.