Building sites

Content types and entries

Pages suit one-off content. For things that repeat with the same shape (projects, team members, products, news), define a content type: a set of fields and the taxonomies its entries can be filed under. An entry is a record holding values for those fields, not a page document, and how it looks is decided by the type's templates. That keeps data and layout apart: change the template and every entry follows.

Defining a type

Content types (in the admin's navigation; it needs the manage site permission) → New content type:

  • Name (plural) and Singular: "Projects" and "Project".
  • Path segment: the first part of every address, made from the name when left blank: projects.
  • Description: used as the listing page's description.
  • Has a listing page: serves /<type>. Off, the listing address is not found, but entries still have their own addresses.
  • Show the listing in the navigation: adds the listing after the pages in the site navigation (only with a listing page).
  • Own pages: lets individual entries have a page of their own (below).
  • Taxonomies: tick the ones its entries can be filed under.
  • Fields: each with a label, a key, a type, whether it is required, and help text shown under the input.

Keys are made from the label (Client name becomes client_name) and cannot change once a type exists, because templates refer to fields by key; labels and help text can. title, excerpt and featured_image are reserved, since every entry has those already.

Type (admin label)HoldsShown by entry-field as
text (Short text)a line of texttext
textarea (Long text)several linestext with line breaks
rich (Rich text)formatted text, cleaned on savethe formatted text
number (Number)a numberthe number
bool (Yes / no)true or falseYes or No
date (Date)a datethe date as entered
url (Web address)an addressa link
email (Email)an email addressa mailto: link
select (Choice)one of the choices you listthe choice
media (Image)a media library itemthe image
color (Colour)a coloura swatch and its value

Taxonomies and terms

A taxonomy groups entries: categories, tags, regions. Create one on the Taxonomies tab of Content types with a name, a singular and a path segment (category), and choose whether terms can nest under one another (Hierarchical: categories) or stay flat (tags). Add terms under it, each optionally "Under" another. A taxonomy can be shared by several types.

Entries

Each type gets its own tab under Content. An entry has a title, a path (under /<type>/), a Summary (used on listing cards and in search), a Featured image, the type's fields and the terms it is filed under. "Save & publish" makes it live, Unpublish takes it off the site and Delete removes it. Entries are records, not revisions: saving a published entry changes the live entry straight away. The date entry widgets show is when it was published.

Addresses

AddressShows
/<type>the listing: the newest 60 published entries (by publication date)
/<type>/<entry>one published entry
/<type>/<taxonomy>/<term>the published entries filed under that term, for taxonomies the type uses

A published page at the same address wins over the listing or entry, so keep page paths out of a type's segment. Published listings and entries are in /sitemap.xml, and entries join the site search.

How entries look

Each address is drawn by a template (see Site parts): Listing for /<type>, Single entry for an entry, Term listing for a term. Until one is published, built-in layouts are used:

  • Listing and term pages: the type or term name as a heading, links to the terms with an "All" link, and a grid of entry cards.
  • Entries: the title, the date and terms, the featured image, the summary, and every filled field as label and value pairs.

Build your own with the content widgets: entry-title, entry-meta, entry-field for each field in the order the design wants, entry-list, term-list and breadcrumbs.

Entries on other pages

An entry-list with "Show entries of" (source) set to a type shows that type's latest published entries on any page, so a home page can show the three newest projects with count: 3. A page shows one type's entries: the first widget on the page that names a source (an entry list, or a widget an extension adds) decides which, and every entry list on that page shows them. On an entry's own page or a single template, the list leaves out the entry being shown, which suits a "More projects" strip under an article.

Own pages

When a type has Own pages switched on, an entry can be switched over in Content ("Own page", then "Open its page in the builder"). Its page starts as a copy of the type's single template and is built at /admin/builder/entry/<id> with its own revisions. Entry widgets on it still show the entry's title, date and fields, which stay in Content. "Use the template instead" switches back and keeps the page in case you return to it.

Modules can define content types and create entries too; see Modules.