Get module id or header

I am using Joomla 3, I have a module called " Who we Are " and it appears in the " top_row2 " position . I am trying to get module ids and module names.

After searching, I found several solutions that don't seem to work for me.

Solution 1

jimport( 'joomla.application.module.helper' );
$module = JModuleHelper::getModule('Who we Are');
echo $module->id;

      

Solution 2

jimport( 'joomla.application.module.helper' );
$module = JModuleHelper::getModules('Who we Are');
echo $module->id;
//Note the "s" in getModules

      

Solution 3

    global $module;
    $module->id;
    $module->title;

      

I am using these solutions to override the PHP files of this module.

Location :: templates \ corporate_report \ html \ mod_mymodule_item.php

+3


source to share


1 answer


You can define your own unique class in the "Class class suffix" section, and on the module override element page, follow the condition to check which module is displayed on the page



+2


source







All Articles