Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

New answers tagged

2

Basically you needed to use onContentAfterSave rather then onContentBeforeSave and use the FieldsHelper in conjuction with the FieldsModelField. Here is the code: <?php defined( '_JEXEC' ) or die( 'Restricted access' ); class plgContentAlertcustomfieldhandler extends JPlugin { public function onContentAfterSave($context, &$article, $isNew) { ...


2

You can throw an Exception: if ($date > $now) { throw new RuntimeException(JText::_('PLG_CONTENT_MYPLUGIN_SOME_ERROR')); } Or use setError() on the table object: if ($date > $now) { $article->setError(JText::_('PLG_CONTENT_MYPLUGIN_SOME_ERROR')); return false; }


0

I came to the conclusion that it is need to specify menu itemid as a parameter. If the menu has only one item associated with JoomGallery, then it can be obtained automatically. If several, then it is necessary to specify force in shortcode params. For example, plugin shortcode now is {jgcat catid=123 itemid=194 tmpl=bootstrap4}. Then php code parses plugin ...


0

For the purpose you are describing, your best bet is to create your own Joomla custom library. It's a type of Joomla extension alongside with plugins, modules and components, allowing you to put your custom common code. There is not much examples in Joomla documentation but Roberto Segura (phproberto) made an awesome example of a custom library available on ...


Top 50 recent answers are included