20

The AHA! moment - #__content no longer has the params column, so the following adjustments have to be made for the plugin to work with components/tables with attribs instead of params (which appears only to be #__content as of v3.2): Change the fields name to "attribs" Change the fieldset name to something unique (I used the plugin name) Add a language ...


5

Your plugin appears to be written for a very old version of Joomla! The event in current versions is onContentBeforeSave. You are also missing $context argument. It's a good idea to check for context to make sure that you're modifying the correct content type (e.g. article). public function onContentBeforeSave($context, $article, $isNew) { if ($context !...


4

Unfortunately Casseopeia (default Joomla 4 frontend template) uses the following: <jdoc:include type="scripts" /> inside the <head> tags at the top of the DOM, so any script added via $doc->addScript(), HTMLHelper::script() or WebAssetManager will be added up there. That said, loading the file at the top doesn't really matter. You ...


4

The best place would be /layouts/joomla/content/tags.php. But first you need to override this layout by putting it to /templates/your_template/html/layouts/joomla/content/tags.php.


4

I've been using FieldsAttach for this sort of thing, for a few years, the the concepts are clean and eloquent. Brian Teeman explains it well from an integrator point of view in his talk at https://www.youtube.com/watch?v=f2WLKWbRj5U but in some ways it is even more compelling from a developer's perspective. However, after watching Marco Ding's Joomla Day UK ...


3

Add the message attribute, but better like this: <field name="my_code" type="text" size="15" label="My Code" validate="myrule" message="Field may only contain A-z or 0-9" /> :)


2

You can use CSS to hide the field in your form - just check which CSS class (or which id) is assigned to the HTML element that you want to hide (or one of its parents), and then add a CSS rule to hide it (remember, you can select the nth child element of any HTML element through CSS, and then assign the display:none to that element). Having said that, if I ...


2

I would recommend using FieldsAttatch for this, see http://www.fieldsattach.com/ for more info. It is not a full on CCK, but a much lighter system that allows you to add fields to the Joomla content model in a simple an elegant way. The fields Augment the standard joomla content fields and are just editable for the user in or more tabs.


2

Create a simple ajax plugin that handles your user login logic and returns a message for your users. The following 2 files should be zipped together and installed on your site. userlogin.php <?php defined('_JEXEC') or die; // Import library dependencies jimport('joomla.plugin.plugin'); class plgAjaxUserLogin extends JPlugin{ function ...


1

It's not triggering because the class is incorrect. The class of the plugin must correspond to the plugin="" attribute value on the <filename> element in your XML file. It's also case sensitive. Seeing as you have used: <filename plugin="otomoto"> you should replace: class plgContentOtoMotoShortcode with: class ...


1

Create an extension plugin with onExtensionAfterSave event. defined('_JEXEC') or die; use Joomla\CMS\Plugin\CMSPlugin; use Joomla\Registry\Registry class PlgExtensionExample extends CMSPlugin { public function onExtensionAfterSave($context, $table, $isNew) { // Check that we're modifying the correct component. if ($context !== '...


1

Aa vanilla Javascript (faster than jQuery) approch would be as follows: document.addEventListener('DOMContentLoaded', function () { function scrollTo(event) { event.preventDefault(); var id = event.target.getAttribute('href').replace('#', ''); var el = document.getElementById(id); if (el) { el.scrollIntoView(...


1

You can build a Joomla plugin and use the event onContentAfterSave and check if the context is com_banners.banner This tutorial is to help you with building your plugin. When you get to the PHP part, you will write the following code: <?php // no direct access defined( '_JEXEC' ) or die( 'Restricted access' ); // The class name should start with ...


1

CSS and JavaScript are both client-side technologies, so it's enough to put them into your articles or Custom Module and just put appropriate HTML tags around them. With PHP it is impossible because it needs to be executed on the server. When articles are retrieved from DB they are served as content without further post-processing (except content plug-ins). ...


1

Open the file ROOT/administrator/components/com_modules/controllers/module.php, and edit at about line 223 (right after parent::save($key, $urlVar);, and before the closing }) $this->setredirect('index.php'); Disclaimer: This is a core hack, and not recommended. Your changes will be lost when you update Joomla.


1

For an message that may vary, add the message attribute like this: public function test(SimpleXMLElement $element, $value, $group = null, JRegistry $input = null, JForm $form = null) { if(!preg_match('/^[a-z0-9]+$/i', $value)) { $element->addAttribute('message', 'Field may only contain A-z or 0-9'); return false; }elseif(!$...


1

The Controller is the final responsible to check for ACL actions. If you override and implement your own logic, you can disable the check or implement a different control. For example, a disabled ACL check in a re-implemented JControllerForm allowAdd method: protected function allowAdd($data = array()) { // $user = JFactory::getUser(); // return ($...


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