Now gets the code above and injects it into the for you so that you don't have to manually do it. To import this, you would use something like this: JHtml::_('script', JUri::root(). For example, lets say you has a module that required graph.js. Basically, it gets all the script, link and anything else that is supposed to be injected into the from an extension, and injects it in there for you. is also a requirement and a very handy one at that. To make a Joomla template, you have to have some dynamic elements such as the jdoc tag that imports the component and so forth. Unfortunately Joomla doesn't work like this. Then you can even mix and match the things you need and leverage the mixins and variables already provided by Bootstrap. However it may make more sense to work from the Bootstrap LESS files and compile your own CSS file from it. But never use this call within an extension. This is perfectly fine when done within a template. On a sidenote: You can load the Bootstrap CSS by using JHtmlBootstrap::loadCSS() ( ). So it would maybe make sense to load the bootstrap file using the API, but your own template style (style.css) and JavaScript (main.js) should be loaded hardcoded after the jdoc tag. Then Joomla will take care that it's only loaded once, while otherwise you may have loaded it twice. That is if you load assets which may also be loaded by extensions. There is one reason to still use the API to add JavaScript or CSS files within your template. Instead you just write it as plain HTML into your head after the jdoc statement. However that also means that you don't use $doc->addStyleSheet() in your template. That's important because this way you have the final say over CSS rules. The general rule when doing a template is to load your own CSS files after the. '/js/main.js', 'text/javascript') īut I think the main style that overrides mine come from this line '/media/jui/css/bootstrap-responsive.css') I've this inside my index.php $doc = JFactory::getDocument() I've tried to put some styled tags into my index or as a module under (custom html) but there are some css styles that overriding my css rules so i just want to get rid of everything from joomla and keep my new template clean. I've read some tutorials about how to make a basic template and so on but I really don't have time to put my hand on everything, so I need a fast solution that I can just use all my CSS styling and ignore anything comes from Joomla. I've a static HTML5 and CSS3 website that I created myself from scratch and converting this to a Joomla 3.3 template. I'm creating my 1st new template - very beginner.
0 Comments
Leave a Reply. |