Home/Template tagsEvery block below has its own preview zone, cut to how that tag is really used — it follows your parameters, and region previews load when you click Preview.
Content Listcontent_listUsed inside componentsiFetches a list of content items for one model. This is the most used tag: news, product, and case lists all rely on it.PreviewDetails →
scene · List blockcontext: a batch of rows (5)New windowRefreshing…
Where the implementation reads it core/Content.php:268
Filters such as category, category_slug, category_in, keyword, exclude, flag and lang sit on the same level. For paging use content_query() plus pager(), do not compute pages here.
rows 5 → 5 | length 3180 → 3180 bytes
Content Cards (one line)content_cardsiFetches a batch of rows and sets the items per row in one line: internally it equals content_list plus a card component that really exists.PreviewDetails →
scene · List blockcontext: a batch of rows (5)New windowRefreshing…
This is what content_cards itself renders: 5 rows (the card look comes from the card component; the items per row come from the columns parameter of this tag)
A convenience wrapper: the preview renders the tag itself (content_list + the card component), and columns decides the items per row.
What you change most on this tagContent cards (one line does it all): the column count (columns) is this tag own parameter, written into the tag call, not into the host component CSS. Also the card component and the row count.
columns (items per row, tag parameter)columnscolumnsdefault 32 to 6 is the usual range; omit it to add no grid styles and let the card component lay itself out
This is a parameter of the tag itself, not host component CSS: put it in the columns field of the parameter form above, or copy the line below. It only sets the grid columns of the outer container; the card look still belongs to the card component.
Where the implementation reads it core/Content.php:291
Do not mix up the two paths: this tag column count is the tag parameter columns (it only writes one grid-template-columns onto the outer container, the card look is untouched); content_list and content_query are pure data tags with no column parameter, so their items-per-row can only be changed in the host component CSS.
rows 5 → 5 | length 4963 → 4963 bytes
Content Blockcontent_blockiRenders one content block component (the orchestrated kind from the component library in the admin) by its code.PreviewDetails →
scene · Layoutcontext: none neededNew windowRefreshing…
A new 2-4 person family camping tent with cotton-blend fabric, UPF50+ protection, Level 4 water resistance and…
What you change most on this tagContent block: pick a component to render it, handing over the model and the row count. What you change most is the component, the model and the row count.
Where the implementation reads it core/Content.php:291
Every key except model is passed to the component as its config; which keys the component reads is defined by its own config_schema, not here.
rows 1 → 1 | length 5569 → 5569 bytes
Render Componentrender_componentUsed in page templatesiRenders any component by code and lets you pass data into it (lower level than content_block).PreviewDetails →
scene · Layoutcontext: none neededNew windowRefreshing…
render_component()
↓ This block is what render_component() produced
Outdoor gear & camping equipment
Genhike Sports is based in Weihai, Shandong, specializing in inflatable tents, quick-opening tents and air mattresses.
What you change most on this tagRender one component from the component library: what you change most is the component code; pass row data through the third argument.
Component codecodetext
<?= render_component('list-content') ?>
Where the implementation reads it core/tpl_blocks.php:131
Extra template variables (for example hand the current row to a card)datatextdefault []
Where the implementation reads it core/tpl_blocks.php:131
The second argument is the component config; its keys come from that component config_schema, so look at the component in the library, not at this tag.
rows 1 → 1 | length 957 → 957 bytes
Common snippets
Whole blocks you can copy in one click.
Page shell
The skeleton every page template needs: head, header, main, footer and scripts.
Use field($item, 'name'). Custom fields work exactly like built-in ones: once the field exists in the admin you can read it. Wrap the output in e(), otherwise user input can turn into executable script.
Why does my pagination do nothing?
A list page needs content_query(), not content_list(): only the former returns a paginator, which you hand to pager(). Use content_list() when you want a fixed number of items and no paging (its limit caps at 100).
Will Chinese text leak into the English site?
The tag table has an English overlay (core/tpl_tags_en.php) and the English site reads that one, so both languages are complete here. In your own templates keep copy in the language pack or t(); hard-coded Chinese is served as-is on the English site.
How do I limit a list to one category without its children?
content_list(['category' => 12, 'category_in' => true]): category takes a **numeric category id** only, and without category_in you get **that category alone, no children**; pass 'category_in' => true explicitly to include subcategories. If all you have is a slug such as news, do not put it in category (it becomes 0 and you get a silently empty list) — use category_slug instead.
How do I filter by top / featured flags?
Use the flag parameter: top, recommend or hot. The default order already puts pinned items first; use order (whitelisted field names such as id desc or views desc) to change it.
Which tags exist, and how do I know they match the core?
This list is not hand-copied: it is scanned from the core template API surface (core/tpl_functions.php, core/tpl_blocks.php), so a tag added in code but missing here fails the check. After changes run php cli/check-tags.php: it verifies that every tag in code is documented, that every documented tag exists, and that the front-end page renders them all.