Create Front End Component in Joomla - Step by step procedure

PHP CMS Frameworks October 17, 2012 9 comments
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 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.


Comments · 9

?
Anonymous
13 August 2013 at 06:51
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.
?
Unknown
10 December 2013 at 05:26
What a small TUT !!!

;(( ;-(
?
Toeur Tenh
25 December 2013 at 01:06
i used Joomla 3.2.1 latest version.

I follow you instruction about create component but i not success. why?
?
PHP CMS Frameworks
25 December 2013 at 04:43
Did you get any errors?
?
Toeur Tenh
25 December 2013 at 17:09
This comment has been removed by the author.
?
Toeur Tenh
25 December 2013 at 17:15
yes, i got message errors like this

Component not found
?
Toeur Tenh
25 December 2013 at 18:23
i think it's error because i did not installing component, right?

but 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
?
Unknown
18 January 2014 at 03:06
Screenshots are very helpful to know the concept clearly. now i understand how to create front end component in joomla.
?
Interesting Facts
18 June 2014 at 23:29
Nice blog.You have given very helpful information. Am really proud of you.