For reasons beyond the scope of the question, I want to be able to effectively (but not actually do a redirect based on various parameters.
If the request IS index.php?option=com_something&view=default
I want Joomla to display index.php?option=com_alternate&view=override
as if (in every respect) that was the original request to begin with.
Can a system plugin accomplish this? And if so, on which event?
EDIT For clarity of requirement, this sample pseudo-ish code programmatically demonstrates what I'm envisioning. Before spending hours or days, I'm "checking the premises" of my intended approach.
// Effective Redirect to com_content (as an example component) without classic redirecting
class plgSystemMySystemPlugin extends JPlugin
{
public function on[Before|After][SOME-SYSTEM-EVENT]() {
jimport('joomla.application.component.view');
$options = array(
'name' => 'article',
'base_path' => JPATH_SITE.'/components/com_content'
);
$view = new JView($options);
$view->addTemplatePath(JPATH_THEMES . '/' . JFactory::getApplication()->getTemplate() . '/html/com_content/' . $view->getName());
// Set Item, Itemid, etc. somehow here
$view->display();
JFactory::getApplication()->close();
}
}
onAfterRender
oronBeforeRender
event is coming to my mind regarding this question suddenly.