Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
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 ?
Sand space – admin theme for Textpattern
Offline
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
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 ?
Sand space – admin theme for Textpattern
Offline
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
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
Pages: 1