how to create custom module in joomla 2.5? Reviewed by Momizat on . Basic Structure of module Note:-no any file or folder should be empty Any folder media folder index.html css folder index.html js folder index.html images folde Basic Structure of module Note:-no any file or folder should be empty Any folder media folder index.html css folder index.html js folder index.html images folde Rating: 0

how to create custom module in joomla 2.5?

Basic Structure of module Note:-no any file or folder should be empty

  • Any folder
    • media folder
      • index.html
      • css folder
        • index.html
      • js folder
        • index.html
      • images folder
        • index.html
    • tmpl folder
      • index.html
      • default.php
    • helper.php
    • index.html
    • mod_mymod.php
    • manifest.xml

manifest.xml structure

<?xml version="1.0"?>
<extension type="module" version="3.0.0" method="upgrade">
  <name>mymod</name>
  <author>Manish</author>
  <version>1.0.0</version>
  <description>This is my file</description>
  <media destination="mod_mymod" folder="media">
    <folder>js</folder>
    <folder>css</folder>
    <folder>images</folder>
  </media>
  <files>
    <filename module="mod_mymod">mod_mymod.php</filename>
    <filename>index.html</filename>
    <filename>helper.php</filename>
    <folder>tmpl</folder>
    <filename>manifest.xml</filename>
  </files>
</extension>

mod_mymod.php

<?php
defined('_JEXEC') or die('Access Deny');
jimport('joomla.application.module.helper');
require_once(dirname(__FILE__).'/helper.php');
require(JModuleHelper::getLayoutPath('mod_mymod'));
?>

helper.php

<?php
defined('_JEXEC') or die('Access Deny');
class modMymodHelper{

}
?>

tmpl/default.php

<?php 
defined('_JEXEC') or die('Access Deny');
$doc=JFactory::getDocument();
//$doc->addStyleSheet(JURI::root().'media'.DS.'mod_mymod'.DS.'css'.DS.'default.css');
//$doc->addScript(JURI::root().'media'.DS.'mod_mymod'.DS.'js'.DS.'custom.js');
?>
testing module

Comments (1)

Leave a Comment

© 2014 Powered By