The [[!Gallery3xMixed]] snippet outputs the images and videos of one resource together — as one list or by group. The default chunk is written in Fenom, so pdoTools is required.
Parameters
| Parameter | Default | Description |
|---|---|---|
| &resource | current resource | Resource ID. |
| &groupBy | group | Grouping field (group — by groups; an image with several groups goes into each). Empty — no grouping. Items without a group go to “Без группы” (“No group”). |
| &mixOrder | 1 | 1 — images and videos in one order by &sortby; 0 — all images first, then all videos. |
| &sortby | position | Sort field: position, createdon, id. |
| &sortdir | ASC | ASC or DESC. |
| &limit | 0 | How many items, 0 — all. |
| &offset | 0 | How many to skip from the start. |
| &showInactive | 0 | 1 — include disabled. |
| &thumbSize | small | Which image thumbnail size goes into the thumb field. |
| &source | — | Media source for the URLs (ID or name). |
| &tpl | tpl.Gallery3x.Mixed.Fenom | Output chunk. |
What the chunk receives
{$grouped}— an array “group name → items” (with&groupBy), otherwisenull.{$media}— a flat list of items (without grouping).
| Item field | Value |
|---|---|
media_type | image or video |
unique_id | img_5 / video_3 |
title | Title (for images — the “Title” field) |
thumb | Thumbnail: for images — the &thumbSize size, for videos — the cover |
url | Images — the original URL, videos — the video link |
group, position, active, special | Common fields |
| images only | name, alt, description, file, path, original_url, small_url, medium_url, big_url… |
| videos only | service, video_id, description, thumbnail_url |
Examples
[[!Gallery3xMixed]]
[[!Gallery3xMixed? &groupBy=`` &limit=`12`]]
[[!Gallery3xMixed? &mixOrder=`0` &thumbSize=`medium`]]
Your own chunk:
{* chunk tpl.mysite.mixed *}
{if $grouped is array}
{foreach $grouped as $groupName => $items}
<h2>{$groupName}</h2>
<div class="grid">
{foreach $items as $item}
{if $item.media_type == 'image'}
<a href="{$item.url}"><img src="{$item.thumb}" alt="{$item.title}"></a>
{else}
<a href="{$item.url}" target="_blank">▶ {$item.title}</a>
{/if}
{/foreach}
</div>
{/foreach}
{/if}
[[!Gallery3xMixed? &tpl=`tpl.mysite.mixed`]]