Quantcast
Channel: Joomla! Forum - community, help and support
Viewing all articles
Browse latest Browse all 1920

Joomla! 5.x Coding • Re: Upgrading Extensions and Plugins to use "new methodology"

$
0
0
I've updated the gmap plugin at https://drive.google.com/file/d/13771Pm ... drive_link

I've updated it to use more recent Joomla mechanisms - see https://manual.joomla.org/docs/building ... ent-plugin for a plugin similar to yours.

However, I think it would have been ok at Joomla 5 at least.

You should really check the application context (site / administrator / api) in the plugin (which I've added) and also the context (eg "com_content.article") (which I haven't added), as onContentPrepare gets triggered in different application contexts and by different components (eg com_contact as well).

The updated module is at https://drive.google.com/file/d/1Eelh8z ... drive_link
To avoid compatibility problems I think you just needed to replace JFactory by its namespaced equivalent. These mappings are in the classmap.php file:

In libraries/classmap.php in Joomla 4

In plugins/behaviour/compat/src/classmap/classmap.php in Joomla 5

I've added the module namespacing to the helper file, but you don't really need this as you never call it.

At some point you should move to using the Web Asset Manager for managing your js code. I'm going to update the basic module tutorial and include how to do that - should be available at https://manual.joomla.org/docs/building ... s/modules/ shortly.

Statistics: Posted by robbiej — Thu Apr 25, 2024 8:52 pm



Viewing all articles
Browse latest Browse all 1920

Trending Articles





<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>