Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

  1. Index
  2. » Plugin support
  3. » rvm_css (v1.2)

#61 2008-04-10 17:07:55

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: rvm_css (v1.2)

I believe the idea behind a CMS is that you manage your content through the CMS instead of through alternate methods, so the plugin assumes you edit CSS through TXP. The storage method should not affect how you deal with the CSS. People generally don’t modify CSS in the database without using TXP and although this is easier for static files, I think the same thing applies there.

If you prefer managing CSS files through FTP, it’s probably easier not to use TXP at all for CSS and only use FTP. Nothing wrong with that.

It’s not impossible to do what you want, but I have no plans to implement this.

Offline

#62 2008-04-10 19:55:22

merz1
Member
From: Hamburg
Registered: 2006-05-04
Posts: 994
Website

Re: rvm_css (v1.2)

Ruud Thanks for the straight answer. Basically I agree :)


Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML

Offline

#63 2008-06-09 14:45:59

jordi
Member
From: Barcelona
Registered: 2005-09-14
Posts: 94
Website

Re: rvm_css (v1.2)

I have just installed this and the immediate feeling (no measurements yet) is that the pages load much faster. Great!!

A couple of comments for any newbie who wants to try it: upon installation, the plugin creates a field called “Style directory” in the Admin section under Advanced prefs., and populates it with “css”. In my case I had to change this to /css I was all wrong. Default is right.

Also, I have had to set permissions for this directory as 777, as any other setting did not work.

Once taken care of this, the plugin works as a charm. Thank you Ruud!

Last edited by jordi (2008-06-23 09:54:46)

Offline

#64 2008-07-13 15:31:47

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: rvm_css (v1.2)

Hi ruud,

when creating a stylesheets and naming it like, for example, “site.base”, it’s is created on the filesystem as “sitename.css”.
There is no “real problem” with these, because even having “different” names (the one in the db has the dot, the one on the filesystem doesn’t), the plug-in works as expected, loading the file using the correct name.

I know it’s probably easier to change my conventions and avoid using a dot, and instead, start using an hyphen.
But, at the same time, if there is any chance to “fix” this, so the created file has exactly the same name as the one on the database.

I will probably also to use cnk_versioning (although you suggest one should stick to one way for editing things on TXP) and maybe this “little problem with dots on stylesheet names” could break the space-time continuum.

Thanks.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#65 2008-07-13 15:39:50

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: rvm_css (v1.2)

There are many characters that are allowed as a style sheet name in the database, but which are not valid file names or could potentially form a file path instead of just a filename (which isn’t desirable from a security point of view). If I change this (allowing the dot), it could break existing installs that use rvm_css.

Offline

#66 2008-07-13 16:02:47

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: rvm_css (v1.2)

Ok, totally understood.
I’ll change the name of stylesheets, if I find any trouble.

Thanks ruud.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#67 2008-07-16 23:17:45

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 976
Website

Re: rvm_css (v1.2)

ruud

With the various Admin makeovers, I know I’ve read a couple of requests to be able to edit Txp’s admin css from Presentation => CSS. I know hpw_admincss did this, but you lose the advantages of a static css, and it doesn’t work on the plugin page.

So, I’ve been wondering about using rvm_css for the job. Of course the php files could be modded to use rvm_css’s current css directory, but I’ve been thinking about how to do it without any modifications outside of the plugin.

As a semi proof of concept I created and installed a second version of rvm_css using a unique prefix, and altered the preference to say “Textpattern Style Directory”. I set it to /textpattern. Then I created a copy of Textpattern’s css in Presentation => CSS.

As expected it works.

Naturally the problem is how to set it up so only textpattern.css copies to /textpattern and not all the styles when updated.

So now that I’ve reached the limits of my php knowledge and playing, I want to ask 1) is it possible to single out just one style (textpattern.css) for export and 2) if so, are there reasons that this would be a bad use of your plugin?

Thanks

Mike

Offline

#68 2008-07-16 23:41:32

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: rvm_css (v1.2)

I think about embedding css style into html – is it possible to some attr, for example, <txp:rvm_css include="1" /> which will produce:

<style type="text/stylesheet">
lala {display: none;}
</style>

In spite of increasing document size we decrease 1 http request. Sometimes on slow channels requests last longer than time is need to download stylesheet.


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

#69 2008-07-17 06:37:31

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: rvm_css (v1.2)

Mike, I think it’s easier to just edit your .htaccess file and redirect requests for textpattern/textpattern.css to a different static file (in the same folder as the CSS files used for the public side). That way you could just create a normal style sheet in the CSS tab (called “textpattern”) and use that just for controlling admin side CSS.

Victor, typically pages consist of more elements than just text and css, so if a slow channel (response time, not transfer speed) causes problems, I don’t think this will matter much, because the CSS will be retrieved at the same time that for example images are retrieved. Most browsers make 2 concurrent connections to a server when retrieving multiple items. By embedding the CSS inside the HTML you save one HTTP request, but add 1 MySQL request (and a base64decode).

My plugin is purely aimed at gaining speed by creating static CSS. If you wanted to create a plugin to embed CSS, it wouldn’t have to store the CSS as a static file. This could be a very small and simple plugin that just returns the CSS contents enclosed in a style tag.

Offline

#70 2008-07-17 07:44:24

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: rvm_css (v1.2)

ruud, i understand your position. But it’s useles if there is 1 css file. But if there are 3-5 css’ it noticeable, is internet is slow, that css aren’t in time by the total page loading. And, one more possible feature – as far as we insert css in html it becomes possible to embed all css’ by one tag request:
<txp:rvm_css name="css1, default, typo, layout" include="1" />

It can be useful.


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

#71 2008-07-17 11:10:51

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: rvm_css (v1.2)

Victor, I won’t do this in my plugin, but since you’re a plugin author yourself, you can easily do this yourself and create a plugin called abc_css_embed (where abc is replaced with your prefix) having just the attribute “name”. All you’d have to to is pull the named style sheets from the txp_css table and output those enclosed in style tags.
People who want embedded CSS probably don’t want the static CSS that my plugin provides (and vice versa), so I think it makes sense to create a separate plugin for this. It’s more efficient (less plugin code to load)

Offline

#72 2008-07-17 13:49:48

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 976
Website

Re: rvm_css (v1.2)

Ruud

Makes sense. Thanks.

Mike

Offline

  1. Index
  2. » Plugin support
  3. » rvm_css (v1.2)

Board footer

Powered by FluxBB