Welcome Guest, Not a member yet? Register   Sign In
Template library and css, js path
#1

[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?
#2

[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.
#3

[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.
#4

[eluser]InsiteFX[/eluser]
Get Phil's Asset Library!

[email=https://github.com/philsturgeon/codeigniter-asset]Asset Library[/email]

InsiteFX
#5

[eluser]Massimiliano Marini[/eluser]
Hi InsiteFX,

exactly what I was looking for!

Thanks




Theme © iAndrew 2016 - Forum software by © MyBB