Created
July 11, 2013 00:23
-
-
Save AmyStephen/5971447 to your computer and use it in GitHub Desktop.
System Plugin - onBeforeCompileHead - you can walk through any assets for the head. Where the head is rendered https://github.com/joomla/joomla-cms/blob/9c576378b4809a245f6fcf18bdbbd00baa4f7ac2/libraries/joomla/document/html/renderer/head.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function onBeforeCompileHead() | |
{ | |
$head = JFactory::getDocument()->getHeadData(); | |
$styleSheets = $head['styleSheets']; | |
$newStyleSheets = array(); | |
foreach ($styleSheets as $key => $value) | |
{ | |
if (/** test if you want it */) | |
{ | |
$newStyleSheets[$key] = $value; | |
} | |
} | |
$head['styleSheets'] = $newStyleSheets; | |
JFactory::getDocument()->setHeadData($head); | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment