Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#11 2008-01-02 10:19:36
- jstubbs
- Moderator
- From: Hong Kong
- Registered: 2004-12-13
- Posts: 2,394
- Website
Re: rvm_css (v1.2)
BTW – does not work in error_default pages. I had this which did not work:
<!-- CSS -->
<txp:rvm_css format="link" n="default" />
<txp:rvm_css format="link" n="menu" />
Changed it back to:
<!-- CSS -->
<link rel="stylesheet" href="<txp:css n="default"/>" type="text/css" />
<txp:css format="link" n="menu" />
Works again.
Offline
#12 2008-01-02 10:29:38
- ruud
- Developer emeritus
- From: a galaxy far far away
- Registered: 2006-06-04
- Posts: 5,068
- Website
Re: rvm_css (v1.2)
How does it not work? What URL do you see for the style sheet in the HTML code?
Offline
#13 2008-01-02 11:06:03
- jstubbs
- Moderator
- From: Hong Kong
- Registered: 2004-12-13
- Posts: 2,394
- Website
Re: rvm_css (v1.2)
I actually use two forms – “header” and “header_error” – first one for normal pages and the second one goes in error_default page.
In the header form:
<!-- CSS -->
<txp:rvm_css format="link" n="default" />
<txp:rvm_css format="link" n="menu" />
Produces:
<!-- CSS -->
<link rel="stylesheet" type="text/css" media="screen" href="http://www.mysite.com/css/default.css" />
<link rel="stylesheet" type="text/css" media="screen" href="http://www.mysite.com/css/menu.css" />
With the same rvm_css tags in the header_error form, I get this:
<!-- CSS -->
<link rel="stylesheet" type="text/css" media="screen" href="http://www.mysite.com/css/default.css" />
<link rel="stylesheet" type="text/css" media="screen" href="http://www.mysite.com/css/default.css" />
Its picking up the default.css but not the menu.css.
Offline
#14 2008-01-02 18:43:16
- ruud
- Developer emeritus
- From: a galaxy far far away
- Registered: 2006-06-04
- Posts: 5,068
- Website
Re: rvm_css (v1.2)
Neil and Jonathan, try version 0.3 of the plugin (see first post). That should fix both problems.
As for stm_javascript… it’s probably best to ask that plugin author to add this functionality, which would be more efficient (in code size) than creating an companion plugin for stm_javascript.
Offline
#15 2008-01-02 20:27:33
- Pat64
- Plugin Author
- From: France
- Registered: 2005-12-12
- Posts: 1,236
- Website
Re: rvm_css (v1.2)
Just one word : fabulousssssssssssssssssssssss!
;p
Have a very good new year Ruud.
:)
Patrick.
G+
Github | CodePen | Simplr theme
Offline
#16 2008-01-02 20:46:28
- jstubbs
- Moderator
- From: Hong Kong
- Registered: 2004-12-13
- Posts: 2,394
- Website
Offline
#17 2008-01-02 20:49:59
- zero
- Member
- From: Lancashire
- Registered: 2004-04-19
- Posts: 1,139
- Website
Re: rvm_css (v1.2)
Would this be worthwhile if using a php styleswitcher? I have this code in the head of the page. I can change txp:css but how would I alter the other code and would it be any good anyway?
<style type="text/css" media="screen,projection">
@import "<txp:site_url />textpattern/css.php?n=default";
</style>
<txp:php>
global $prefs;
$cookie_s1 = cs('s1');
$cookie_s2 = cs('s2')
;
if ($cookie_s2) {
echo n.'<link rel="stylesheet" type="text/css" media="screen,projection" href="'.hu.'textpattern/css.php?n='.$cookie_s2.'" />';
}
if ($cookie_s1) {
echo n.'<link rel="stylesheet" type="text/css" media="screen,projection" href="'.hu.'textpattern/css.php?n='.$cookie_s1.'" title="'.$cookie_s1.'" />';
}
</txp:php>
<txp:css format="link" rel="alternate stylesheet" media="screen,projection" n="c" title="cool" />
<txp:css format="link" rel="alternate stylesheet" media="screen,projection" n="w" title="warm" />
etcetera
Wondrous Healing 3 wondrous ways to a healthy old age
Safe Reiki Harmless natural healing.
Offline
#18 2008-01-02 21:14:41
- ruud
- Developer emeritus
- From: a galaxy far far away
- Registered: 2006-06-04
- Posts: 5,068
- Website
Re: rvm_css (v1.2)
peter, you’re loading 3 – 5 style sheets so rvm_css would give a huge speed increase (saves 3 – 5 times the overhead of starting PHP and TXP to get a style sheet). The fact that your template contains a PHP style switcher doesn’t matter. It’s not the switching part that benefits, but the speed of loading the individual stylesheets:
@import "<txp:rvm_css n="default" />";
and replace <txp:css
with <txp:rvm_css
in all other places (see plugin help for other steps required after installation).
Offline
#19 2008-01-02 22:32:55
- zero
- Member
- From: Lancashire
- Registered: 2004-04-19
- Posts: 1,139
- Website
Re: rvm_css (v1.2)
Brilliant! Thank you, Ruud! It’s all working great!
Wondrous Healing 3 wondrous ways to a healthy old age
Safe Reiki Harmless natural healing.
Offline
#20 2008-01-03 13:30:38
- net-carver
- Member
- From: UK
- Registered: 2006-03-08
- Posts: 1,648
Re: rvm_css (v1.2)
Ruud
thank you for yet another useful plugin.
Quick question: should plugins or mods assume the directory separator character is ‘/’ or should they use the DS
definition of a directory separator as defined in constants.php
? AFAIK, Windows uses ‘\’ as its path separator.
I’d like to know because I do use the ‘DS’ definition for directory separators in some of my own plugins and just wondered what the developers take on it is.
In fact, is the ‘DS’ is even needed at all (ie can Windows survive a ‘/’ separated file path without choking.)?
Many thanks in advance,
— Steve
Textile | My plugins on GitHub | @netcarver
Offline