on 10 December 18
Joomla is undoubtedly the best CMS platform to get started your website on. It has some incredible features and functionalities that will help you give out an experience of a lifetime to the users. But, there are some frustrating moments you might experience on this platform. For one, some of the extensions may not give out the experience or output you are demanding. Instead of customizing the core, as you might have done in certain cases, you can now override the extensions, and introduce the functionalities you need.
Before understanding how override is created, you will need to understand what an override is. It is basically a copy of the extension layout file which is a part of your Joomla extension directory. Once you have that copy in hand, you can easily customize it and introduce the changes that you want to view.
Now, let's understand how to create override that will help you customize the particular functionality or feature.
Identify the Component
What is it that you wish to customize? Identify the portion that requires to be changed so that you get the output that matches your need. Once the component is identified, you will be able to locate the file that you need to override.
Let's say you want to change the position of the article title; instead of having it before the article, you want to shift it to the bottom of the article. You will first need to identify the component. Login to your admin panel, and visit the menu item of that particular page. In the menu item, you will find a URL that describes the component for you.
index.php?option=com_content&view=category&layout=blog&id=9 (This is the link)
Let's understand this link
This is the entry point; it is a common path for all components on this CMS platform
It is the com_content that manages both categories as well as the content being posted to Joomla articles. This is an important part of the link
From this you will know that content component is using the view to offer the category
The category is presented in here by using the blog layout. If the layout is absent, as demanded here, then the default layout is used
This refers to the category id represented by number 9. While this would help you understand Joomla database structure, it is hardly relevant to the override concept, you are trying to understand here.
Identify the File
Once, you have identified the component, your next task is to identify the file that you need to override in here. Whether, it is a component, view or layout, your file will be located in the PHP file in a particular structure. You will need to understand the structure, before you are able to locate the file.
Your com_content folder is located within the folder components, which further holds the category folder. The tmpl folder is located within the category folder, which holds the layout folder in the blog.php file. This is the file you need, to override and customize the component.
The layout is not always a view file. In some cases, it is a composite view- wherein it has a main file for the blog, and individual files for the different parts within the blog. This particular layout is flooded with files located within the tmpl file. You will need to modify individual article's layout from within the blog, which means you need to understand PHP coding.