Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
txp output in style sheets
So I have a style sheet which I put in a form and output inbetween the page body tags which contains some txp tags – but they didn’t show :(
So I put them into an inline style – and they appeared.
Is there a reason for this?
Offline
#2 2009-02-17 04:38:37
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: txp output in style sheets
You’ll have to post your code.
Last edited by Mary (2009-02-17 04:38:49)
Offline
Re: txp output in style sheets
Well – this was the style sheet code which I was pulling into the <body> tags (and I also tried it in the <head> tags) which didn’t work
.main {
width: 188.5px;
height: 191px;
position: relative;
background: #000 url(<txp:upm_article_image form="sr-box-css" />) no-repeat top left;
}
And this is the inline style – which did work:
<div class="main" style="background: #000 url(<txp:upm_article_image form="sr-box-css" />) no-repeat bottom left;">
And this is the form sr-box-css:
<txp:upm_img_full_url />
I don’t mind using inline styles for this – but just wanted to know if there was a reason as it would be easier to use a style sheet
Offline
Re: txp output in style sheets
TXP style sheet output isn’t parsed for TXP tags.
Offline
Offline
#6 2009-02-17 12:42:56
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: txp output in style sheets
You can do it by putting the CSS inside the page rather than linking to it.
Offline
Re: txp output in style sheets
Thanks – I’ll have a look at the plugin… in the meantime inline styles are OK :)
Offline
Re: txp output in style sheets
Mary wrote:
You can do it by putting the CSS inside the page rather than linking to it.
I did that – but put it inbetween <style> tags and still go no output… is that what you mean?
Offline
#9 2009-02-17 13:58:57
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: txp output in style sheets
Yes, that’s what I mean. Because it is in your page template, Txp tags (including my plugin) should work. It’s only in an external CSS file where they won’t.
Could you post a tag trace, so we can see what’s happening?
Offline
#10 2009-02-17 16:57:08
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: txp output in style sheets
tye wrote:
but put it inbetween <style> tags and still go no output…
Doesn’t it need to be inside if_individual_article tags if it contains a <txp:upm_article_image />
tag?
Offline
Re: txp output in style sheets
Tangent: another Txp CSS option – rah_css_embed
Last edited by maverick (2009-02-17 17:04:24)
Offline
#12 2009-02-18 06:13:44
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: txp output in style sheets
Els: If it is on an individual article page, then no – remember we had an update a while back that made it so that you could use article form tags in individual article pages? My plugin simply hooks into that.
Offline