October 17, 2012

October 17, 2012
9
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.


9 comments:

  1. 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.

    ReplyDelete
  2. i used Joomla 3.2.1 latest version.

    I follow you instruction about create component but i not success. why?

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
    2. yes, i got message errors like this

      Component not found

      Delete
    3. 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

      Delete
  3. Screenshots are very helpful to know the concept clearly. now i understand how to create front end component in joomla.

    ReplyDelete
  4. Nice blog.You have given very helpful information. Am really proud of you.

    ReplyDelete