Shortcodes, blocks and page builders
Every layout has one shortcode, [forma_grid]. Its show attribute picks the grid or one of its controls. Copy it from the top of the layout’s sidebar or from the Forma Layouts list.
| Shortcode | What it prints |
|---|---|
[forma_grid id="123"] | The grid |
[forma_grid id="123" show="filter"] | The filter |
[forma_grid id="123" show="search"] | The search field |
[forma_grid id="123" show="sort"] | The sorting |
[forma_grid id="123" show="pagination"] | The pagination |
Replace 123 with the layout’s ID. A control the layout has turned off prints nothing for visitors; editors see a short note in its place.
Controls with the grid, or anywhere on the page
- With the grid: switch on “Output search, filter, sorting and pagination with the grid” under the shortcode. The grid then prints the toolbar above it and the pagination below it. Quick for most pages and demos.
- Anywhere: leave it off and place each control’s shortcode where you want it, for example the filter in a sidebar or the search in the header. They still control the grid without reloading the page.
The same layout twice on a page
If a page shows the same layout more than once, add instance to a control’s shortcode to say which grid it controls: [forma_grid id="123" show="filter" instance="2"] controls the second one. The default is 1, the first grid.
Block editor
Add the Grid Layout block, pick the layout and what to Show: the grid, or its filter, search, sorting or pagination. The block shows a live preview in the editor. A Shortcode block with the shortcode works too.
Elementor and WPBakery
Both have a Forma element. Choose the Grid Layout and what to Show: Grid, Filter, Search, Sorting or Pagination. For a control, Grid on the page sets which of the layout’s grids it controls (1 = the first). If the layout has that part turned off, the element says so in the editor.
Editing from the site
While you are logged in, the admin bar on a page with grids has a Forma menu with a link to edit each layout on the page.