Custom message after plugin installation

by sbruemmer   Last Updated December 06, 2018 10:10 AM

After an installation process, the translated manifest description from the sys.ini-file is shown in the Extension Manager. Unfortunately this text is also shown while editing the (published) plugin parameters.

/plugins/system/my_plugin/manifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<extension type="plugin" version="3.8" group="system" method="upgrade">
<name>PLG_NAME</name>
<description>PLG_DESCRIPTION</description>

/plugins/system/my_plugin/language/en-GB/en-GB.plg_system_my_plugin.sys.ini

PLG_DESCRIPTION="This text is shown after installation AND as description of enabled plugins"

Is it possible to shown a custom message after installation/update in the Extension Manager? And only at this point.

Thanks in advance!



Answers 1


Yes, absolulety possible. You have to create/use an install script.php file in your installable plugin folder, which will include tasks on different points of installation, uninstallation, update, preflight or postflight tasks:

For a module a script class would look like this:

class mod_helloWorldInstallerScript
{

    public function __construct(JAdapterInstance $adapter) 
    {
    // construct here.....
    }

    // install, preflight functions here

    // In this function you can display your custom message in
    // the Extension Manager after install ie.     
    function postflight($type, $parent) 
    {
        echo '<p>Anything here happens after the installation/update/uninstallation of the module</p>';
        echo JText::_('PLG_DESCRIPTION');
    }

}

Same for plugins... except you call the class: plg_mypluginInstallerScript

You can study this subject more here: https://docs.joomla.org/J3.x:Creating_a_simple_module/Adding_an_install-uninstall-update_script_file

or here at the bottom of this page: https://docs.joomla.org/Manifest_files

Zollie
Zollie
December 06, 2018 09:54 AM

Related Questions


Plugin description translation

Updated June 30, 2018 12:10 PM