This is an step by step information to create advance joomla component. Students and Newbies who want to learn and create component development they can use this slide as an reference.
Joomla! User Network Ahmedabad organizing a 4 days Joomla! workshop for students to teach joomla development. In this workshop we are going to teach joomla component, module and plugin development. This event will be organized at School of Computer Studies, Ahmedabad University in association with AESICS-CSI Student Branch. Event organized by School of Computer Studies, Ahmedabad University and Joomla User Network Ahmedabad Team. For more details visit our Facebook page at https://www.facebook.com/jugAhmedabad
Mattingly "AI & Prompt Design: Large Language Models"
Develop advance joomla! MVC Component for version 3
1. Develop Advance Joomla! MVC Component
for version 3.x
Gunjan Patel
Sr. PHP Developer
Joomla! Bug Squad Member
Joomla! SQL Optimisation team coordinator
Google Summer Of Code 2014 Mentor
Joomla! User Network Ahmedabad
3. Time to play with the Database
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
4. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Create two files:
1. admin/sql/install.mysql.utf8.sql
2. admin/sql/updates/mysql/0.0.6.sql
Important:
#__schemas table will be used
for upgrades
5. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Adding a new field type: type="helloworld"
Field file path
Field Custom Type:
helloworld
Notice that it was
Before list
6. Let’s create field at admin/models/fields/helloworld.php
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Parent field type
Same as filename
File Name should be same as
Field type name
Class name prefix
Should be same as filename
7. Continue with… admin/models/fields/helloworld.php
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Overriding parent class for
HTML select list options.
Get Database Object
Joomla Query Language
functions
Looping to create options array
JHTML options type value text
8. Display the chosen message from field type in
menu using Database Table
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
9. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Create the admin/tables/helloworld.php file
Table Name
Primary Key
10. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Modify the site/models/helloworld.php file
Return the table instance
Add new getTable function
11. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Modify the site/models/helloworld.php file
Update getMsg function to get
Message from Database
Get message id from request.
Notice that here we are not using
$_POST or $_GET
Load table data from auto increment id
14. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Create the admin/helloworld.php file
15. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Create the general controller admin/controller.php file
Set Default view of
component
Component prefix.
Typically name of
component
16. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Create the view admin/views/helloworlds/view.html.php file
Parent ClassView NameComponent
Name as class prefix
Call Model get Item
function and pagination
function to support
pagination
17. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Create the layout admin/views/helloworlds/tmpl/default.php file
18. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Create the sub-layout
admin/views/helloworlds/tmpl/default_head.php file
19. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Create the sub-layout
admin/views/helloworlds/tmpl/default_body.php file
20. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Create the sub-layout
admin/views/helloworlds/tmpl/default_foot.php file
21. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Create the Model admin/models/helloworlds.php file
Parent class for listing
Function of joomla.
getListQuery function
return query object
23. • Language files naming conventions:
–For components
• en-GB/en-GB.com_helloworld.ini
–For Menus
• en-GB/en-GB.com_helloworld.sys.ini
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Adding Language Translation Files
24. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Language File Naming Pattern
For Example:
en-GB : Language code for English (UK)
gu-IN : Language code for Gujarati (India)
hn-IN : Language code for Hindi (India)
<language code>-<country code>
25. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Language File Naming Pattern
For Example:
en-GB : Language code for English (UK)
gu-IN : Language code for Gujarati (India)
hn-IN : Language code for Hindi (India)
<language code>-<country code>
<language code>-<country code>.com_<component_name>.[type].ini
For Example:
en-GB.com_helloworld.ini
gu-IN.com_helloworld.ini
----------------------------------------
en-GB.com_helloworld.sys.ini
Gu-IN.com_helloworld.sys.ini
26. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Language String Pattern
For Example:
COM_HELLOWORLD="Hello World!"
COM_HELLOWORLD_DESCRIPTION="This is the Hello World description"
COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE="Hello World"
COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC="This view displays a selected message"
COM_HELLOWORLD_MENU="Hello World!"
<language_key>=“<language_string_value>”
27. Language File Location Options in
helloworld.xml file
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
28. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Language File Naming Pattern