ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

CSS Filename and Editor Issues and Request for Best Practice Advice

April 22, 2008 4:12pm

Subscribe [5]
  • #1 / Apr 22, 2008 4:12pm

    Raymond Brigleb

    21 posts

    So I’m on a Mac and I’ve been using ExpanDrive to edit my templates (stored as files on my SFTP-accessible server) with my preferred software. This lets me use other software as if I were using Coda - and it’s better, to me, because I much prefer CSSEdit and TextMate to Coda. Much better. There’s even a TextMate bundle for working with EE templates!

    It’s the way to go.

    However, all the CSS files end up being stored as something like site_css.php on the server. So when I open them, my software doesn’t realize it’s CSS. TextMate doesn’t style the document properly, and CSSEdit won’t even let me open the files! This is less than ideal.

    I could put them in /images on my site, and link to them manually in the HEAD of my page templates, rather than using EE’s nice tags to include the CSS. That way, they’d have the proper filename, and everything would work like I want it to.

    But I’m wondering, is there a better way to do this? Any suggestions? Or is mine the best way to go?

  • #2 / Apr 22, 2008 4:21pm

    adamwiggall

    178 posts

    I don’t use the EE css method. I keep mine as proper css files in their own folder linked in the traditional way, one because it is easier for the reasons you have stated (I use TextMate) and two, because the boys at Jambor-ee recommended it too (before they took their site off-line).

    I don’t know about performance issues though? I don’t notice any.

  • #3 / Apr 22, 2008 10:35pm

    ak4mc

    429 posts

    I moved my CSS to a file long ago because I wanted to use it on my site’s static pages as well.

  • #4 / Apr 22, 2008 11:48pm

    Raymond Brigleb

    21 posts

    Thanks everyone. I ended up just putting all the CSS and JS files in an /include folder. Saw no good reason not to, since EE doesn’t have any fancy feature to compress and/or bundle those files for me. And they’re much easier to edit when they have the correct filename extension!

  • #5 / Apr 25, 2008 12:15pm

    Raymond Brigleb

    21 posts

    One last follow-up. I moved all the CSS files back. It’s not perfect, but in order to build my site to hide the index.php in the url - something that’s absolutely essential IMHO - I had to have the CSS served as templates, with the .php extension, apparently.

    Definitely a compromise, and less than ideal. For some reason, the JavaScript files seem fine where they are. But the CSS files were causing no end of headaches until I moved them back into the templating system.

  • #6 / Apr 25, 2008 12:39pm

    Ben Johnson

    29 posts

    Oh, by the way, the new version of CSSEdit will allow you to open stylesheets with a .php extension.

  • #7 / Apr 25, 2008 12:43pm

    Andy Harris

    958 posts

    The idea of creating CSS outside of EE appeals to me loads, for mainly the same reasons as above (Textmate). But I also need the index.php to do one - is there a way to get this working?

    That said, I can’t understand why it wouldn’t just work as surely all you’re doing is going old skool with the links…?

    Maybe I’ll give it a try and see what happens.

  • #8 / Apr 25, 2008 1:42pm

    Greg Salt

    3988 posts

    One last follow-up. I moved all the CSS files back. It’s not perfect, but in order to build my site to hide the index.php in the url - something that’s absolutely essential IMHO - I had to have the CSS served as templates, with the .php extension, apparently.

    Hi,

    I’m not sure that this is correct. We remove index.php from the URLs on all our sites and we always use static CSS files. What issues were you having with this? My guess is that this is a problem with your server setup and not with EE per se.

    Cheers

    Dry

  • #9 / Apr 25, 2008 2:03pm

    Raymond Brigleb

    21 posts

    Well, this is what I’m using for my .htaccess. I know there’s three ways to do this I’ve seen, and this eventually worked best for me.

    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php?/$1

    For whatever reason, it just wasn’t seeing the CSS in the /include folder I was using, and I was just using a vanilla HTML setup to include it (no EE template tags or anything)... I do think it’s weird that the JavaScript works fine from there, however. Maybe it has to do with the content type?

  • #10 / Apr 25, 2008 2:13pm

    Greg Salt

    3988 posts

    I don’t think so unless perhaps there are some unusual characters in your CSS files. The file and directory check .htaccess method you are using is exactly the same as ours. There must be another reason but it’s pretty hard to debug without more information. What exactly is your folder structure for your static CSS files and what is your link tag for the CSS?

    Dry

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases