In this tutorial we are going discuss about how to create a Front End Component in Joomla. Here I will explain how to create a component and how to display in the browser.
Step 1:
Create a folder for your component in Joomla components directory.
Ex: root folder/components/com_mycomponent
Here "com_mycomponent" is our new component name.
Step 2:
Create a file "mycomponent.php" inside the "com_mycomponent" folder.
Step 1:
Create a folder for your component in Joomla components directory.
Ex: root folder/components/com_mycomponent
Here "com_mycomponent" is our new component name.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhr61fAT2BG4Vp_fNSXk091YSOS5ZE7m-aZ-hoshOWWoZdWmSJ-zPiduYfICAalUBEWtOvBr5txJDazqiJkltBQPbjwAg0D3NLisjOCVZieCR1lrkUD9RsE3qtzwrdruYhtuz9N0MjgGA4/s400-rw/folder.png)
Create a file "mycomponent.php" inside the "com_mycomponent" folder.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlJ2GsDu_lgawF2VG-TCA5tuW78DCxm3SUO90glN87d0swCL5FfPyLhlGC9JE64jf7CxPL_cbEXNWParaE8d7D6po0ciw8RS7Dvhe793rson8dcr9M7LT2B7xGcpMGNrhQaqMO44-115Y/s400-rw/file.png)
Step 3:
Write the following code in the "mycomponent.php" file.
<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
echo '<div class="componentheading">Welcome to my Own Joomla Front end Component</div>';
?>
Step 4:
Test the above component by accessing
http://localhost/joomla25/index.php?option=com_mycomponent
The final output will be.,
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCsqdiN6EM6sX00bxmgKTqG7Rxs8K8PV9n4l2lN4id33TTk1bESHO7_ejKg8F5HYGJUUghHNgac8owQSLzRbVMXlhYprrfVlE5DUOwzZw2ffGv0dhFLvKRP11WbhBbhyphenhyphen3pzu6XOugakWs/s400-rw/joomla_front_end_component.png)
In my next post, I will explain about how to create our own Back End Component in joomla.
This reminded me when I first started with Joomla development, in back-end this is almost the same, no need to use the class, just echo will do the job.
ReplyDeleteWhat a small TUT !!!
ReplyDelete;(( ;-(
i used Joomla 3.2.1 latest version.
ReplyDeleteI follow you instruction about create component but i not success. why?
Did you get any errors?
DeleteThis comment has been removed by the author.
Deleteyes, i got message errors like this
DeleteComponent not found
i think it's error because i did not installing component, right?
Deletebut i don't know how to install component too. i go to admin page and brow to extensions and i see upload and install joomla extension and i see browse button too (i don't know what kind of file should i instal, can you let me know?)
Thanks
Screenshots are very helpful to know the concept clearly. now i understand how to create front end component in joomla.
ReplyDeleteNice blog.You have given very helpful information. Am really proud of you.
ReplyDelete