0
votes

I'm trying to display a Joomla 2.5 component in a module. In my module entrypoint I have:

JLoader::import('joomla.application.component.model');
JLoader::import( 'quizzes', JPATH_SITE . '/components/com_questions/models' );
JLoader::import('joomla.application.component.controller');

if (!class_exists('QuestionsControllerQuizzes')) {
    require_once (JPATH_SITE . DS . 'components' . DS . 'com_questions/controllers' . DS . 'quizzes.php');
}

$quiz_controller = new QuestionsControllerQuizzes(false, $params->get('poll'));

$quiz_controller->execute( JRequest::getVar('task','load') );

I tried to debug it and it seems that can't load the correct view. Seems to looking for a generic com_content in $this->basePath.

The strange thing is that if I load the module in a page where the component is loaded, it display correctly.

Any idea how to succesfully display the component output in a module?

1

1 Answers

0
votes

Try this: How to display Joomla component in a module

and remember your controller should include a function for the task!