[support] Page with two Sections

Dale McGladdery torelad at gmail.com
Thu Sep 20 07:08:07 UTC 2007


On 9/19/07, Fred Jones <fredthejonester at gmail.com> wrote:
> > Make each box (not the pages) a separate node with it's own content.
>
> My question is, however, regarding the body text of my box nodes. I am
> fetching it thusly:
>
> $result5 = db_query("SELECT body from node_revisions where nid =
> ".$row->nid.";");
>
> which works, but it returns the raw text, without the <p> tags added. Is
> there a Drupal function that will add them in for me?

Check out node_load (http://api.drupal.org/api/function/node_load/5)
for fetching nodes. It will isolate you from worrying about revisions.

For insights into how Drupal renders nodes, check out node_view
(http://api.drupal.org/api/function/node_view/5)  Unless you want a
fully themed node, you'll want to copy the appropriate code.

> The page in question is setup like a FAQ where at the top are the
> questions, each with a link to the answer.

It sounds like your mostly done and happy with your implementation, so
probably not worth going back and changing. However, at some point
you'll want to check the Views and CCK modules for this kind of thing.
You can do some really kick-ass cool stuff.


More information about the support mailing list