How to Create Joomla 6 Overrides for Components (com_content)
Component overrides in Joomla 6 let you redesign how articles, category blogs, and featured posts look on the front-end without touching core files. By overriding com_content layouts, you gain full control over HTML structure while keeping your site update-safe and easier to maintain.
Learn how to create Joomla 6 component overrides for com_content, customize article and blog layouts, and manage multiple view templates without editing any core files.
What Is a Component Override in Joomla 6?
A component override is a copy of a core view layout placed inside your template. When Joomla detects this copy, it loads your version instead of the original file in /components/com_content. You can then safely modify HTML, classes, and structure without worrying about losing changes during an update.
With com_content overrides you can:
- Change the markup of single article pages
- Redesign category blog or featured article layouts
- Insert custom wrappers, icons, and CSS classes
- Integrate your own design system or CSS framework
Where com_content Layout Files Live
The core layouts of com_content are stored in:
/components/com_content/tmpl/
Inside, you will see folders for each view, such as:
article– single article viewcategory– category list and blogfeatured– featured articles
Each folder usually contains one or more layout files, for example:
/components/com_content/tmpl/article/default.php
/components/com_content/tmpl/category/blog.php
/components/com_content/tmpl/featured/default.php
Basic Override: Single Article View
Step 1: Copy the Layout into Your Template
First, locate the view you want to override. For a standard article page, copy this file:
/components/com_content/tmpl/article/default.php
Paste it into your active template under an identical folder structure:
/templates/your_template/html/com_content/article/default.php
If the com_content or article folder does not exist, create it manually. Once saved, Joomla automatically uses this override instead of the core file.
Step 2: Customize the Markup
Open the new default.php in your code editor. You will see PHP mixed with HTML. Focus on the HTML containers and classes, not business logic. For example, you can wrap the whole article in a custom container:
<div class="article-wrapper container">
<h1 class="article-title"><?php echo $this->escape($this->item->title); ?></h1>
<div class="article-meta text-muted">
<span>Published: <?php echo $this->item->publish_up; ?></span>
</div>
<div class="article-body">
<?php echo $this->item->text; ?>
</div>
</div>
This gives you a clean structure for your CSS to target, while Joomla still handles content, permissions, and plugins normally.
Override Category Blog Layout
Many sites rely heavily on blog views. To change how article cards render in a category blog, override the blog layout.
Step 1: Copy the Blog Layout
/components/com_content/tmpl/category/blog.php
→ /templates/your_template/html/com_content/category/blog.php
Step 2: Restructure Items into a Grid
Inside the override, you will see a loop that outputs each article. You can wrap each item in a card and arrange them into columns:
<div class="row article-grid">
<?php foreach ($this->lead_items as &$item) : ?>
<div class="col-md-4 mb-4">
<article class="card h-100">
<h2 class="card-title">
<a href="/<?php echo $item->link; ?>">
<?php echo $this->escape($item->title); ?>
</a>
</h2>
<div class="card-body">
<?php echo $item->introtext; ?>
</div>
</article>
</div>
<?php endforeach; ?>
</div>
By changing only the HTML, you can completely transform the layout while keeping features like pagination, permissions, and read more links intact.
Create Alternative Layouts for com_content
Sometimes you need multiple designs for the same view. Joomla allows alternative layouts simply by naming additional files.
For articles:
/templates/your_template/html/com_content/article/default.php
/templates/your_template/html/com_content/article/card.php
/templates/your_template/html/com_content/article/fullwidth.php
In the menu item or article options, you can select your alternative layout under Layout or Alternative Layout. This makes it easy to use a different design for landing pages, feature articles, or specific categories.
Best Practices for Component Overrides
- Do not move or remove critical PHP logic unless you fully understand it.
- Keep overrides focused on presentation: wrappers, classes, and markup.
- Comment custom sections so you or your team understand the changes.
- Use consistent class naming to simplify CSS and responsive design.
- After major Joomla updates, quickly review overrides to ensure compatibility.
Troubleshooting Common Override Issues
If your override does not load:
- Check folder names and spelling:
com_content,article,category, etc. - Verify that the correct template is set as default for the site.
- Ensure PHP syntax is valid; a small error can break the view.
- Clear Joomla cache and browser cache to see new markup.
Speed Up Development with a Override-Friendly Template
Using a clean, lightweight template makes overrides much easier. Consider starting with the best fast Joomla template so your custom com_content layouts load quickly and integrate nicely with a modern design system.
Conclusion
Creating Joomla 6 component overrides for com_content is one of the most powerful techniques to control how articles and blogs appear on your site. By copying view files into your template and editing only the markup, you stay update-safe while gaining full freedom over layout and structure. Once you get comfortable with article and category overrides, you can extend the same workflow to other components and build a Joomla site that truly matches your brand and design system.
- How to override module output layouts in Joomla 6
- Template overrides vs language overrides: choosing the right approach