Jump to content

add new files to head


Recommended Posts

hi and thanks for stopping by.

first of all, im completly new to ps and still looking for best practices and stuff like that.

so my shop is in dev mode, no cache, compile forced.

 

and now i simply try to modify the header, for example load another css file. on every page.

 

so i place a file in override/controllers/FrontController.php (even thought there is no such file in /controllers/FrontController.php, but i tried it with IndexController.php with the same luck).

 

the file contains

<?php
class FrontController extends FrontControllerCore {
public function setMedia()
{
 parent::setMedia();
 Tools::addCSS(_THEME_CSS_DIR_.'zomg_front.css');
}
}

 

with no php closing tag.

but nothing happens. no new css file gets loaded, even thought it is there, just waiting to get loaded.. searched the web and it looks like the right way, but no luck..

Link to comment
Share on other sites

so today i tried the same with another site (productController) and that works like a charm. and, so god will, i retried it on the index and now it works. seems like every first time you try something out, it wont work, just because you start thinking how complex everything is.

 

anyways, my next question would be, if there are files that manipulate the site globally?

i inserted some code into IndexController, but these changes wont appear on productController.. is there a way..?

 

plus how can i control all the stuff loading?

on product there are these files loaded:

<link href="/themes/theme/css/global.css" rel="stylesheet" type="text/css" media="all" />
 <link href="/themes/theme/css/product.css" rel="stylesheet" type="text/css" media="all" />
 <link href="/css/jquery.fancybox-1.3.4.css" rel="stylesheet" type="text/css" media="screen" />
 <link href="/themes/theme/css/modules/blockpaymentlogo/blockpaymentlogo.css" rel="stylesheet" type="text/css" media="all" />
 <link href="/themes/theme/css/modules/blockcart/blockcart.css" rel="stylesheet" type="text/css" media="all" />
 <link href="/themes/theme/css/modules/blockmyaccount/blockmyaccount.css" rel="stylesheet" type="text/css" media="all" />
 <link href="/themes/theme/css/modules/editorial/editorial.css" rel="stylesheet" type="text/css" media="all" />
  <script type="text/javascript" src="/js/jquery/jquery-1.4.4.min.js"></script>
 <script type="text/javascript" src="/js/jquery/jquery.easing.1.3.js"></script>
 <script type="text/javascript" src="/js/tools.js"></script>
 <script type="text/javascript" src="/js/jquery/jquery.fancybox-1.3.4.js"></script>
 <script type="text/javascript" src="/js/jquery/jquery.idTabs.modified.js"></script>
 <script type="text/javascript" src="/js/jquery/jquery.scrollTo-1.4.2-min.js"></script>
 <script type="text/javascript" src="/js/jquery/jquery.serialScroll-1.2.2-min.js"></script>
 <script type="text/javascript" src="/themes/theme/js/tools.js"></script>
 <script type="text/javascript" src="/themes/theme/js/product.js"></script>
 <script type="text/javascript" src="/modules/blockcart/ajax-cart.js"></script>

 

i mean: who knows? maybe i dont need fancybox, maybe i dont need scrollTo.. maybe i want jquery 1.7.2. i dont want that stuff to be loaded, i want my own theme..

Edited by jnz31 (see edit history)
Link to comment
Share on other sites

of course i could exclude the whole function in the header.tpl, but since these files get pulled out automatically on a contextual basis i wonder what files are really needed by presta and what files are, lets call it theme-specific..?

 

i guess some modules hook into that "pull out" function too, so if i disable it..?

Edited by jnz31 (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...