Answer the question
In order to leave comments, you need to log in
How to get Contacts component elements from other components/pages in Joomla 3.x?
Own subject ))
It is required on the main page to get all the elements of a certain category of the Contacts component to work with them.
Preferably through the api of Joomla itself?
Answer the question
In order to leave comments, you need to log in
Found the answer on the Internet
JModelLegacy::addIncludePath(JPATH_SITE . '/components/com_contact/models', 'ContactModel');
$model = JModelLegacy::getInstance('Contact', 'ContactModel', array('ignore_request' => true));
$appParams = JFactory::getApplication()->getParams();
$model->setState('params', $appParams);
$model->getItem($id)
And watched as in the component the list of contacts is deduced???
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question