Take a whole industry kit for a new site, or only the parts you need for the site you have. You tick what you want, and nothing else changes.
Industry kits come with Leitvia Pro. Building blocks are part of Leitvia Studio, which is free: add-ons and your own plugins can offer them too.
What a kit is
A kit is everything a site of one line of business needs: content types for its services, people or dates, sections that show them, sample entries, colors and fonts, header, footer, navigation and pages. Leitvia Pro has eight kits: SaaS, law firm, trades, health practice, restaurant, public authority, publisher and association. Each one has a live demo.
A kit has two halves. The content comes as building blocks. The look and the pages are the rest. You can take both, or only some building blocks.
Building blocks
A building block is one content feature, for example the menu of a restaurant or the projects of a builder. It brings the content type with its fields, the sections that show it on a page and sample entries. Adding a building block never touches your design, header, footer, pages or front page.
Some blocks need another one. Releases of the SaaS kit link to features, so adding Releases also sets up Features. Every kit also has a block with the details of the business, such as name, phone and opening hours, which other sections read.
| Kit | Building blocks |
|---|---|
| SaaS | Features, Integrations, Releases, Customer stories, Product details |
| Restaurant | Menu, Guest reviews, Restaurant details |
| Trades | Services, Projects, Customer reviews, Company details |
| Law firm | Practice areas, Lawyers, Legal guides, Firm details |
| Health practice | Services, Team, Practice notices, Practice details |
| Public authority | Offices, Services, Public notices, Dates, Authority details |
| Publisher | Articles and authors, Letters from readers, Publication details |
| Association | Board, Events, Membership types, Association details |
Add parts to the site you have
Open Leitvia Studio, Kits. The wizard has five steps. Each step says where you are, for example “Step 2 of 5”, and works with the keyboard.
- Choose a kit. Pick the kit and answer “New site or add to this site?” with “Add to this site”. Kits your license does not include are shown but cannot be chosen, with a link to your account.
- Content. Every building block the site does not have yet is ticked. Untick what you do not need. Each one says what it brings, and blocks the site has already are marked as set up. “Add sample entries as drafts” is on.
- Look. Colors and fonts, header, footer and navigation. Nothing is ticked, because each of them replaces what your site has. Leave them off to keep your design.
- Pages. Tick a page of the kit if you want it, for example a page with all services. A page with the same address that you have already stays as it is. “Use … as the front page” stays off.
- Summary. Studio tries your selection without writing anything and tells you what is new, what is replaced and what stays. When you only add building blocks, nothing is replaced. Choose Apply.
The result links to the new content: the list of each content type and each new page in the editor. “Add more parts” takes you back to step 2, and a second run only adds what is still missing. When you apply a kit yourself it is applied at once. The Inbox under Leitvia Studio, Agents keeps a rollback.
Build a new site
Choose “New site” in step 1. Then everything of the kit is ticked: content, colors and fonts, header, footer, navigation, all pages and the front page. Untick what you do not want. The summary names every part that will be replaced, so you see it before you choose Apply. Colors and fonts, header, footer, navigation and the front page can only be changed by an administrator.
When a section needs a building block
Kit sections are in the inserter of the editor under “Leitvia Pro” and the name of the kit. If you insert one while its building block is missing, the editor shows a notice above it, for example “This section needs the building block Features.”, with the button “Set up Features”. One click adds the building block with its sample entries, and the section shows them right away. People without the right to change the site structure see a request to ask an administrator instead.
Visitors never see such a section empty. As long as the building block is missing, the section is left out of the page.
Where the samples are
Sample entries are drafts. You find them in the admin list of their content type, for example Features. In the editor, sections show them marked “Draft” so you can see how a page will look. Visitors see only published entries. Check the samples, replace names, prices and texts with your own, then publish them. If you also took the pages of the kit, the samples are published with them, so the pages are not empty.
Show a content type on a page
Open the admin list of a content type that came with a building block. A notice at the top says “Show Features on a page” and offers two ways: “New page with this section” creates a draft page with the right section and opens it in the editor. “Insert in the editor” opens a new page with the inserter on the sections of that building block.
When Pro ends
Your content types and entries stay. They belong to the content model of Leitvia Studio, which keeps working without Pro, so you can still edit every entry. Pages, colors and fonts, header and footer stay as well. Sections you already placed keep showing on your pages. Kit sections leave the inserter, and applying kits and adding their building blocks pause.
For developers
Your own plugin can offer building blocks. Register them on leitvia_studio_init in the registry building_blocks. Patterns listed under patterns get the editor notice and stay hidden on the front end while the block is registered but not set up yet.
$studio->registry( 'building_blocks' )->register(
'my-addon/events',
array(
'title' => __( 'Events', 'my-addon' ),
'description' => __( 'Dates with venue and a list of the next events.', 'my-addon' ),
'model' => array(
'postTypes' => array(
'my_event' => array( 'label' => 'Events', 'singularLabel' => 'Event' ),
),
),
'patterns' => array( 'my-addon/events-upcoming' ),
'samples' => __DIR__ . '/content/events.json',
),
'my-addon'
);
Agents list blocks with leitvia/list-building-blocks and add one with leitvia/add-building-block (name, optional samples, default true). A recipe applies in parts: leitvia/apply-recipe takes parts, pages and buildingBlocks, and dryRun reports what would change and what would be replaced without writing anything.
POST /wp-json/wp-abilities/v1/abilities/leitvia/apply-recipe/run
{ "input": { "recipe": "my-addon/club", "parts": [ "buildingBlocks", "samples" ], "buildingBlocks": [ "my-addon/events" ], "dryRun": true } }
The field reference is in docs/extension-api.md of Leitvia Studio, sections Recipes and Building blocks. The agent skills describe both abilities in their handbook.