I am creating a joomla system plugin. i want to check if the current page is loading any article.
For this i planned to check if view is article and get the id in that case. But this is not working in case when sef is on.
Is there any way to get this. or how to get non-sef url in case SEF is ON.
This might be too late to answer. :) But others having same issue can use this code- You should use onAfterRoute event in system plugin. try this-
function onAfterRoute()
{
$option = JRequest::getVar('option');
$view = JRequest::getVar('view');
}
This should always catch the 'option' and 'view' part no matter if SEF is on or off. Similarly you can catch other parts of the url.
EDIT: Note for Joomla 3.x you should use JInput
$jinput = JFactory::getApplication()->input;
$option = $jinput->get('option');
$view = $jinput->get('view');