Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-01-15 05:48:39

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 2,360
Website

Append stylesheet to specific article

[del]Koy[/del] Khoi Vinh at Subtraction has posted a snipped of php code to append a style sheet to one specific article (for MT). I wonder, could this be done for Textpattern? Perhaps something based on article ID, perhaps ? Optional attributes could include media type,…

Php gurus ?

Edit: Corrected the spelling for Khoi’s first name. – Textile didn’t want to take the ‘del’ markup…?

Last edited by phiw13 (2005-01-16 08:41:35)


Where is that emoji for a solar powered submarine when you need it ?

Offline

#2 2005-01-15 06:29:01

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

Re: Append stylesheet to specific article

The easiest short term way is to use an Override Form for the article that import a new stylesheet, cascading will do the work.

Offline

#3 2005-01-15 06:52:11

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 2,360
Website

Re: Append stylesheet to specific article

But an Override Form won’t change the head of the document, where the link to a second stylesheet would be located.


Where is that emoji for a solar powered submarine when you need it ?

Offline

#4 2005-01-15 07:20:00

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

Re: Append stylesheet to specific article

You could use a style xhtml tag, and then an import rule in it to load your external css file. It has precedence over the head css rule.

It’s also perfectly semantic.

The only down side, is I don’t think you can nest form inside one another (check it, it’s pretty late here and my neuron want to go to bed) so you have to copy/paste the original code and maintain it by hand.

Last edited by Jeremie (2005-01-15 07:23:29)

Offline

#5 2005-01-15 16:20:24

Andrew
Plugin Author
Registered: 2004-02-23
Posts: 730

Re: Append stylesheet to specific article

I’m actually working on a plugin for it right now.

Offline

#6 2005-01-15 19:07:42

osei
Plugin Author
From: Stockholm, Sweden
Registered: 2004-07-01
Posts: 178
Website

Re: Append stylesheet to specific article

that would be a cool plugin, glad to see you are on it compooter :)


Johan Nilsson

Offline

#7 2005-01-15 19:22:31

Andrew
Plugin Author
Registered: 2004-02-23
Posts: 730

Re: Append stylesheet to specific article

Offline

Board footer

Powered by FluxBB