Questions tagged [plugin-events]

For questions regarding plugin-events: events in Joomla and non-core extensions where you can hook into to change its behavior

Filter by
Sorted by
Tagged with
0 votes
1 answer
57 views

PHP: Need to know how to trigger onContentAfterSave on existing article

I have what I thought would be a simple challenge: to automate publishing an article and trigger the onAfterContentSave event for saving the article. This code ultimately has to run within another ...
Bruce S's user avatar
0 votes
1 answer
119 views

Overwrite Site Model getListQuery

I have a System Plugin to filter Joomla 4 Category Blog Articles by Custom Fields. The Plugin basically overrides the core content ArticlesModel by loading it in the onAfterRoute Event like this: ...
cappu's user avatar
  • 115
0 votes
3 answers
82 views

Unloading once loaded plugin in Joomla 4

So when doing this i can import a Plugin and run an event on it: PluginHelper::importPlugin('mygroup', 'myplugin'); Factory::getApplication()->triggerEvent('onMyEvent', ['some' => 'stuff']); If ...
maidan's user avatar
  • 383
0 votes
1 answer
62 views

onAfterDispatch is getting called differently

I have a system plugin that is doing something very simple. The issue is that locally it works fine, but on a live server the events seam to be differing and the plugin is not getting triggered. Both ...
maidan's user avatar
  • 383
1 vote
1 answer
76 views

Plugin Events - how are they helpful in a real life?

There's a knowledge base for one Joomla component and it contains a whole bunch of Plugin Events. Text files with a code, basically. I wonder how they can be used in a real life an what for? Would it ...
papakota's user avatar
1 vote
1 answer
50 views

Difference between triggerEvent and dispatch

What is the difference between: $result = $app->triggerEvent('onMyEvent', [$context, &$table, $data]); and this: $app->getDispatcher()->dispatch('onMyEvent', AbstractEvent::create( '...
maidan's user avatar
  • 383
2 votes
2 answers
146 views

Register Plugin/Class Joomla

We have a custom login plugin which extends the CMSPlugin. I am trying to register the Class of the plugin inside a module but the following scenarios occur. Case 1 JLoader::register('...
anthi_p's user avatar
  • 57
0 votes
0 answers
17 views

modal popup just after login

I am new to the Joomla world and I have to face a difficult problem. I have to make sure that immediately after logging in to the user, a modal popup with a select box is proposed. The content of the ...
Muflo's user avatar
  • 1
1 vote
1 answer
119 views

cant display simple text onContentPrepare

I just want to display simple text and this is not working. I don't know is there a way to see something like log to see what happens in the background? public function onContentPrepare($context, &...
Husen's user avatar
  • 11
0 votes
1 answer
32 views

Does on after save work with the API call?

I want to listen to when an article has been changed and then send a request to a webhook. If it was manually being entered then I could do an onAfterSave plugin. Will this work with an API call? ...
Eoin's user avatar
  • 1,889
1 vote
1 answer
638 views

How to access the plugin event in Joomla 4

plugin code defined( '_JEXEC' ) or die; use Joomla\CMS\Plugin\CMSPlugin; use Joomla\CMS\Event\Event; use Joomla\Event\SubscriberInterface; class PlgMygroupMyplugin extends CMSPlugin //implements ...
MaXX's user avatar
  • 161
1 vote
1 answer
48 views

Plugin for two types of events from different plugin types

AS written here Plugin types determine which events a plugin can react to. I am now in the process of enabling 2 tasks. First via installer that does a check before update a download id and second I ...
Marco's user avatar
  • 551
0 votes
0 answers
60 views

Contact backend on before store process

I am using Joomla 3.9.22. On the back end contact form, I want to make check on the submitted data. I tried to make a plugin but with no luck. I have found the onSubmitContact event, but it does not ...
Christoforos's user avatar
2 votes
1 answer
60 views

How to redirect in software after logout

I am seeking a way to trigger a redirect on user logout. One obvious way to do this seems liable to cause problems. The event of logout can be used to trigger a plugin using the event onUserLogout. It'...
mbrampton's user avatar
  • 314
0 votes
1 answer
106 views

Can plugins listen to events in different groups?

I'm trying to trigger some actions for example when a content article is saved (using onContentAfterSave) or when a event from jEvents (https://www.jevents.net/) is saved (using onAfterSaveEvent). The ...
Exprove's user avatar
  • 123
0 votes
1 answer
67 views

Render a template after a specific route by using system plugin

I am facing a problem to render a template after hitting a specific route. Let me describe it a bit. I have a template structure like- templates |__mytemplate |__|__index.php |__|__component.php |__|...
Sajeeb Ahamed's user avatar
0 votes
1 answer
41 views

How can I place a module position in the midpoint of my content no matter what size

I want to put a call to action in the middle of my content no matter what size the content it. I know I will need some JavaScript in order to calculate the word count and the mid point. And I know I ...
Eoin's user avatar
  • 1,889
0 votes
1 answer
108 views

When exactly is onContentPrepareData triggered?

According to https://docs.joomla.org/Plugin/Events/Content, it is Called after the data for a JForm has been retrieved. It is not very clear when exactly the event is triggered. Based on the ...
shenkwen's user avatar
  • 1,369
0 votes
0 answers
77 views

Which Event to include in User Plugin that fires on Save button in Plugin manager?

My user plugin, "Myplugin", works. I have extra parameters in the plugin that can be set in the Plugin Manager (Menu: Extensions / Plugins / MyPlugin). Those are stored in the database when using the ...
PWRM's user avatar
  • 1
0 votes
1 answer
131 views

How to add an error message when returning false in the onContentBeforeSave event?

I work in a functionality in which I must validate some fields before saving, if a condition is not met I must indicate abort the save process, according to the documentation of the ...
user615274's user avatar
3 votes
1 answer
832 views

How to programmatically set the value of a custom field of type checkbox?

In articles, I have created a series of custom fields, including two date fields and a checkboxes field. Now, through a plugin in the onContentBeforeSave event I need to verify that if date 1 is less ...
user615274's user avatar
0 votes
1 answer
119 views

Listening for a "image upload" event

I want to be able to programatically keep track of new images that have been added, so that I can periodically run a script that does something with the new images. My idea is to have a plugin that ...
William's user avatar
  • 299
0 votes
3 answers
79 views

Limiting onContentAfterSave to one result

First of all, I'm quite new to creating my own modules and plugins (and very much in learning stages!) and I find the help here excellent and very inspirational - thank you. I'm trying to create a ...
JJBW's user avatar
  • 43
4 votes
1 answer
136 views

How is onContentAfterSave working in the Front End?

I have created a plugin that works using onContentAfterSave to fire off some other processing once a record is saved. This works as expected in the Back End but nothing gets triggered when I save a ...
Irata's user avatar
  • 3,467
3 votes
1 answer
114 views

Content plugin doesn't add text to articles

I have the following plugin written: defined( '_JEXEC' ) or die( 'Restricted access' ); jimport( 'joomla.plugin.plugin' ); class plgContentModifyArticle extends JPlugin { function ...
Cowboy_Patrick's user avatar
1 vote
0 answers
43 views

Adding an alias to the body class by appending it to the existing alias

I have successfully managed to add the alias to the body class by creating a plugin. It uses vanilla JS and isn't overly problematic except when I combine and compress my JS it stops working. I'm ...
Eoin's user avatar
  • 1,889
2 votes
1 answer
994 views

Updating JEventDispatcher triggers

Can anyone explain or point me to information on the new way to handle events in Joomla 4? I'm updating a component that uses triggers to display plugins, and it looks like this: $dispatcher = ...
user101289's user avatar
  • 1,119
3 votes
1 answer
68 views

Why is my plugin not hooking into events?

I have a plugin that looks like this: class plgExtensionLogInstall extends JPlugin { function onExtensionAfterInstall($installer, $extensionId) { JLog::add("Extension installed: ".$...
glenatron's user avatar
  • 239
0 votes
2 answers
125 views

How to use plugin content-events on featured contacts page

Using the content event onContentPrepare() within a plugin in the contexts of 'com_contact.category' and 'com_contact.contact' works fine. But the following code doesn't output anything on a page ...
sbruemmer's user avatar
1 vote
3 answers
71 views

Develop a System Plugin with Sample Data for Options

I'm in the process of developing a system plugin. In the options is a subform-field (repetable), which contains several fields. In the "default" of the subform I can specify a record. a) How can I ...
Lukas's user avatar
  • 13
2 votes
1 answer
126 views

How does Joomla! event system (plugins) avoid namespace conflicts?

As I understand, to use Joomla! plugin events from my user code, I first need to load the plugin class (which registers the named functions as events in the event dispatcher): JPluginHelper::...
webstackdev's user avatar
0 votes
1 answer
90 views

Including Results from API Call in Joomla! Search Results

My organization uses Joomla! for its customer facing site. There is a database that I only have REST API access to. I'm trying to ping that API to include results from it alongside the normal Joomla! ...
ragingprog's user avatar
3 votes
1 answer
163 views

onUserAfterLogin popup - Joomla 3.6.4 Plugin

I need to create a plugin that displays a popup when an user makes a log in on my Joomla 3.6.4 website. I know that I need to create a Plugin and trigger the onUserAfterLogin event, but I don't know ...
OlafGizursson's user avatar
0 votes
0 answers
116 views

Custom Joomla plugin to catch specific database queries

Is it possible to make a plugin which will get triggered by specific database events in Joomla? I need to watch the $this->getTable() request in Joomla. For eg: $table = $this->getTable(); if (...
Perino's user avatar
  • 667
1 vote
1 answer
87 views

search component/plugin in joomla

I am new to joomla! and would like to design a custom search plugin to search through my database. I know that when using the default search, the onContentSearch() function is triggered and "search ...
Farrokh Yousefi's user avatar
1 vote
1 answer
103 views

How to control the execution order of the same event?

I would like to know if it's possible to control the order of the execution of the same event in several plugins. For example, I have the event event1 in 2 plugins, and I want the plugin1 execute the ...
remi leclercq's user avatar
1 vote
1 answer
50 views

onAfterModuleList not triggered in Home or in Wrapper menu type?

I got a plugin that uses the onAfterModuleList event, it works fine on most menu types. But it doesn't seem to be triggered in neither home or wrapper menu types. Event though there are modules ...
edger's user avatar
  • 23
1 vote
2 answers
630 views

Event for saving Custom Fields data? Or before save

I am looking for the event is triggered when saves or just before the com_fields custom field saves the data? Also, is there any where I can find the list of all com_fields event trigger the ones I ...
user5294803's user avatar
1 vote
1 answer
1k views

renderField with fields from custom plugin

I need to expand the functionality of the registration form. Following some tutorials and the sample profile plugin I was able to use the onContentPrepareForm to add the new fields. Now the second ...
chavab_1's user avatar
  • 195
1 vote
1 answer
177 views

How to stop (or 'untrigger') a Joomla event, for example onUserLogin

Using J3.7.2 with MySQL 5.7.14 and PHP 5.6.25. I have built a Joomla user plugin (let's name it "My_Plugin") which does all the things that the default Joomla user plugin "User-Joomla" does, plus some ...
RobHU's user avatar
  • 63
0 votes
1 answer
231 views

How to remove rel="nofollow" with Joomla Buffer?

I am developing a plugin to get rid of any rel="nofollow" on HTML links using a buffer, but its not working. I am testing it with a nofollow link on a Custom HTML Module. I thought that "JFactory::...
user1967509's user avatar
2 votes
1 answer
269 views

Is there an event for saving a menu item?

I'm trying to create a plugin that fires when a menu item is saved, but I'm having trouble finding an event to listen to. Sor far I have function onContentAfterSave() { ...
ContextSwitch's user avatar
0 votes
3 answers
346 views

How to remove specific articles from blog view using a plugin custom code. Its possible? How?

I would like to prevent some specific articles from being shown on com_content blog view and featured articles view. For example, if the article has a specific ID that I seted on code like "27" he ...
user1967509's user avatar
1 vote
1 answer
54 views

Logout within plugin interfering with other plugins

I have a user plugin which performs some tasks and then logs the user out using $app->logout($userID, []);. This is intentional and part of the plugin's functionality, and works well if no other ...
Simba's user avatar
  • 610
2 votes
1 answer
25 views

Unable to update deploy server url during postflight event

When I install myplugin the very first time, it should update the location column in #__update_sites table with updated string which includes the API key. I'm unable to update at first install as I ...
112233's user avatar
  • 121
2 votes
1 answer
42 views

native voting for events of events booking plugin

I am using the events booking plugin and struggle with some issues for voting. How can I enable the native joomla 5 star rating for events, like I can use for articles? It would also be good to use ...
helle's user avatar
  • 153
4 votes
1 answer
1k views

Trigger event for specific plugin only

Is it possible to trigger a event for specific plugin? I can load a specific plugin $loaded = JPluginHelper::importPlugin('my_component', 'my_plugin_1'); But when I trigger an event, all the ...
xavip's user avatar
  • 273
1 vote
0 answers
321 views

Why use ob_start and eval instead of using a simple include in this Joomla Plugin?

I was looking at the code of a Plugin for Joomla! CMS for a functionality I need: the possibility to run custom PHP scripts when a Joomla! Plugin/Events is fired. I wanted to learn the mechanism used ...
Gruber's user avatar
  • 302
4 votes
1 answer
454 views

Is there an event like "OnAfterCompileHead"?

As per title, is there already an event that can work like a sort of OnAfterCompileHead? Maybe onAfterDispatch, onAfterRender or onBeforeRender? I need to change some meta tags in the <head> ...
Gruber's user avatar
  • 302
0 votes
1 answer
105 views

Event Booking - Javascript error on function

I started having a strange error on some pages. The website has been working fo the last 3 years with no problem. We sell IT courses and have pages for both individual and group registration. Group ...
Antonio's user avatar
  • 161