Skip to main content
Share Your Experience: Take the 2024 Developer Survey
2 votes
Accepted

Plugin to manipulate form data onContentBeforeSave

onContentBeforeSave is used to determine whether the item can be saved. The plugin should return a boolean value. The data, as you've noticed, is an array and is not passed by reference. So changes ...
Sharky's user avatar
  • 11.4k
1 vote
Accepted

How to set and use a global variable within a content plugin?

Normally plugins in Joomla are instantiated only once per request. So using a class member variable is the cleanest solution: use Joomla\CMS\Event\Content\ContentPrepareEvent; use Joomla\CMS\Plugin\...
Sharky's user avatar
  • 11.4k
1 vote

What are some options to show different parts of an article to different users?

In the past I have used Articles Anywhere from Regular Labs, https://regularlabs.com/articlesanywhere, to do something that sounds similar to what you are describing. The common information is placed ...
Irata's user avatar
  • 3,947
1 vote
Accepted

Joomla 4 Plugin to overwrite value of a custom field

I finally found the solution. I had to switch to a system Plugin. There inside the onAfterRender() function I can grab the whole body and the document title and replace the marker - like this: public ...
cappu's user avatar
  • 139
1 vote

Custom plugin doesn't even seem to load on Joomla 4

Why do you use a capital in your filename? It's something you questioned yourself already. Could you rename the file from Test.php to test.php? And change <filename plugin="Test">Test....
pe7er's user avatar
  • 2,058
1 vote
Accepted

How to use Openlayers transpiled Javascript code in my own extension (a "bundle")

I found a way to solve the problems myself and I will share them here: Problem 1) You can either embed your Javascript code in a jQuery(document).ready(function) event handler or, you can simply use ...
SoaringBird's user avatar
1 vote
Accepted

How can a Joomla 3x "content" plugin determine which page it is on?

To answer your question, add a fourth optional argument to your onContentPrepare method. This will be the page number. public function onContentPrepare($context, $item, $params, $page = 0) Note that ...
Sharky's user avatar
  • 11.4k
1 vote
Accepted

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

You need to make a decision: either you do this server-side or client-side. Server side requires a plugin written in php, while the client side a script written in Javascript. I would only use the ...
Riccardo Zorn's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible