The grid_item object cannot be invoked on its own. It must be invoked inside a grid row.

It contains following attributes:


Object Fields

FieldData TypeDescription
grid_item.idNumberReturns id of the grid item.
grid_item.typeStringReturns the type of the grid item.
grid_item.titleStringReturns title of the gird item
grid_item.contentStringReturns content of the grid item
grid_item.hide_titleBooleanReturns true if title is set as hidden.
grid_item.hide_descriptionBooleanReturns true if description is set as hidden.
grid_item.columnNumberReturns index of the grid item on grid row.
grid_item.opens_in_new_tabBooleanReturns true if the grid item will open links in new tab. Used to set target of <a> HTML tag.
Remarks: only available when item enabled "Open link in new window"

grid_item.type

Returns the type of the grid item.
See the following table for possible types and their descriptions:

TypeUsage
textContains possibly a title and/or description.
imageContains image(s).
Shown with carousel if grid item has more than one images.
videoContains video link from Youtube or Vimeo. Rendered with corresponding embedded video player.
productContains one product.
productsContains a list of products from selected category.
facebookRendered with embedded iframe page plugin.
google_mapRendered with Google Maps Embed API iframe.
instagramRenders a list of posts from Instagram.
qrcodeRenders an QR code image.

範例

{% for item in row.items %}
    <div id="page-item-{{item.id}}" class="grid-{{item.type}}-item">
    {% grid_item_block %}{% end_grid_item_block %}

    {% unless item.hide_title or row.full_width %}
        <div>
            {{ item.title }}
        </div>
    {% endunless %}

    {% unless item.hide_description or row.full_width %}
        <div>
        {{ item.content }}
        </div>
    {% endunless %}
    </div>
{% endfor %}