
This tutorial explains step by step how to create a Joomla template from scratch for Joomla 5 and Joomla 6: what a Joomla template does, the folder structure, the index.php, templateDetails.xml and joomla.asset.json files, installation, module positions, and faster alternatives such as a Cassiopeia child template. A generator prepares the templateDetails.xml file for your future template.
At a glance
A Joomla template is the set of files that controls how your site’s content is displayed: the HTML structure of the page, where menus and modules sit, the styles, fonts and scripts. The content itself stays in the database. Switching templates changes the look of the whole site without touching the articles.
Setting up a basic template does not mean the design is finished. It means the structure needed to display the site exists: a header, a content area, module positions. The visual work comes next, in the stylesheet.
Joomla distinguishes site templates (the public side, Cassiopeia by default) from administrator templates (Atum). This tutorial covers a site template.
| Location | File or folder | Role |
|---|---|---|
| templates/mysite/ | templateDetails.xml | required declares the template, its files, media and positions |
| templates/mysite/ | index.php | required layout shared by every page |
| templates/mysite/ | joomla.asset.json | recommended declares CSS and scripts for the Web Asset Manager |
| templates/mysite/ | error.php, offline.php, component.php | optional error page, offline site, simplified view |
| templates/mysite/html/ | overrides | optional custom output for components and modules |
| media/templates/site/mysite/ | css/, js/, images/ | required template stylesheets, scripts and images |
Since Joomla 4.1, “static” files (CSS, JavaScript, images, fonts) no longer live in the template folder but in media/templates/site/template-name/. PHP files stay in templates/template-name/. This is what makes child templates possible, and it is the first source of errors when following an old tutorial.
This is the template’s ID card. Joomla reads it to install the template, list it in the administrator and know its files, media folders, module positions and parameters. Without it, the template does not exist as far as Joomla is concerned.
<?xml version="1.0" encoding="utf-8"?>
<extension type="template" client="site">
<name>mysite</name>
<version>1.0.0</version>
<author>Your name</author>
<inheritable>1</inheritable>
<files>
<filename>index.php</filename>
<filename>joomla.asset.json</filename>
<filename>templateDetails.xml</filename>
<folder>html</folder>
</files>
<media destination="templates/site/mysite" folder="media">
<folder>css</folder>
<folder>js</folder>
<folder>images</folder>
</media>
<positions>
<position>menu</position>
<position>sidebar-right</position>
<position>footer</position>
</positions>
</extension>
The inheritable tag allows child templates to be built from yours. The positions block lists the places where modules can be assigned from the administrator.
This is the layout shared by every page of the site. It holds the HTML skeleton and jdoc:include tags that Joomla replaces with real content: the head (title, meta, CSS, scripts), system messages, the component (the article or page being shown) and the modules in each position.
<?php
defined('_JEXEC') or die;
$wa = $this->getWebAssetManager();
$wa->useStyle('template.mysite');
?>
<!DOCTYPE html>
<html lang="<?php echo $this->language; ?>">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<jdoc:include type="metas" />
<jdoc:include type="styles" />
<jdoc:include type="scripts" />
</head>
<body>
<header><jdoc:include type="modules" name="menu" style="none" /></header>
<main>
<jdoc:include type="message" />
<jdoc:include type="component" />
</main>
<aside><jdoc:include type="modules" name="sidebar-right" style="card" /></aside>
<footer><jdoc:include type="modules" name="footer" style="none" /></footer>
</body>
</html>
The first line blocks direct access to the file. The jdoc:include type="metas", styles and scripts tags replace the single head tag of Joomla 3. Add error.php (error page), offline.php (site in maintenance) and component.php (print view or modal window) as needed.
In Joomla 3, you added the stylesheet with a simple link tag in index.php. Since Joomla 4, CSS and scripts go through the Web Asset Manager: you declare them in joomla.asset.json, then enable them in index.php with useStyle() or useScript(). Joomla then handles load order, dependencies and versioning.
{
"$schema": "https://developer.joomla.org/schemas/json-schema/web_assets.json",
"name": "mysite",
"version": "1.0.0",
"assets": [
{ "name": "template.mysite", "type": "style", "uri": "template.css" }
]
}
The template.css file itself goes in media/templates/site/mysite/css/. Start mobile first: a single column on phones, the sidebar next to the content once the screen is wide enough.
Need a custom Joomla template without spending your evenings on it? Our team can build it for you
Two methods. First: zip the template folder (with templateDetails.xml at the root of the zip and a media folder) and install it from System, Install, Extensions. Second, handy during development: copy the files straight to the server, then use System, Discover so Joomla picks it up.
Then open System, Site Template Styles, and set your template’s style as the default. To see where positions sit on a page, turn on “Preview Module Positions” in the template options, then add ?tp=1 to the page address.
Since Joomla 4.1, a child template inherits every file from its parent and only contains what you change. Created in one click from Cassiopeia (the “Create Child Template” button), it lets you change colors, fonts, logo and a few overrides without touching the original template, which keeps receiving Joomla updates.
Our advice: for a brochure site that stays close to Cassiopeia, start from a child template. Build a template from scratch when the layout is truly specific, or when you want minimal code you fully control. Template frameworks and builders from the big Joomla template vendors are a third route, faster but heavier.

An override changes how a component or module is displayed without touching the Joomla core. From the administrator (System, Site Templates, “Create Overrides” tab), pick for example com_content then article: Joomla copies the layout file into your template’s html folder, and you edit that copy. Overrides survive updates, but compare them after a major release: Joomla flags those whose original has changed.
lang attribute on the html element.defined('_JEXEC') or die; line in every PHP file, and no direct edits to Cassiopeia, which the next update overwrites.
Joomla 6 was released on October 14, 2025 and will be maintained until October 2029. Joomla 5 has received no bug fixes since October 13, 2026 and gets no security fixes after October 12, 2027. Joomla 4 and Joomla 3 are end of life. A template written for Joomla 4 or 5 following the rules in this tutorial works in Joomla 6; a Joomla 3 template must be rewritten. If you are weighing a move away from Joomla, see our guide on how to migrate Joomla to WordPress.
Creating a basic Joomla template takes a handful of files: templateDetails.xml for the declaration, index.php for the layout, joomla.asset.json and template.css for the styles. Follow the new media layout, declare your positions, test on mobile, and you will have a clean base to build on. If the goal is mostly to customize the look, start with a child template: it is faster and safer over time.
It is the set of files that defines the structure and look of a Joomla site: HTML layout, module positions, styles and scripts. Content stays in the database, so switching templates changes how the whole site is displayed without touching the articles. Joomla ships Cassiopeia as the default site template.
At minimum templateDetails.xml, which declares the template, and index.php, which holds the layout. In practice you add joomla.asset.json to declare stylesheets and scripts, a template.css file in the media folder, and often error.php, offline.php and component.php. The html folder holds overrides.
To customize a site close to the Cassiopeia design, a child template is the best choice: quick to create, it inherits the parent’s updates. A template from scratch makes sense for a very specific layout or minimal, fully controlled code. Both approaches follow the same file rules.
It is a copy of a component or module layout file, placed in the template’s html folder and edited to change the output without touching the Joomla core. You create it from the template manager. Overrides survive updates, but should be checked after a major release.
Add the viewport tag, build the layout with CSS grid or flexbox starting from mobile, and load styles and scripts through the Web Asset Manager. Keep scripts to a minimum, host fonts locally and serve light WebP images. Then measure the result with PageSpeed Insights on mobile.
Joomla remains solid for multilingual sites and sites with varied access rights, with a rich core that needs few extensions. WordPress wins on ecosystem and ease of use for editors, Drupal on complex, high-volume projects. The right choice depends mostly on who will maintain the site and which features are needed.
EXCELLENT Based on 22 reviews Posted on Google pierre lenfantTrustindex verifies that the original source of the review is Google. Aurone is a web agency like no other! Very responsive, highly flexible in the way they work and always at the cutting edge of technology: you can count on real professionals for all your web projects!Posted on Google Sami Yassine TurkiTrustindex verifies that the original source of the review is Google. As Secretary General of the Lina Ben Mhenni association, it was a pleasure to work with the AURONE agency, which developed our website with great professionalism.Posted on Google Gwladys LavergneTrustindex verifies that the original source of the review is Google. Responsive, attentive and highly skilled: we are delighted to work with Aurone, who meet our expectations perfectly, both in graphic design and in technical expertise. I highly recommend their support!Posted on Google Perrine AmalTrustindex verifies that the original source of the review is Google. Aurone is a human, responsive and efficient company. The work was done quickly and promptly. I highly recommend them and hope to continue this collaboration in the future.Posted on Google Stephanie WillmanTrustindex verifies that the original source of the review is Google. We have been working with Aurone since 2016 and are delighted. We first called on their services for a project in Tunisia, and the quality of their work means we now rely on Aurone for services in other countries too. The team is dynamic, creative, responsive and enthusiastic. They have always understood our needs for our diverse and complex web presences, and do their best to meet them. Web platforms, training workshops on the platforms, video tutorials and graphic design for various products are just some of the excellent services Aurone provides. The technical quality of their web services is top-notch, and we always get good advice, both technical and creative. We highly recommend them.Posted on Google Raphaël GianassoTrustindex verifies that the original source of the review is Google. For your e-commerce and digital marketing projects, the Aurone team is attentive, experienced, available and responsive. A team you can count on, for whom customer satisfaction comes first.Posted on Google Samuel DechometsTrustindex verifies that the original source of the review is Google. At Aurone I found everything you can expect from a good web agency: quality, responsiveness, flexibility, relevance... Well done and thank you!Posted on Google Karim DjebbarTrustindex verifies that the original source of the review is Google. Our whole network worked with the Aurone agency for several years. A few adjustments were needed at the start of our partnership back then, but quality quickly followed.
The teams worked very professionally, adapting to the requirements of the French clients we soon put them in touch with.
A great deal of agility from its founder.
Thank you for these great years!
27 Avenue Taieb Mhiri, Immeuble Yasmina
2080 Ariana, Tunis, Tunisia
Made with in Tunis | Copyright © 2007-2026 Aurone
About | Legal notice | Privacy policy | AI charter | Shop