Hot answers tagged

2

MycomponentController class is missing the class prefix. It should be - namespace Example\Mycomponent\Libraries\Controller; use Joomla\CMS\MVC\Controller\BaseController; use Joomla\CMS\MVC\Factory\MVCFactoryInterface; class MycomponentController extends BaseController { public function __construct($config = [], MVCFactoryInterface $factory = null, $app ...


1

As far I am aware, feel free to correct me as I haven't played with Joomla 4 too much, the class naming conventions for controllers, models and views you need to use for Joomla to automatically resolve and load the related classes are the same as Joomla 3 and PSR/4 therefore your Controller and Model class name should be changed to class ...


1

Order by featured column and use descending direction: $model->setState('list.ordering', 'a.featured'); $model->setState('list.direction', 'DESC');


1

Normally fields are added by the Fields plugin. You can trigger onContentPrepare event to run this and other content plugins: JFactory::getApplication()->triggerEvent('onContentPrepare', ['com_content.article', &$article, &$article->params]); Fields will be available via jcfields property on the article object. Another option is to manually ...


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