grid_item

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:

Type

Usage

text

Contains possibly a title and/or description.

image

Contains image(s).
Shown with carousel if grid item has more than one images.

video

Contains video link from Youtube or Vimeo. Rendered with corresponding embedded video player.

product

Contains one product.

products

Contains a list of products from selected category.

facebook

Rendered with embedded iframe page plugin.

google_map

Rendered with Google Maps Embed API iframe.

instagram

Renders a list of posts from Instagram.

qrcode

Renders 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 %}