2008-01-02 10:19:36

jstubbs
Moderator
omega
Real name: Jonathan
From: Hong Kong
Known languages: en-gb, es-es, fr-fr
Website

Re: rvm_css (v1.0)

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.


TXP Tips | @txptips | Me | @jonathanstubbs | Github

TXP Builders – finely-crafted code, design and txp @txpbuilders

Online

 

2008-01-02 10:29:38

ruud
Developer emeritus
omega
Real name: Ruud van Melick
From: a galaxy far far away
Known languages: li,nl,en,(de)
Website

Re: rvm_css (v1.0)

How does it not work? What URL do you see for the style sheet in the HTML code?

Offline

 

2008-01-02 11:06:03

jstubbs
Moderator
omega
Real name: Jonathan
From: Hong Kong
Known languages: en-gb, es-es, fr-fr
Website

Re: rvm_css (v1.0)

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.


TXP Tips | @txptips | Me | @jonathanstubbs | Github

TXP Builders – finely-crafted code, design and txp @txpbuilders

Online

 

2008-01-02 18:43:16

ruud
Developer emeritus
omega
Real name: Ruud van Melick
From: a galaxy far far away
Known languages: li,nl,en,(de)
Website

Re: rvm_css (v1.0)

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

 

2008-01-02 20:27:33

Pat64
Plugin Author
pi
Real name: Patrick
From: France
Known languages: lang="fr" ; lang="en" read only ; lang="html 5" ; love="TXP" ; thanks="TXP core Developers".
Website

Re: rvm_css (v1.0)

Just one word : fabulousssssssssssssssssssssss!

;p

Have a very good new year Ruud.

:)


Patrick.
Txp Tricks & Tips by french users : http://txp-fr.net | G+
@Devs : Can’t find the punched tape version of TXP and I need it!
Happy user of TXP 1.0RC1

Offline

 

2008-01-02 20:46:28

jstubbs
Moderator
omega
Real name: Jonathan
From: Hong Kong
Known languages: en-gb, es-es, fr-fr
Website

Re: rvm_css (v1.0)

Fixed. Thanks Ruud.


TXP Tips | @txptips | Me | @jonathanstubbs | Github

TXP Builders – finely-crafted code, design and txp @txpbuilders

Online

 

2008-01-02 20:49:59

zero
Member
rho
Real name: Peter
From: Lancashire
Website

Re: rvm_css (v1.0)

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

TXPQ Examples and discussion of Textpattern CMS quality.

Offline

 

2008-01-02 21:14:41

ruud
Developer emeritus
omega
Real name: Ruud van Melick
From: a galaxy far far away
Known languages: li,nl,en,(de)
Website

Re: rvm_css (v1.0)

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

 

2008-01-02 22:32:55

zero
Member
rho
Real name: Peter
From: Lancashire
Website

Re: rvm_css (v1.0)

Brilliant! Thank you, Ruud! It’s all working great!


TXPQ Examples and discussion of Textpattern CMS quality.

Offline

 

2008-01-03 13:30:38

net-carver
Admin
psi
Real name: Steve
From: UK
Known languages: English
Website

Re: rvm_css (v1.0)

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

 

Powered by FluxBB