Skip to content

The inspector

t4 serve injects a small T4 badge in the corner of every page. Expand it and it answers “what rendered this, and what do I edit”:

Clicking an element on the locally served page selects it, and the T4 panel lists what produced it: the content item and its content layout file, then the page layout around it, each with buttons to open the file in an editor, show it in a file manager, or copy its path.Clicking an element on the locally served page selects it, and the T4 panel lists what produced it: the content item and its content layout file, then the page layout around it, each with buttons to open the file in an editor, show it in a file manager, or copy its path.

Click something on the page and the panel narrows to just what produced it: the component, its template, the page layout around it, each with a button to open that file in your editor or show it in Finder. While Select on click is on, links do not navigate, so clicking a menu item tells you about it instead of taking you away.

Page layout standard #1180
pageLayout/standard.header.html [edit]
pageLayout/standard.footer.html [edit]
Assets 23, 1 overridden
media/web/css/site.css [edit]
media/web/css/brand.css [editing]
...

T4 publishes <meta name="t4-layout"> and <meta name="t4-layout-id"> into every page. The id is matched against the pull manifest, so the panel names the exact file on disk rather than leaving you to guess which of 58 layouts with names like basic_page.production and standard_alt_no_menu produced the page. Layout names are not reliably unique after slugging; the id is.

Every file row carries edit, folder and copy: open it in your editor, show it in Finder or Explorer, or copy the path. A browser cannot launch an application, so the serving process does it, and refuses any path that resolves outside the project. Assets already overridden are highlighted.

A Content section lists what the page is made of, grouped by content type, with the files behind each one:

Content 5 type(s), 32 item(s)
● Contact x25
contentLayout/contact--texthtml.html text/html [path]
contentLayout/contact--textrss.html text/rss [path]
contenttype/contact.json [path]
Main reception · Second reception · ...
● Page Content x3
...

Content types are field definitions; the markup they render lives in their Content Layouts, so that is what the panel points at. Clicking an item scrolls the page to it and flashes it. This comes from the d.en.<id> anchors T4 publishes for every content item it renders (T4’s own markup, not a site convention) matched against t4 sections, so it works on any instance.

Highlight outlines what is on the page, coloured by type, with a legend:

content items every content item, from T4’s own anchors
marker components components the site comments in its own layouts
everything both

The colour is derived from the type name, so the same component is the same colour on every page, and the panel’s swatches match the outlines. labels turns the name badges off when they get in the way of seeing the layout. Both settings are remembered per browser.

It works from the marker comments already in the DOM. No markup is injected into the page, which would risk landing somewhere invalid like <head> or inside a <table> and changing how the page renders. A component that resolves to an element with no height climbs to the nearest ancestor that occupies space, and two components sharing one element have their labels combined rather than one overwriting the other.

If a page has no t4-layout meta, or the layout has not been pulled yet, the panel says so rather than showing nothing. --no-inspect turns it off.

t4 serve also reports what it found as Drupal-style theme-debug comments in the served HTML:

<!-- T4 DEBUG -->
<!-- PAGE LAYOUT: 'standard' #1180 -->
<!-- SOURCE FILES:
x t4-source/test/pageLayout/standard.header.html
x t4-source/test/pageLayout/standard.footer.html
-->
<!-- ASSETS (23, 1 overridden):
x media/web/css/brand.css
* media/web/css/site.css
* not overridden. CSS and JS are Media Library items: edit t4-source/<env>/media/<name>
directly - that file is served here and is what t4 push deploys.
-->
<!-- CHILD PAGES (25):
basic_page: about, courses, news, events, ...
standard: alumni, giving
-->

--inspect comments for comments only, panel for the overlay only, both (the default), off for neither. The comments are added at serve time; files under the mirror are never modified.

From the terminal, t4 layouts lists every published layout, its pages and its local files; t4 layouts about/admissions asks about one page.

T4 publishes an anchor for every content item it renders:

<span id="d.en.4021"></span><!-- T4 CONTENT: #4021 'A promoted link' of type 'Promo boxes' -> t4-source/test/contenttype/promo-boxes.json -->

This is T4’s own markup rather than a site convention, so it works on any instance, and it carries the item’s id, so the annotation names the specific piece of content, not only its type. Requires t4 sections, which records the content items as it walks (--no-contents skips them).

T4 does not delimit content items in published output. Many sites do comment them from their own content layouts, and where that convention exists it can be read back, so each component is marked at the point it begins:

<!-- ct:322 Contact Footer --><!-- T4 COMPONENT: 'Contact footer' -> t4-source/test/contenttype/contact-footer.json -->
<div class="row ct-322" id="contact-bar">

Navigation objects too:

<!-- n:Footer-Contact (273) --><!-- T4 NAVIGATION: 'Footer-Contact' -> t4-source/test/navigation/footer-contact-273.json -->

The site’s own markers are left in place; the note is added after them. A marker whose id is not in the local pull says so rather than pointing at the wrong file.

These conventions are per-site, not a T4 feature. The defaults recognize <!-- ct:ID Name -->, <!-- ct-ID Name -->, <!-- content type: Name --> and <!-- n:Name (ID) -->. Set component_markers in .t4/config.json for other conventions: a list of [regex, endpoint] pairs, where the regex has an id group, a name group, or both:

{
"component_markers": [
["<!--\\s*component:(?P<name>[^>]+?)\\s*-->", "contenttype"]
]
}
Terminal window
t4 sections --root <site-root-id> # walk the tree, record each assignment

T4 knows exactly which layout each section uses: every section carries, per channel, {"pageLayout": 1100982, "inheritedPageLayout": 1100998}. With that pulled, the inspector reports the real assignment instead of inferring it:

<!-- NOTE: assigned in T4 to section 228911 (Applied Business Technology) -->
<!-- SOURCE FILES:
x t4-source/test/pageLayout/u-webpage.production.header.html
-->

Three requests per section with content items, two without, so it is a separate, opt-in pull. It is resumable: --limit stops early and re-running continues from the cache. Without it, the inference below is used instead.

T4 publishes a layout name into nearly every page, but the name need not identify one layout: a site can publish basic_page from any of several basic_page.* layouts. Rather than asking for a mapping, the layout is identified from the page itself:

Signal What it does
t4-layout-id Exact, when the page carries it (often it does not)
Alignment A layout’s literal markup must appear, in order, in the page. One that did not produce the page usually fails outright
Tag ids Among survivors, score the ids that differ between them. T4 layouts commonly echo media and navigation ids into the output

A page that carries no layout tag at all is left unlabelled rather than guessed at. Where two layouts are genuinely indistinguishable (identical literals, identical tags) it says so instead of picking one:

<!-- NOTE: indistinguishable from the published page: basic_page.a, basic_page.b -->

An independent, unofficial tool. Not produced, endorsed or supported by TERMINALFOUR Solutions Ltd, and not TERMINALFOUR software. “T4” and “TERMINALFOUR” are their trademarks, used here only to identify the software this works with. Copyright © 2026 Small Robot Corp. Source available under the PolyForm Shield License 1.0.0.