Closed (won't fix)
Project:
Terms of Use
Version:
6.x-1.8
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
5 Jan 2009 at 11:02 UTC
Updated:
7 Jul 2012 at 16:57 UTC
Jump to comment: Most recent file
Comments
Comment #1
alanburke commentedPatch for consideration.
Main change is using node_view rather than node_prepare.
[Warning! Novice developer & patcher at work]
Regards
Alan
Comment #2
Chill35 commentedI 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.
Comment #3
hefox commentedSame 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).
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
Comment #4
kars-t commentedComment #5
hefox commentedOh 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.
Comment #6
aron novakI'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.
Comment #7
aron novakAny interest on this? I'm happy to work a bit more to get this committed.
Comment #8
kars-t commentedOh interest for sure but I lack time... :-/
Comment #9
kars-t commentedHi
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.