Your services, posts and partners reach your site through pages with a template: a page whose Template says which content it shows. This guide covers the pages your site starts with, what each kind of template does, how to bring the default pages back, and where categories and custom fields come in. Editing a page's code is covered in Pages and layouts.
The pages your site starts with
When your team is created, your site gets these pages. They appear under Pages a few moments later:
| Page | Address on your site | Template | What it shows |
|---|---|---|---|
| Services | services | Service List | Every active service, with its name, the start of its description and a «Ver más» link to its page. |
| Service Detail | services/ followed by the service's slug | Service Detail | One service: its first picture, name, category, how long ago it was created, every picture, and its description. |
| Posts | posts | Post List | Every active post, with its title, its category, the start of its content and a «Ver más» link to its page. |
| Post Detail | posts/ followed by the post's slug | Post Detail | One post: its first picture, title, category, how long ago it was published, every picture, and its content. |
| Partners | partners | Partner List | Every active partner, with their name, job, category and description, each card linking to their page. |
| Parter Detail | partners/ followed by the partner's slug | Partner Detail | One partner: their first picture, name, job, category, every picture, and their description. |
Your site also starts with a home page, a contact page with its form, a sample categories page and the layout. The texts of the default pages, such as «Nuestros servicios» or «Ver más», are in Spanish: change them in each page's code.
While your team has no pages of its own, or your plan does not include pages, your site shows these same default pages, so your services, posts and partners are visible from the first day.
Offices have no default page and no template. See Offices.
The three kinds of template
Choose the template in the Template field of a page.
List
Service List, Post List and Partner List mark the page that lists that content. The template gives the page nothing by itself: the page's own code reads your active items, as the default pages do. Its address is whatever you choose.
Detail
Service Detail, Post Detail and Partner Detail show one item. The page's address must contain the item's slug as a pattern, such as services/{slug}: a visitor who opens services/consulting sees the service whose slug is consulting, and an address whose slug matches nothing answers that the page does not exist. If you set an address without the pattern, it is replaced with the default one when you save.
Every link to an item on your site — the «Ver más» of the list pages, for example — leads to the detail page of its kind. Without an active detail page, those links go nowhere.
A detail page opens for any item whose slug is in the address, active or not. Switching an item off takes it out of the list pages, but someone who has its address can still open it.
Category
Service Category, Post Category and Partner Category show the items of one category. Your site does not start with these pages: create one, choose the template, and its address becomes categories/services/{?slug} (or posts, or partners). The page receives the categories of that content, the category in the address, and the active items of that category and of its subcategories, twenty per page; without a category in the address it receives every active item. What it shows is up to its code. See Template types and categories.
Bring the default pages back
A super administrator of the product sees Restore Pages on the Pages screen. It writes the default pages into your team again:
- Each of your pages whose title is the same as a default page's, such as Services or Post Detail, is replaced by the default one, code and address included.
- Your layout with the address layout is replaced by the default layout.
- Your other pages are left as they are. A default page you renamed is created again beside your renamed one.
The success message appears straight away; the pages are written a few moments later. Take a backup of any page you changed before asking for it, as Pages and layouts explains.
Link them from your menu
The default layout's menu does not link to your services, posts or partners. Edit the Layout page and add a link to each page you want in the menu, with the page's address, such as /services.
Categories
Services, posts and partners each have their own categories, opened with the Categories button above each list. Give an item its category in the item's form. The default post and partner lists and the three detail pages show the category's name; the default service list does not show it. A category page shows the items of one category, as described above.
Custom fields
A custom field adds your own value to every item of a content, such as the price of a service. Create it in Pages → Custom Fields and choose the content as its model; the item's form then shows its input. See Custom fields.
When you have more than one detail page for the same content, each item links to the one whose custom field values are most like the item's own. The page editor does not offer custom field values for pages yet, so today every item links to the first of those pages.
For developers
- The templates are the cases of
App\Enums\PageTemplate.Listpages use the plain handler and receive no variables;Detailpages receive$service,$postor$partner;Categorypages receive$categories,$categoryand$services,$postsor$partners. - The default pages live in
resources/views/stubs/themes/default/, one Blade file each with its title, slug and template in the opening comment.CreateDefaultPagesOnTeamswrites them when a team is created and when Restore Pages runs, matching pages by title and the layout by its slug. - A record's link is
$record->url; a page's address by template isteam()->getLink('ServiceList').