Hi folks,

How do I get to retrieve paragraph per paragraph in my node template? I have an article node, and I'd like to place some additional information on both sides of my textarea. For instance, on the left side the tags, and after two paragraphs the related pictures. In order to do that with CCK and CSS I have to have access to the paragraphs in my template. Something like <?php print $field_text_paragraph1 ?>. When I dsm() the field_text property, I can only retrieve the whole formatted body text.

I tried to find a solution beforehand, but I had no luck. Theme Developer also did not reveal any information.

Thank you.

Comments

theusualsuspect’s picture

nobody ever came across this problem?

markus_petrux’s picture

Status: Active » Fixed

I think you could use preg_match() and similar functions to parse the text in the field. But this is more a generic PHP programming issue than something related to CCK. I would suggest to use the development forums for advice on how to do this in PHP.

Parsing HTML is not trivial. Maybe you could try to find a module implementing an input format filter that you can use to easy this.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.