Welcome Guest, Not a member yet? Register   Sign In
Working with a Template & Rewriting CSS & JS
#4

[eluser]ChangedNames[/eluser]
I'm not sure I understood your first reply.

[quote author="herrkaleun" date="1220236171"]with this code, at least all css files can be keeped OUTSIDE of the theme folder
and the particular images and HTML's and all the nasty theme shit, can be located
in it.[/quote]

I'm keeping my css and js files INSIDE what you are calling the "theme" folder. I simply created a folder called "template" in system>application>views that holds my theme php, css, js, and image files. I've actually reworked my htaccess and now it looks more like this (not the full contents):
Code:
RewriteRule ^(.*)$ index.php?/$1 [QSA]
RewriteRule ^images/(.*) /ci/system/application/views/template/images/$1
RewriteRule ^css/(.*)\.css /ci/system/application/views/template/css/$1.css
RewriteRule ^js/(.*)\.js /ci/system/application/views/template/js/$1.js  [L]

I was using a php file handler for some debugging purposes but now I have no need for that. I just reference directly to the template folder I have. This way if anyone wants to see my css, js, or images they can navigate to http://mysite.com/css/something.css as opposed to my system folder (which I actually renamed). The files are still physically in the folder listed above which directly would be http://mysite.com/ci/system/application/...ething.css.

So far this is working perfectly for me and all of my paths are absolute to the server (beginning with a forward slash "/").

If it helps this is what my htaccess file looks like currently:
Code:
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /ci/
  RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico)
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?/$1 [QSA]
  RewriteRule ^images/(.*) /ci/system/application/views/template/images/$1
  RewriteRule ^css/(.*)\.css /ci/system/application/views/template/css/$1.css
  RewriteRule ^js/(.*)\.js /ci/system/application/views/template/js/$1.js  [L]
</IfModule>


Messages In This Thread
Working with a Template & Rewriting CSS & JS - by El Forum - 08-17-2008, 11:00 AM
Working with a Template & Rewriting CSS & JS - by El Forum - 08-31-2008, 03:29 PM
Working with a Template & Rewriting CSS & JS - by El Forum - 08-31-2008, 04:42 PM
Working with a Template & Rewriting CSS & JS - by El Forum - 08-31-2008, 09:49 PM



Theme © iAndrew 2016 - Forum software by © MyBB