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.
Create a file "mycomponent.php" inside the "com_mycomponent" folder.
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.,
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