Skip to content

Instantly share code, notes, and snippets.

@betweenbrain
Created May 10, 2012 12:20
Show Gist options
  • Save betweenbrain/2652727 to your computer and use it in GitHub Desktop.
Save betweenbrain/2652727 to your computer and use it in GitHub Desktop.
How to add assets to a Joomla template
$doc = JFactory::getDocument();
$doc->addStyleSheet('templates/' . $this->template . '/css/screen.css','text/css','screen');
$doc->addCustomTag('<meta name="author" content="Matt Thomas, matt@betweenbrain.com" />');
$doc->addFavicon('templates/' . $this->template . '/favicon.png','image/png','shortcut icon');
$doc->addScript('https://raw.github.com/LeaVerou/prefixfree/master/prefixfree.min.js');
$doc->addStyleSheet('http://fonts.googleapis.com/css?family=ubuntu');
$doc->addStyleDeclaration(' body {font-family: "Ubuntu", serif;}');
$doc->addCustomTag('<!--[if lt IE 9]>');
$doc->addCustomTag('<script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>');
$doc->addCustomTag('<![endif]-->');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment