Template library and css, js path - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Template library and css, js path (/showthread.php?tid=36226) |
Template library and css, js path - El Forum - 11-25-2010 [eluser]Massimiliano Marini[/eluser] Hi all, I'm using the Phil Sturgeon template libray and I'm using themes, but I don't know where to put css and js folders with relative files, example css/style.css and js/scripts.js This is my currently theme path: Code: /application/themes/default/views/layouts/default I've inserted the css folder here (in the same path of views folder): Code: /application/themes/default/css but when I use append_metadata nothing happen: Code: $this->template->append_metadata('<link rel="stylesheet" href="/css/layout.css" type="text/css" />'); I've tried with different css folder path, but nothing ... where I'm wrong? Template library and css, js path - El Forum - 11-25-2010 [eluser]CroNiX[/eluser] try putting your css in your root. /site_root -/css -/js -/system (ci) -index.php then make the links like you did above with "/css/layout.css". If the URL starts with a / its relative to site_root. Template library and css, js path - El Forum - 11-25-2010 [eluser]Massimiliano Marini[/eluser] Hi CroNiX, yes, if I put all files in a root folder it works as expected, but what I want to create is a theme folder with all these files inside. I'm using HMVC and I've created this folders path Code: /application/themes/my_theme/views/layouts/default.php What I want to do is a simple theme folder (in this case "my_theme") with all the files css, js, partials and layouts, the last two are ok, but I can't include or link css and js files with Code: $this->template->append_metadata('<link rel="stylesheet" href="path/to/css/style.css" type="text/css" />') Is it possible? I think yes but not sure 100%. I'm sure I'm doing something wrong, but I don't know where. Any help will be welcome. Template library and css, js path - El Forum - 11-26-2010 [eluser]InsiteFX[/eluser] Get Phil's Asset Library! [email=https://github.com/philsturgeon/codeigniter-asset]Asset Library[/email] InsiteFX Template library and css, js path - El Forum - 11-26-2010 [eluser]Massimiliano Marini[/eluser] Hi InsiteFX, exactly what I was looking for! Thanks |