What is a Component and why should we use a Component?
Now quickly come to the component part like I said earlier components used to take up the whole page area for the display and these are considered as the mini applications which brings a major functionality on the entire page or to the website so like the content management is a type of component, banner management is type of component and there are other components like if you want to add the site map you want to add an E-commerce functionality, you want to add a blog functionality, you want to add a forum functionality, you want to add news letter functionality so all of these are mini applications in their own nature and you can add these functionality with the help of the components.
The questions comes again why should we use a component when we can do something with procedural coding? No, to add a more functional part we should use component and obviously there is code reusability as well with this particular thing you can handle a component from the backend for the data entry purpose and you can use the component for the front-end display purpose so if there is say banner management component you can add banners from the back-end and it can be displayed using the banner module in the front. For the conventions of the component, component name should be prefixed by “com_†com_componentname for example and yes it should also be in small letters.
Same as the module component position depends again on the template, usually in the content area we place the component position with the help of this particular code the component position can be defined, there can be only one component on a page with this code, so if you take an example of the component.
Here is the banner management component, you create a banner in the back-end banner is created and then with the help of the banner front-end module you place it at any defined position and it reflects anywhere you want it. So this is banner and then banner is created in the back-end and then a module is added once that module is added in the front panel it will be seen.
Component structure is much more typical and complex than the module, you would be able to see a long list of files here which I would cover gradually and with the more time so for now you can just have a look there are lot of files, I am simply taking a hello world component example here, you have different type of controllers, you have different type of views, there are two different type of components one for the set front end another for the website back-end, so for the front end you would see that there are typical controller views and model files and for the website back-end there are typically again the model gives controller files. We have added the language functionality as well here so as you have seen in the beginning the component could be multi language as well.
Now we have installed a Joomla on our demo server, we know that a basic website is ready with us so things are ready with us we just want to see how to further extend the Joomla, how to add a new functionality to the Joomla so we would be installing some extension to the Joomla and to use some of the readymade extensions you can use the Joomla extension directory which is available on the extension.Joomla.org and from this extension directory you can download some of the existing extensions those can be used to simply add the functionality to your website or web application.
To install extension simply log into the administrator panel go to the top menu extension manager and once you click on this you would come to this particular screen. Here 3 types of installation options are available you can either upload a package file you can install it directly from directory or you can install from URL. This directory would be somewhere on your local PC or network mirror this would be an online part install from URL would be an online URL where you can simply near path of zip file for the component or if we are already downloaded with zip file you can simply browse it here and upload it.
Once that file is uploaded or installed with any of these methods it will simply give a success message. For some reasons you would notice that the success message is not shown or some failure is there so you can possibly look into the exact reason that could be shown somewhere here on the screen instead of the success message the failure message would be shown. For most of the components which are available on the Joomla extension directory which is the JVD you would notice that most of the extensions are,
I move on to the next part since we already done the installation of the extension here as I assume. The next screen for the post installation part goes to the components and extensions in the top menu when you install component post installation it will be shown under the components menu and if you install a module it will be shown under the module manager in the extension top menu so if you click on if there is a component it will be shown in the list of the components menu since we have not yet handled any components so we have to move to module management part once you click on the module manager you would be able to see a list of available modules, you can use any of the existing modules or you can create a new module by clicking on the new button available there.
Once you click on the new button you would need to select a module type there are different module test, we will be covering a new module development here that will also be shown on this particular screen in sometime. Once you create new module you would be able to add some setting to this define a position or set up some different other configurations to this.