Skip to content
  1. Extras
  2. PageBuilder
  3. Frontend output
  4. Snippets
  5. PageBuilderTableRows

PageBuilderTableRows snippet

Returns rows from a resource data table (manager Tables tab). Output: JSON or a Fenom chunk.

Purpose

Custom table markup in a template, widget, or chunk. Pro section data_table uses built-in chunk pagebuilder_data_table. Use this snippet when you write the markup yourself.

Where to call

Template, chunk, or another section via a snippet field. The table must exist on the same or specified resource_id.

Parameters

ParameterDefaultDescription
resource_id0Resource ID. 0 = current
table_keyemptyTable key on the resource
table_id0Database table ID instead of table_key
limit20Max rows (1–100)
returnjsonjson or chunk
tplpagebuilder_table_rowsChunk when return=chunk

Filtering and pagination

Same keys as embed tables and mgr/datatable/rows/list:

ParameterDefaultDescription
page1Page number
searchemptyRow search
filtersemptyJSON column filters
context_columnemptyColumn for context filter
use_context1Use current resource context_key in context_column
context_keyemptyExplicit context instead of current
use_utm0Add filters from UTM session
utm / utm_filtersemptyJSON UTM filters for columns

Example filters:

json
{"price": {"op": "gte", "value": "100"}}

Operators: eq, contains, in, gte, lte, between, empty, not_empty. Details: System settings → Tabular resource data.

JSON

modx
[[!PageBuilderTableRows?
  &table_key=`offices`
  &limit=`50`
]]
fenom
{'!PageBuilderTableRows' | snippet : [
  'table_key' => 'offices',
  'limit' => 50
]}

Response: JSON array of row objects (each row's data). Missing table → [].

Chunk

modx
[[!PageBuilderTableRows?
  &table_key=`offices`
  &return=`chunk`
  &tpl=`my_table_rows`
]]
fenom
{'!PageBuilderTableRows' | snippet : [
  'table_key' => 'offices',
  'return' => 'chunk',
  'tpl' => 'my_table_rows'
]}

The chunk gets Fenom variables rows (array of row data) and table (table metadata). Package chunk: pagebuilder_table_rows.

See also