I'm designing a custom component where I am utilising the tmpl=component
ability to render the component only rather than displaying the default template.
How can I remove the unwanted css files which are creating a styling conflict, from the site's head, within the component ?
I use this codes and insert after defined('_JEXEC') or die;
//get the array containing all the script declarations
$document = JFactory::getDocument();
$headData = $document->getHeadData();
$styles = $headData['styles'];
//remove your script, i.e. mootools
unset($styles['/administrator/templates/isis/css/template-rtl.css']);
$headData['styles'] = $styles;
$document->setHeadData($headData);
and this code
unset($this->item->_styles[JURI::root(true) . '/administrator/templates/isis/css/template-rtl.css']);
but , these code not work
I want to delete administrator/templates/isis/css/template-rtl.css
from custom component source and head.
JFactory::getApplication()->enqueueMessage(json_encode($document->getHeadData()), 'info');
Does this give us any clues?