Questions tagged [plugin]

A plugin is a kind of Joomla! extension. Plugins provide functions which are associated with trigger events.

Filter by
Sorted by
Tagged with
1
vote
1answer
26 views

What is the different between JPlugin and \Joomla\CMS\Plugin\CMSPlugin

I was learning plugin development when I came across this. so for some plugin, I see class pluginA extends JPlugin for some others, I see class plgGantryEasyblog extends \Joomla\CMS\Plugin\...
1
vote
0answers
18 views

Getting user submitted product properties programmaticaly in j2store

So I'm developing j2store plugin to calculate price for item based on product's width and height (these values are entered by the user). The form is rendered as following: function ...
0
votes
0answers
23 views

How to update database module params

Could someone kindly help please? I'm creating a plugin and part of its job is to automatically add a 'Menu Class Suffix' to a chosen menu. I know it can be done manually from the advanced tab of ...
0
votes
1answer
27 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 ...
1
vote
1answer
79 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 ...
2
votes
1answer
43 views

Transfer Custom Code to Module / Plugin / Component

Joomla 3.9.12 I've been using Sourcerer in order to place custom code throughout my site, it's working well so far. I've created a custom html module, within this I have added PHP, JS, HTML and CSS. ...
1
vote
1answer
26 views

how to route url - JRoute get wrong itemid and wrong sef url

Joomla 3.9.12, JoomGallery 3.4 I have a site with joomShopping for e-shop and JoomGallery for portfolio. The site has 2 menus where some menu items of the first are menu item aliases of the second. ...
2
votes
1answer
28 views

Joomla4 plugin getBody

In Joomla 3.x versions I use JResponse to get and set the body. function onAfterRender() { $content = JResponse::getBody(); ... } But in Joomla4 it returns Class 'JResponse' ...
0
votes
0answers
19 views

Install from web tab fails installation

Install from Web tab initially returned a blank page in both Firefox and Chrome. I disabled then uninstalled plugin. When I click on "Add Install from Web" button, I get the following: Error ...
0
votes
2answers
38 views

How do create an update for your existing Joomla plugin I've written?

I've written a simple Joomla plugin that I've been using for a year. I want to write an update for it. It would change what is in the .xml file and some code in the .php file. How do I go about ...
0
votes
1answer
27 views

How to add a field to com_content in the backend?

I'm confused about this. I want to add a field to the com_content core component that needs to show up under the "Title" field in the administrator backend when you edit an article and of course to be ...
0
votes
3answers
51 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 ...
0
votes
0answers
29 views

Use a Field value in a Query (Seblod Query plugin)

I'm using the Query plugin that lets me create a Query field on my List & Search. I have a hidden field with ID 'id_number' which I'm trying to use in my query. When I check the Page Source(Ctrl+...
2
votes
0answers
37 views

__PHP_Incomplete_Class when trying to access an object stored in session

I work on implementing single sign on with joomla and simplesamlphp. I try to use the simpleamlphp api in the context of a joomla plugin in the onAfterInitialise event. To that end, the plugin in ...
1
vote
1answer
19 views

No Documentation about onCustomEditorButton

I want to add a custom button to the TinyMCE editor. But the documentation about this feature is non-existsten as you can see here: https://docs.joomla.org/Plugin/Events/Editor#onCustomEditorButton ...
2
votes
1answer
33 views

Override JHtml (HTMLHelper) class methods

I'm developing a custom Joomla template and have unset a lot of the core dependencies, such as jQuery and Bootstrap in the template's index.php. The problem now is that the core extensions call some ...
3
votes
1answer
56 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 ...
0
votes
0answers
26 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 ...
1
vote
0answers
53 views

FieldsPlugin onCustomFieldsPrepareDom $field on save different on front and backend

I currently develop a FieldPlugin for myself. I noticed some things and don't understand them fully right now. My plugin works in the backend perfect, but raises errors on the frontend, so I did some ...
1
vote
2answers
43 views

How to add the alias to the body in a plugin

I am trying to use JavaScript to add a class to the body which is the same as the current menu items alias. I have echoed $prefix and it is correct. So I know that part works. I have dumped the ...
1
vote
1answer
44 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 = ...
3
votes
1answer
30 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: ".$...
3
votes
0answers
50 views

Joomla and Eventbrite Integration

I am looking for a way to integrate Eventbrite with Joomla. I want to show a list of upcoming events that I have created. There are a number of default widgets available with Eventbrite (copy / paste ...
1
vote
1answer
16 views

What is the best approach to implementing a component that responds to events?

I am working on a Component that will add a set of administrative functionality, which I am fairly confident in, but part of its behaviour will rely on code being triggered by events, which seems to ...
0
votes
2answers
36 views

How to change the site language by country IP

I try create system plugin for auto change language by IP. I don't have idea how to correctly write code so as not to receive an infinite loop of redirection requests. My code class ...
-1
votes
1answer
104 views

Simple plugin to check folder contents on component update

I'm wanting to make a very simple plugin. All it needs to do is On installation of the plugin, copy a folder to a particular component's library folder. When a particular component library is ...
1
vote
1answer
150 views

From outside of a component how to change a parameter

In a system plugin, I am using the onAfterRoute event to change a single parameter from a 3rd party component before being loaded. public function onAfterRoute() { if ('com_abc' == JFactory::...
3
votes
1answer
80 views

How to adjust search keyword sanitization settings as language override?

I am working on some custom search plugins and I have a 2-part question regarding the file administrator/components/com_search/helpers/search.php. I want to adjust the sanitization settings without ...
3
votes
1answer
51 views

Where are plugins found in Joomla 4?

I'm working with the Joomla 4 alpha 7, and I don't see anywhere to enable / disable plugins. Are plugins not enabled yet? [edited to add alpha, not beta!]
0
votes
1answer
58 views

Any way to redirect (301) pages for unpublished articles/links (404)?

I am wondering if where is any way in joomla to solve following issue: I am having URLs (articles) which may have been externally linked Now I want to disable this links (unpublish) but if I ...
2
votes
2answers
235 views

Using external PHP library and defined('_JEXEC') or die;

I want to use hatemile-for-php library (https://github.com/hatemile/hatemile-for-php) in my plugin. As I am only ever using this library within this one plugin, I included it in the plugin folder ...
2
votes
1answer
185 views

How to integrate google reviews into the page?

I am searching for a option to integrate Google Reviews in Joomla so that: I can show the reviews easily to vistors of the page (e.g. in a module) I can give google these review to show in the search ...
2
votes
1answer
54 views

How to check by onContentAfterSave it is a article?

I have follow code for after save: public function onContentAfterSave ($context, $article, $isNew) { $article = JModelLegacy::getInstance('Article', 'ContentModel')->getItem(); .... } It works ...
0
votes
1answer
86 views

roksprocket disable article tags

I am using roksprocket as a simple to use filter system of articles. Sadly I could not find a way to disable the badly looking tags underneath the modules itself. Of course there is a possible to use ...
3
votes
2answers
69 views

How properly save foreign characters in plug-in config parameters

I am developing a Joomla! authentication plugin and have a standard Joomla! install (J3.9.1) with PHP 7.2 and MySQL 5.6.29. My plugin has config parameters that are accessible via the backend. One of ...
0
votes
1answer
35 views

Add a message after saving an article

Based on this question:. https://joomla.stackexchange.com/a/24042/8968 I want to add the return code as a message after save to see if it was successful or not. Can someone tell how I can do this?...
1
vote
3answers
43 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 ...
1
vote
1answer
82 views

onAfterRender plugin issue

Both the PHP and the JS is tested and works in a module. But there's really no need for a module this is a plugin. I'm quite new to this so I thought onAfterRender would work, but nothing seems to ...
0
votes
1answer
74 views

Use the “sql” form field type in extension xml only if the table exists

I developed a plugin for Joomla!, and I have the below sql parameter field in my sampleplugin.xml <field name="cb_fields" type="sql" label="Select CB fields" query="SELECT name ...
4
votes
1answer
174 views

How to make my Editor plugin (type: editors-xtd) survive after updates?

I have a project that I am writing a component, module, and editor plugin for. I have managed to piece together a rudimentary plugin that works with TinyMCE (at least) which: Displays a custom ...
4
votes
1answer
82 views

Custom message after plugin installation

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 ...
1
vote
1answer
93 views

Joomla! extension/plugin for creating productbundles in an onlineshop

We looked up for a solution to create a product bundle in the frontend of our webshop. Yet we haven't found any solution that enables the User to "create a product bundle". Currently we are using the ...
1
vote
2answers
94 views

Avoid login from onUserAuthenticate

I'm trying to dismiss the login if my $completed var is false. I can make it work with die() but I wan't to know how to do this correct, so that the user gets returned to the login page with a error ...
0
votes
1answer
28 views

How can I display a message based upon the value of a config item

I'm trying to show a warning based on robots being set to noindex or nofollow. I've copied the PHP Version quickicons plugin. Here's my php file. <?php /** * @package Joomla.Plugin * @...
1
vote
1answer
62 views

How to use “onUserAfterLogin” Event?

I want my users to get an email when they login for the first time. I am thinking to create an array to store userids that have logged in before. When users login, compare their userid with the array, ...
1
vote
1answer
28 views

How does Joomla initialise all active libraries and plugins?

I'm trying to import Joomla in a Yii application. It goes well, but some plugins and libraries are not loaded. Does anyone know how to achieve this? Something like JPluginHelper::loadAllActivePlugins(...
1
vote
2answers
44 views

What are the differences of Joomla modules vs components vs plugins?

A very basic question probably... But what are the differences in Joomla terms between: module components plugins If I am a developer for Joomla what and why should I name it a module, component, ...
3
votes
1answer
138 views

Caching items with different cache lifetime

I'm looking into using Joomla's caching mechanism for a plugin. However I would need to cache the plugin data for a given period of time irrespective of the site-wide cache settings. Is it possible ...
0
votes
1answer
112 views

How can I programmatically install a plugin?

How could you do programmatically what Joomla does when you install a plugin? Let's say, for simplicity's sake, that you have a plugin package file local with your Joomla instance. A solution might ...
0
votes
1answer
79 views

Own field type in subform, using with content plugin

for curiosity: I'm using this method to add fields to the standard articles: https://docs.joomla.org/Adding_custom_fields_to_core_components_using_a_plugin/de I have to use this, since the fields-...