The Techjoomla Blog

Stay updated with all the latest happenings at Techjoomla. From news about the developments in your favourite extensions to Tips & Tricks about the Joomla CMS, Framework & Development.

Adding Plugin triggers in your extensions. How & Why?

Adding-Plugin-triggers-in-your-extensions.-How--Why-

Why have plugin triggers?

The ability to add Plugin Triggers in your Joomla extensions, is a great asset to developers which is not always used to the fullest extent.. Having various Plugin events in your extension means that you give other developers the ability to extend your extension, or modify it to suit their requirements without having to hack core files. The same logic that is used by Joomla content plugins or JomSocial plugins etc can also be applied to your extensions.

Use of Plugin triggers when hacking/ modifying extensions

At Tekdi Web Solutions we do a lot of Joomla Service & get client needs to modify extensions left & right. Where possible this is always done using Plugins & overrides. But the time comes when a hack has to be made. To reduce the impact, instead of modifying the whole extension, we just add plugin triggers where needed & usually send back the modifications to the original developer where possible. This serves two purposes. One is that the code maintenance is way easier & its very easy to document & identify these small hacks. Secondly, there is always a chance that if the main dev accepts your patch, these "hacks" might become regularised in the future.  Even if they aren't, it's still much easier to re-patch the extension with plugin triggers.

So in order to share this knowledge, I asked one of our Developers, Shantanu to write a small blog about how you can go about adding triggers. Shantanu is just one of the new bloggers I shall be introducing to this blog in the next few weeks. So stay tuned for more!
Over to Shantanu for the same! Read on to read the full blog!

Parth Lawate

Continue reading
8
  25328 Hits
  0 Comments
25328 Hits
0 Comments