New answers tagged

0

There was a discussion a few years ago about that current access level implementation for plugins should be removed. Instead each plugin should handle authorization inside its code. As most important things in Joomla do, this discussion went nowhere. But you can implement access checks in your plugin anyways. This would be at a small performance cost since ...


0

The good news is that this is a very basic task. I would pass the entire players result set to your view via $this->_item->players. $query ->select("*") ->from($db->qn('#__football_player')) ->where( [ $db->qn('teamid') . ' = ' . $db->q($value), "active = 1" ] ...


0

The below code is mostly from Joomla's /includes/app.php but without the last line. The last few lines then get information about the user and the user session. <?php define('_JEXEC', 1); define('JPATH_BASE', __DIR__); require_once JPATH_BASE . '/includes/defines.php'; require_once JPATH_BASE . '/includes/framework.php'; // Boot the DI container $...


2

To use J4 style or custom naming conventions with AJAX you have to convert the module to new service-based format. At a minimum, service provider (services/provider.php) needs to provide a module extension, a dispatcher factory and a helper factory: defined('_JEXEC') or exit; use Joomla\CMS\Extension\Service\Provider\HelperFactory; use Joomla\CMS\Extension\...


1

I had two extra minutes to test this according to my previous comments under your question. I created a helper.php inside the ArticlesLatest Module (root of that module) and created a class: class ModArticlesLatestHelper This looks simply: <?php /** * @package Joomla.Site * @subpackage mod_articles_latest * * @copyright (C) 2006 Open Source ...


0

Since you are talking about a module, and your code and comments indicate that you are trying to get a specific article by its ID, your module helper should look like: <?php namespace Joomla\Module\YourModuleName\Site\Helper \defined('_JEXEC') or die; use Joomla\CMS\Factory; use Joomla\Component\Fields\Administrator\Helper\FieldsHelper; abstract class ...


0

I'm not sure if you discovered an answer yourself but this is what I do in J4 to get custom fields: use \Joomla\Component\Fields\Administrator\Helper\FieldsHelper; FieldsHelper::getFields('com_content.article', $article); Then you can cycle through the returned fields in your foreach. Hope this helps.


1

Article data is not available in that layout. What you can do is create an override of components/com_fields/layouts/fields/render.php and modify it to pass the article to field/render.php layout. You'd have to change this line: $content = FieldsHelper::render($context, 'field.' . $layout, array('field' => $field)); To this: $content = FieldsHelper::...


Top 50 recent answers are included