Build the whole site inside the CMS
Pages are records in a collection, and a routing middleware matches them as requests arrive. Nothing to generate, nothing to redeploy, no static build to wait on.
The Site Builder lets you build a complete frontend website inside Total CMS. A page is an object in the builder-pages collection carrying a URL route, a template name and its metadata; templates live in tcms-data/builder/, split into layouts, pages, partials and macros.
Routing, in a fixed order
No router files or PHP stubs are generated: PageRouterMiddleware runs inside T3’s request pipeline and matches URLs dynamically, in an order that protects the CMS from your URLs.
- The CMS first. Slim matches API and admin routes first, so a builder page at
/collectionscan never collide with the API at/api/collections. - Then your pages. Builder page routes (static matches, then dynamic patterns, then catch-alls), then collection URL patterns.
- Then the 404 page. If nothing matches, the page whose HTTP status is 404 renders.
Routes and pages
- Placeholders.
/products/{id}captures one segment,/blog/{category}/{slug}captures two, and/docs/{path:.*}matches across slashes. Captured values reach the template asparams.*. - A page or an object. Builder-page matches receive the page record as
page. When the URL matches a collection’s own URL instead, the template ispages/{collection-id}.twigand the record arrives asobject. - A status per page. 200, 301 and 302 with a redirect target, 404, 410, 451, or 503 for maintenance.
- Opt-in Features. They run before the template does. The built-in
authfeature sends logged-out visitors to the login page and returns 403 to logged-in users outside the access groups you listed. - Not only HTML. Give a page a route of
/robots.txtor/llms.txtand the content type is set from the extension.
Starting a site
- One command.
tcms builder:init blogcopies the starter’s layouts, pages and partials into place, creates thebuilder-pagescollection, and imports the starter’s JumpStart file: five pages and five sample posts. Visit the site and it renders. - Navigation and links.
cms.builder.nav()builds the menu from your pages, andcms.builder.url('blog-post', {id: post.id})resolves links by page id, so renaming a route rebuilds every link that points at it.
In practice
What it looks like in a template
{# tcms-data/builder/pages/blog-index.twig #}
{% extends 'layouts/default.twig' %}
{% block content %}
<h1>{{ page.title }}</h1>
{% for post in cms.collection.objects('blog') %}
<article>
<h2><a href="{{ cms.collection.objectUrl('blog', post) }}">{{ post.title }}</a></h2>
<p>{{ post.summary }}</p>
</article>
{% endfor %}
{% endblock %}
A list page reads the collection directly and links to each record through the collection’s own URL.
At a glance
What you get
- No build step
- Pages are content, matched by the router as requests arrive. Add one in the admin and it is live — nothing to regenerate or redeploy.
- Routes with placeholders
- A route like /products/{id} gives every record its own URL. Catch-alls such as /docs/{path:.*} match across slashes for documentation and file viewers.
- Start from a starter
- tcms builder:init scaffolds minimal, blog, business or portfolio — templates, the pages collection, and demo content in one command.
- Navigation builds itself
- cms.builder.nav(), subnav() and navTree() read your page list and order file. cms.builder.url() resolves a page by id, so renamed routes never leave dead links.
- Pages you can gate
- Tick the auth feature to require a login, and name the access groups allowed through. Draft pages are not routable at all.
Site Builder
Common questions
Do I have to rebuild or redeploy after adding a page?
No. There is no generation step. Page records are matched by the routing middleware at request time, so a page renders as soon as it is saved.
Can a builder page conflict with the API or the admin?
No. Slim matches routes under /api/ and /admin/ before the builder middleware ever sees the request. A page at /collections is safe alongside the API at /api/collections.
Can I put a page behind a login?
Yes. Enable the auth feature on the page. Logged-out visitors are redirected to the login page and returned afterwards; logged-in users outside the access groups you listed get a 403 rather than a login loop.
Can Site Builder serve files that are not HTML?
Yes. A page with a route like /robots.txt, /llms.txt or /feed.xml is served with the content type matched to the extension, and the template has the full Twig surface available.
Try it on a site of your own.
45 days, every Pro feature, no credit card. Build it, hand it to a client, and see what they can and can’t touch.