Publish entries as website pages
Give each entry its own page on your site. Morphic builds the address from the model's page address and the entry's slug.
Before you start
- You need the administrator role. Other users see Only administrators can change models.
- The model needs a text field, such as Slug. Create one with Add and configure fields. Without one, turning on the switch shows Add a Slug field first; it becomes the page address.
Steps
- Select Models in the side list.
- Open the model.
- Select Advanced.
- In the Website pages card, turn on the switch. Morphic fills in Address from the model name. It also adds a unique rule to the slug field.
- In Address, enter the first part of the page address, such as
articles. Morphic converts the text to a URL-friendly form. - In Page address comes from, select the field that holds the slug, such as Slug.
- Select Save changes.
Result
Each entry with a slug has a page at https://example.com/articles/<slug>/, where articles is the Address you entered. If your theme has no Morphic template for entries, the page uses the theme's own template.
Morphic also lists the entries on https://example.com/articles/, and the next pages on https://example.com/articles/page/2/.
Page addresses
- The default language uses the address without a prefix:
/articles/<slug>/. - Each other language adds its code in front:
/fr/articles/<slug>/. This applies when Polylang or WPML is active.
When the slug is empty
When an entry's slug is empty, Morphic does not show View on site for that entry under More. The address that used the slug returns a 404 page.
Morphic fills in an empty slug when you create an entry, using its title. It does not fill in a slug you clear later.