Hi, I am Vishwash Gaur. Today, I am going to present a beginner series webinar on the topic of Component and Module development in Joomla 2.5
There would be an added benefit if you have downloaded, installed and used Joomla! a little bit in prior.In reducing the procedural code issues i.e. lack of code reusability, higher debugging time and more
Modules typically makeup the elements of sidebar or content menus. Module complements the content contained in a component; they are not intended to be main sub-stance of the page.Modules are installed through the admin panel, they don’t manipulate any data from the database all what they do is display the contents on the page like examples on the page.
Module folder is located inside the modules directory of either front end or backend as per the case of development.
Components frequently have sophisticated back-end controls. The back-end is commonly used to create and manage the records from database. In Joomla, Content manager and Banner manager are examples of a component.Convention: Decide structure of component before development i.e. for front end, back end or both – it would allow you easy programming reference during the development.
Modules and Components Introduction in Joomla! 2.5
Basic knowledge of HTML, PHP and MySQL Interest in MVC and CMS frameworks to reduce development time A web server with PHP/MySQL installed on it Joomla! 2.5 package downloaded and installed ◦ it can be downloaded from http://www.joomla.org/download.html NOTE: This presentation is focused for the beginners in Joomla! and would cover only a basic overview due to limited time. Further details can be discussed separately later.
An overview of both theJoomla! Extensions tounderstand thebasics, conventions andstructure.
What is a module? ◦ Modules are lightweight and flexible extensions used for page rendering. These modules are often “boxes” arranged around a component on a typical page. A well-known example is the login module. Why should we use a module? ◦ Can work standalone ◦ Good for code reusability ◦ Can work with component for database linking Conventions ◦ Module name should be in small letters ◦ Module name should have a prefix “mod_”
Depends on template Added in template using below code: ◦ <jdoc:include type="modules" name=“module-positon- name" /> Can be more than one modules on a page
Go to Joomla! Admin Panel Access Top Menu>Extensions>Template Manager Click on options button on the top-right side of the toolbar Enable the “Preview module positions” Go to website front panel and add “?tp=1” to the url ◦ It will reveal the module positions in a Joomla template
http://yoursite.com/index.php?tp=1 Open your page with “?tp=1” at the end of url and it will reveal all Module positions
Mod_modulename – module folder ◦ mod_modulename.xml ◦ mod_modulename.php ◦ helper.php: This helper file contains a class to provide various static functions to perform operations. It could be used to perform some calculation or to fetch data from DB. ◦ index.html: It is an empty file and created to prevent direct access to the directory. ◦ tmpl folder default.php: index.html: It is an empty file and created to prevent direct access to the directory.
What is component? ◦ Components are the main functional units of Joomla!; they can be seen as mini-applications. ◦ A component can contain a module and a plug-in Why should we use a component? ◦ To manage more functional part or application ◦ To provide backend handling to a front-end functionality Conventions ◦ Component name should be prefixed by “com_” e.g. com_componentname ◦ Component name should start with small letters
Depends on template Added in template using below code: ◦ <jdoc:include type="component" /> Can be only one component on a page