Help topics

Show a list of entries on a page

Add the morphic_list shortcode to a page or post to show the entries of a model. You choose the layout, the sort order, a filter and the number of entries.

Before you start

  • You need a model with entries. The examples use the model book.

Add the list to a page

  1. Open the page or post to edit it.
  2. Add a Shortcode block.
  3. Enter the shortcode:

[morphic_list model="book"]

This shows up to 10 entries as cards, in reverse order.

  1. Optional: To show a table, add layout="table". To show a plain list, add layout="list". Any other value shows cards:

[morphic_list model="book" layout="table"]

  1. Optional: To change the number of entries, add limit. Enter a number from 1 to 100. Values below 1 show 1 entry, and values above 100 show 100 entries:

[morphic_list model="book" limit="25"]

  1. Optional: To sort the list, add order with the name of a field. Add a minus sign before the name to sort in descending order:

[morphic_list model="book" order="-price"]

The sort field needs an index. Without one, the list shows an error to administrators. See No filter error.

  1. Optional: To show only some entries, add where. Enter field:value to match a value exactly. Use >, <, >= or <= for a range. Separate several conditions with commas:

[morphic_list model="book" where="price>=20"]

Each filtered field needs the Filter by this field setting turned on. Without it, the list shows an error to administrators. See No filter error.

  1. Publish the page or post.

Result

The list shows the entries in the order and layout you chose. If the model has no entries that match, the list shows the text "Nothing here yet."

Visitors see the list. If a where or order setting does not match an index, visitors see no list and no error text. Only administrators see the error.