Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Better CSS
I’m not really sure why CSS in Textpattern relies on the separate css.php file that is included in the core files, but even more so that it is called actually on the page where your css is, eg. /textpattern/css.php?n=mystylesheet
What I think would really make things better is if natively Textpattern had all CSS files stored in the database like they are now AND also saved to a directory like rvm_css, and then have them called them in this manner /?css=mystylesheet
if being called from the DB and /css/mystylesheet.css
if called directly from the static version on the server. Perhaps even have an option in preferences to turn on the static files if certain users dislike it?
In addition to this, native support for JavaScript files could also be a good one, or perhaps the ability to incorporate JS files using a plugin based on the same concepts brought forth for the CSS.
This is something that has being bothering me for a while, and would love to see implemented, as it would be much cleaner. Your thoughts?
~ Cameron
Offline
#2 2009-07-26 03:25:37
- TheEric
- Plugin Author
- From: Wyoming
- Registered: 2004-09-17
- Posts: 566
Re: Better CSS
There’s lots of stuff that bothers you about TXP evidently.
Offline
Re: Better CSS
theming is coming up Cameron
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: Better CSS
Saving to both the database and a file introduces a level of redundancy and may also introduce confusion because they are in two places (where to edit, via ftp, via interface…, make sure synced). But essentially you can make the decision yourself based on how you want it (I’m often adapting the setup to fit the needs of the respective site and users):
- Use files and put them in a
/css/
directory and call them directly. - Use rvm_css, which was conceived for just this purpose.
- Add an entry to your htaccess to make links formed as /css/ call
/textpattern/css.php?n=mystylesheet
.
Last edited by jakob (2009-07-26 08:51:53)
TXP Builders – finely-crafted code, design and txp
Online
Re: Better CSS
driz wrote:
What I think would really make things better is if natively Textpattern [..] have them called them in this manner
/?css=mystylesheet
Care to explain in what regard this particular way of constructing the CSS’s URI would be beneficial?
Offline
Re: Better CSS
I was wondering the same thing: that’s “better” about this implementation?
Kinda seems like change for change’s sake to me.
Keith
Blyth, Northumberland, England
Capture The Moment
Offline
Re: Better CSS
I’m guessing consistency, because apart from static things like images, everything else is using index.php. The reason for having the separate css.php may have been efficiency. Why load a huge chunk of code, when only a small bit is needed for serving CSS.
Offline
Re: Better CSS
Well consistency is one factor for having better URLS. Second linking to a file inside the textpattern folder exposes it and makes it awkward if you want to change the name of the installation.
~ Cameron
Offline
Re: Better CSS
SVN currently has css.php outside the textpattern folder, alongside index.php.
Offline
Re: Better CSS
ruud wrote:
SVN currently has css.php outside the textpattern folder, alongside index.php.
What is the purpose of having the CSS.php file at all? Why isn’t it part of the actual core files? Their are two CSS.php files as well one outside TXP and then one inside TXP which link to each other.
wet wrote:
Care to explain in what regard this particular way of constructing the CSS’s URI would be beneficial?
Just cleaner and fits in better with the URL schemes produced by Plugins. Its better IMO to be just simply dynamic using the ? rather requiring the linkage to the actual php file(s) used for the creation of the CSS. ExpressionEngine uses this very same idea for the exact same reasons.
Last edited by driz (2009-07-26 20:02:18)
~ Cameron
Offline
Re: Better CSS
css.php was moved outside the textpattern folder to enable the multi-site capabilities in 4.2. The css.php inside the textpattern folder is for backward compatibility, I believe.
Offline
Re: Better CSS
My confusion here is that CSS to rendered using <txp:css n="lorem" />
so if someone was to move the CSS.php file, their would be no need to worry about backwards compat because the linkage is left in the hands of TXP and NOT the user creating the link themselves right?
But I still dont understand why their is a separate file for PHP? Why is the code for it not included with the rest of code for images/links/files/pages/sections etc.
~ Cameron
Offline