Friday, June 14, 2013

Joomla 2.5 Frontend Table – Step1

In previous posts I tried to share my knowledge about joomla frontend custom form.In this chapter I’m going to show how to show data table in frontend and some operations in that data table ex:- Search,Filter etc.

I’m presenting this based on my previous posts about Joomla Frontend Custom Form Developing (Step 1, Step 2, Step 3).

In this part lets create the table.I’m creating mrl_region table for this example.it contain 3 columns id,Name and userid.Bellow is sql query for creating table and inserting data.I’ve used “mrl” prefix for table.This is the prefix I gave on joomla installation.   

I hope to continue this lesson using com_myresourcelist which I used to my pervious blog posts.

Let’s name our table as Regions.Add controller class as regions.php to components/com_myresourcelist/controllers folder.

Add model class as regions.php to components/com_myresourcelist/models folder.

Next we’ll create view for our table.For that create regions folder on com_myresourcelist/views.Then tmpl folder inside regions folder.Make sure to add empty index.html file on each newly created folder.

Add view.html.php to com_myresourcelist/views/regions folder.

Create following files inside com_myresourcelist/views/regions/tmpl folder.

default.xml

default.php

default_head.php

default_body.php

default_foot.php

Now you have finished front end table.Create new menu item for our table.Select Menu Item type as Regions Table .

By clicking new menu item in the front end you will see the table as follows.

table

Next post we’ll see how to filter table data.