A recipe does not read like a press release. The recipe wants its ingredients in a column, its cooking time as a spec sheet, its photograph next to the title; the press release wants one column of text and nothing else. Joomla can only set a single layout for every article on the site.
The Article templates tab of the style lifts that limit. You compose several layouts there, and assign one to each category. Sub-categories inherit it unless you decide otherwise.
It is the exact counterpart of the blog templates of the previous chapter: same principle, same screen, same map. This one describes an article's page, the other its card inside a list.
There is nothing more to install. Article templates are part of the Corpus package. They build on Joomla's own rows, custom fields and module positions - no third-party component, no database table that would only half belong to you.
Where this is set
Style → Article templates. You will find three things there:
- Site default template. The one used for articles whose category, and none of its parents, names one. Leave it on Joomla native until you have a reason to change it.
- The templates. The list of the ones you compose. Four or five are enough on most sites.
- The map, on the right. It draws each template as it will come out. It updates while you work, and lets you check at a glance.
Then, category by category: Content → Categories → your category → Corpus tab. A single field, Article template. On Inherit, the category takes its parent's, and so on up to the site default.
The two templates that ship with Corpus
They sit at the bottom of the list, marked read-only. Neither can be edited or deleted, each can be copied: the Copy button on its card turns it into an ordinary row that you only have to rearrange.
Joomla default reproduces Joomla's order exactly: title, icons, information block, tags, image, table of contents, body, tools, pagination.
Article with an outline puts the article's outline and its table of contents in a left column, three twelfths wide, and everything else on the right. It is a layout everyone wants identically, and one that would cost six screens of settings to rebuild by hand: a two-column row, a ratio, then eleven bricks to place one by one, a single forgotten one making the tags or the pagination disappear.
A module under the outline stays visible. If you place a module (a contact, a form, an announcement) in the same column as the outline, the whole column stays stuck at the top while reading: the outline, then the module at the end. If it is taller than the screen, it scrolls as one block. An outline on its own behaves as before. The column that carries the article text never sticks. Below 62 rem of width, nothing sticks and everything stacks.
The default template serves twice. It is the way back: if a template goes wrong, put it back on the affected articles and the page becomes Joomla's again. And it is the starting point: its copy gives you the core's order, which you then only have to rearrange.
Always start from a copy. Composing a template from a blank page means reinventing an order Joomla has already thought through.
A template is composed in two tables
The rows
A row is a horizontal band. Rows stack in the order shown.
| Setting | What it does |
|---|---|
| Columns | One, two or three. |
| Ratio | The relative width of the columns, in twelfths: 5 / 7, 8 / 4, 3 / 6 / 3... Not applicable to a single-column row. |
| Background | None, Alternate - a neutral grey - or Tinted - a derivation of the site hue, so it follows it. |
| Apply to | Where the background sits: the whole row, or just one of its columns. Only appears once a background is chosen. |
A row with no bricks does not come out on the page. You can therefore prepare more rows than you need without spoiling the result.
Careful when moving a row. Bricks name a row by its number. Moving a row moves its number, not its content: the third row becomes the second, and the bricks that pointed at the second end up inside it. Set the numbers in the brick table instead.
The bricks
One line, one brick. Within the same cell, they come out in the order shown.
| Setting | What it does |
|---|---|
| Brick | What comes out. The full list is below. |
| Row | The number of the row that receives it. |
| Column | Full, Left, Centre or Right, depending on the row's column count. |
| Option | What the brick must show: which field, which group, which module position. The other bricks do not need one. |
A brick pointing at a row or column that does not exist does not come out, and the map says so. It is not moved for you: a brick silently relocated is harder to find than a missing one.
The list of bricks
The article's content
| Brick | What it outputs |
|---|---|
| Article title | The title, as h1 - or h2 if the menu item already shows its own page heading. |
| Introduction | The introduction text alone, the part before the Read more link. |
| Article body | The text. With the Without the introduction option, only what follows Read more. |
| Full article image | The Full article image from the Images and Links tab. |
| Intro image | The Intro image. |
The article's data
| Brick | What it outputs |
|---|---|
| A field | One custom field, chosen in the Option. |
| A field group | Every field of a group, as a spec sheet: label left, value right. |
| Information block | Category, author, date. The Option lets you take just one, or all three. |
| Tags | The article's tags. |
Around the article
| Brick | What it outputs |
|---|---|
| Modules of a position | Modules published on article-1 to article-6. |
| Associated links | The links from the Images and Links tab. |
| Table of contents | The page-break table of contents. |
| Pagination | Navigation between the pages of a split article. |
| Print, email, share | According to what you enabled in the Theme Customizer. |
| Edit icons | The pencil, for whoever may edit. |
Plugin output
Three bricks - after the title, before the content, after the content - place what your content plugins produce: share buttons, ratings, advertising blocks. If you do not place them, Corpus outputs them at the end anyway: nobody should lose content by forgetting a brick.
And one layout brick
Breathing space writes nothing: it adds height. When you only want to space things out, do not write a horizontal rule - an <hr> carries meaning, it separates two subjects.
The cases that need explaining
The introduction and the body
When you place the Introduction brick, the Body brick drops the introduction automatically: without that, the standfirst would come out twice. The map writes it on the chip - Article body (without the introduction). If you pick an option on the Body yourself, your choice wins.
An article with no Read more link has no separate introduction: Joomla keeps all the text in one place. The Introduction brick then stays silent, and the body comes out whole.
A field that comes out twice
A custom field set to Automatic display is already placed by Joomla. Placing it as a brick as well makes it come out twice. The option list tells you so at the very place where you choose:
Chef's tip (warning: automatic display is on, the field will come out twice)
The fix is in the field, not in the template: Fields → your field → Display options → Automatic display → Do not display automatically.
The field group's title
Joomla never shows a group's title on the public page. Corpus can: in the option list, each group appears twice - At a glance and At a glance (with its title). The title comes out as h2, or h3 if the article is already h2. Never h1: there is only one per page.
The article title cannot be lost
If you do not place the Title brick, it comes out anyway, at the top. An article with no first-level heading is an accessibility fault, not a layout choice. And if you place it twice, it comes out once.
The gear icon: dressing a brick
At the end of each brick row, after the Option column, a gear icon opens a panel. It holds two settings, and only two.
Class. A class the template already draws. The list only offers those whose rule exists - a class that does nothing would send you looking for the fault elsewhere. Corpus ships a few: Introduction body size, Aside, small and grey, Rule under the heading, Spec sheet: label left, value right.
Identifier. A unique name, to target that one brick from the Custom CSS field in Advanced settings. Letters, digits, hyphen and underscore, and it must start with a letter - an identifier starting with a digit is valid HTML but illegal in a CSS selector, so useless where it is meant to serve.
The wrapper exists only if one of the two is filled in. A brick with no setting comes out exactly as before, with no extra tag. Otherwise Corpus wraps it like this:
<div class="brique-article my-class" id="my-id"> … </div>
brique-article has no rule in the stylesheet: it is a hook, not a design. Giving it a style would be a poisoned gift - a margin you never asked for and whose origin you could not trace.
In the map, a brick carrying either setting is marked with a small gear. Hover it to read what it holds: a setting hidden behind a button is a setting forgotten.
Adding your own classes
Advanced settings → Your classes for bricks, right below the Custom CSS field. Two columns: the class, without the dot, and the label the list will show.
The two fields sit together on purpose. The rule goes above, the class is declared below:
/* in "Custom CSS" */
.alert-box {
border-left: 4px solid var(--accent);
padding-left: var(--e-4);
}
then a row alert-box / "Alert box" in the table. After saving, it appears in the gear panel of every brick, under Your classes.
Your classes live in the style's parameters: they survive Corpus updates, and they travel with a preset. The ones we ship live in a template file and are rewritten with every version - do not edit those in place, add yours here.
A worked example: the recipe sheet
Seven rows, to get the photograph on the left and the summary on the right, then the ingredients in a column and the steps in the middle.
| Row | Columns | Ratio | Background | What goes in |
|---|---|---|---|---|
| 1 | One | - | - | Title, Edit icons |
| 2 | One | - | - | Information block, Tags |
| 3 | Two | 6 / 6 | Tinted on the Right | Full article image, then the At a glance (with its title) group |
| 4 | One | - | - | Introduction |
| 5 | Three | 3 / 6 / 3 | - | The Ingredients field, the Body, the article-2 modules |
| 6 | One | - | Tinted | The Chef's tip field |
| 7 | One | - | - | Print email share, Plugins: after the content |
The Tinted background applied to row 3's right column alone gives the "At a glance" box without tinting the photograph beside it.
How many templates, and how far
Templates are stored in the style's parameters, like every other setting. That field has a maximum size in the database. Five complete templates take up about a seventh of it - so you have plenty of room, and Corpus warns you well before it becomes a problem.
Past a dozen templates the difficulty is no longer technical: the list itself becomes tedious to scan, and your writers will no longer know which to pick. Four or five, clearly named, beat twelve.
Carrying your templates to another site
Style → Advanced settings → Backup and transport, right-hand column.
The Export - the article templates alone button produces a .json file holding three things, and nothing else:
- the site default template;
- your templates, with their rows and bricks;
- your list of brick classes.
The line under the button counts them: 1 template, 7 rows, 18 bricks, 3 classes, 7.4 KB.
Why the classes travel too. A brick stores a class name taken from your list. Without the list, it would name a class the selector does not offer, and the value would be lost on the first save, with no message.
What does not travel: the assignment to categories. That lives in the categories, not in the style. On the receiving site your templates exist but no category names them yet: redo the assignment once, category by category.
The import replaces, it does not add to. The style templates give way to the ones in the file, and your class list to the one in the file. Export yours first - one click - if you want a way back. Categories naming a template that is gone fall back to the site default, breaking nothing.
To carry the whole style - hue, typography, layout, CSS - see Going further.
If you uninstall Corpus
Templates live in the Corpus style's parameters and in a field added to categories. Switching back to Cassiopeia:
- your articles do not change - the text, the fields, the images, the tags are Joomla's and stay Joomla's;
- your articles take Cassiopeia's layout, which is Joomla's;
- the Article template field disappears from categories;
- if you reinstall Corpus, your templates and assignments are found intact as long as the style has not been deleted.
Nothing you write is locked inside the template. That is the principle, and it is verifiable: clear your categories of their template, everything keeps working.
Up to date for Corpus 2.1.684.