Hi Caroline,

My 'terms of use' node contains only CCK fields, with no body field.

It appears as blank on the user registration process, as it has no $body field.

As well as that, if a node has a body field and some additional CCK fields, only the body field will appear on the form.

Regards
Alan

Comments

alanburke’s picture

Status: Active » Needs review
StatusFileSize
new892 bytes

Patch for consideration.
Main change is using node_view rather than node_prepare.

[Warning! Novice developer & patcher at work]

Regards
Alan

Chill35’s picture

Assigned: Unassigned » Chill35
Category: bug » feature
Status: Needs review » Postponed

I have applied the changes in my sandbox as per your recommendation.

If I had to do it all over again, I would use node_view() instead of node_prepare().

However... If I make the changes now, it will 'break' all sites that use this module, as extra content will be injected in the Terms of Use fieldset, including the node title.

You probably should not use CCK for this. Terms of Use are better stored in a 'page' and it's good practice to add a link to this page in your Footer Menu. Please use the 'page' content type for this.

hefox’s picture

StatusFileSize
new558 bytes

Same issue

I am using page, however I don't use a body field for page and instead use CCK fields. (And several other developers I know also do this; it's so much more configurable and enjoyable to use compared to core body).

function node_view($node, $teaser = FALSE, $page = FALSE, $links = TRUE) {

http://api.drupal.org/api/function/node_view/6

So more correctly it should be

$terms = node_view($node, FALSE, TRUE,FALSE);

To prevent the title and links from showing

node_prepare is not needed for node_view, as it already calls it.

Here's a slightly modified verision of the patch

kars-t’s picture

Assigned: Chill35 » Unassigned
Status: Postponed » Needs review
hefox’s picture

Status: Needs review » Needs work

Oh this,

I come to disagree with my patch, and instead suggest setting $node->title to empty; this is more acceptable, and less likely to cause harm. This is how panels removes titles when inserting node into panel content; requires checking for $node->title is set before printing it in node.tpl.php or empty h2 tags will be printed.

aron novak’s picture

Status: Needs work » Needs review
StatusFileSize
new2.77 KB

I'd propose to do not break the backward compatibility.
Here is a patch where you can actually select the field to render as a Terms of Service. If the user does not alter it, fallbacks to body and the behavior is not changed.

aron novak’s picture

Any interest on this? I'm happy to work a bit more to get this committed.

kars-t’s picture

Oh interest for sure but I lack time... :-/

kars-t’s picture

Status: Needs review » Closed (won't fix)

Hi

I won't add anything to D6 anymore. I believe this would be a great addition for D7. Feel free to reopen if you want to make a new patch.