Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-02-17 03:42:55

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

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

#3 2009-02-17 04:55:47

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

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

#4 2009-02-17 11:08:59

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: txp output in style sheets

TXP style sheet output isn’t parsed for TXP tags.

Offline

#5 2009-02-17 11:14:15

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: txp output in style sheets

There is this plugin – never used it though.

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

#7 2009-02-17 12:44:23

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: txp output in style sheets

Thanks – I’ll have a look at the plugin… in the meantime inline styles are OK :)

Offline

#8 2009-02-17 13:10:56

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

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

#11 2009-02-17 17:03:46

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 976
Website

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

Board footer

Powered by FluxBB