Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-10-25 19:36:49

jonathanclarke
Member
From: London, England
Registered: 2004-12-28
Posts: 46
Website

Access and style the HTML code for the article.

I’d like to wrap some span tags around each article line by line to allow me to style them.

I’m not sure how to do this without hacking the PHP, which I’d rather not do.

Offline

#2 2005-10-25 21:27:18

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Access and style the HTML code for the article.

Did you have a look at the Textile help? (find the link under ‘To apply attributes’)

Offline

#3 2005-10-25 21:31:06

jonathanclarke
Member
From: London, England
Registered: 2004-12-28
Posts: 46
Website

Re: Access and style the HTML code for the article.

Yup looked at that. I’d like to apply the style ‘automatically’. Which I guess means wrapping and applying a custom class to text spans in the article HTML code.

Last edited by jonathanclarke (2005-10-25 21:31:21)

Offline

#4 2005-10-25 22:51:36

jonathanclarke
Member
From: London, England
Registered: 2004-12-28
Posts: 46
Website

Re: Access and style the HTML code for the article.

Can <txp:body /> take a wraptag? The Textbook says no, but I was wondering if there was a way around this? To give it a wraptag of % or < span >

Last edited by jonathanclarke (2005-10-26 16:59:36)

Offline

#5 2005-10-26 15:37:49

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Access and style the HTML code for the article.

jonathanclarke wrote:

Can <txp:body /> take a wraptag? The Textbook says no, but I was wondering if there was a way around this? To give it a wraptag of % or <span>

Do you mean you want to wrap the entire body? Why not use <div class="blah"><txp:body /></div> in your form then? Or do you need the class to be different for different articles?

Offline

#6 2005-10-26 15:52:30

jonathanclarke
Member
From: London, England
Registered: 2004-12-28
Posts: 46
Website

Re: Access and style the HTML code for the article.

Not quite. I want to automatically wrap a < span > tag around each paragaraph of text.

Last edited by jonathanclarke (2005-10-26 16:59:07)

Offline

#7 2005-10-26 16:30:05

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Access and style the HTML code for the article.

Well, then you could still use <div class="blah"><txp:body /></div> and style the .blah p however you want in the CSS.

Offline

#8 2005-10-26 16:55:44

jonathanclarke
Member
From: London, England
Registered: 2004-12-28
Posts: 46
Website

Re: Access and style the HTML code for the article.

Sorry, I want to get the SPAN level. My post above removed the SPAN word, for some reason, probably because it thought it was a tag.

Offline

#9 2005-10-26 17:41:00

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Access and style the HTML code for the article.

Yes, I understood that, but if you are going to wrap it around a paragraph, I think you should use div instead of span. But I think that something similar to the output you want:
<code>
<p class=“blah”>paragraph</p>
<p class=“blah”>another paragraph</p>
</code>
could be obtained by wrapping the body in a div class. Your output would be:
<code>
<div class=“blah”>
<p>paragraph</p>
<p>another paragraph</p>
</div>
</code>
Whether you style p.blah or .blah p doesn’t as far as I know make any difference?

Offline

#10 2005-10-26 17:44:01

jonathanclarke
Member
From: London, England
Registered: 2004-12-28
Posts: 46
Website

Re: Access and style the HTML code for the article.

Thanks man, I actually do need the SPAN properties though. P is not quite the same as SPAN.

Offline

#11 2005-10-26 17:54:20

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Access and style the HTML code for the article.

Ah, you don’t want the <p>? Sorry for being so slow ;)
The only way I can think of is entering it manually in the articles: % (blah)your text here% (sorry, can’t show the % other than with a space after it). Doing that automatically is not possible to my knowledge (at least not without some serious hacking, and that’s not my expertise).

Offline

#12 2005-10-26 18:05:10

jonathanclarke
Member
From: London, England
Registered: 2004-12-28
Posts: 46
Website

Re: Access and style the HTML code for the article.

No worries, probably didn’t explain myself properly. But yeah that’s what I need, and yeah, I’m not that keen on the hack either.

Last edited by jonathanclarke (2005-10-26 18:05:43)

Offline

Board footer

Powered by FluxBB