A
A
Arthur2016-03-02 12:54:15
PHP
Arthur, 2016-03-02 12:54:15

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

2 answer(s)
A
Artur, 2016-03-02
@astralo

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)

joomla.stackexchange.com/questions/189/how-can-iu...
stackoverflow.com/questions/9795485/jmodel-error-w...

V
Valera Karmanov, 2016-03-02
@motokraft

And watched as in the component the list of contacts is deduced???

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question