Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Premium alters the body and sets the teaser as the body + adds a message asking to log in
Nodevote adds the voting restults to the teaser...
Nodevote adds the voting results + voting form to the body...
All those additions get lost when using contemplate...
The hook_nodeapi() of contemplate should be executed BEFORE all other modules using this hook...
But is that possible?
Comment | File | Size | Author |
---|---|---|---|
#9 | contemplate.patch.txt | 1.14 KB | ednique |
#3 | contemplate.module.patch_0.txt | 1.14 KB | ednique |
#2 | content.module.patch.txt | 433 bytes | ednique |
Comments
Comment #1
ednique CreditAttribution: ednique commentedSame applies when you mark a CCK content type as being an event...
Event dates get lost...
After investigation I figured out that the contemplate_nodeapi() is causing this issue...
A lot of other modules using the hook_nodeapi() are executed before the contemplate code and all get lost...
It may be better to use the hook_view() instead, just like cck does...
I changed a few lines of code and seems to work...
Once tests are completed, I post my solution.
Comment #2
ednique CreditAttribution: ednique commentedHere's my solution...
It needs a little change in the CCK module. You should ask them to add the code, or ask them to provide a hook that you can call.
Next the contemplate module needs that function + a slight change in the content_nodeapi so that it is only executed for content types that are NOT CCK...
here's the CCK patch
Comment #3
ednique CreditAttribution: ednique commentedAnd here's the Contemplate patch
Comment #4
bomarmonk CreditAttribution: bomarmonk commentedIs this patch the right solution? Can it be committed? I'm having trouble using CCK nodes as Organic Group home pages. Contemplate prevents any of the group nodes from showing on the homepage. Once I disable contemplate, there they are, but the format looks awful.
Comment #5
ju.ri CreditAttribution: ju.ri commentedsame problem here.
the patch worked with 4.7, but not in 5.0.
Comment #6
bomarmonk CreditAttribution: bomarmonk commentedThe content module patch does not apply to the most recent release of CCK. Can the patch be updated to work with the newer release?
Comment #7
krisvannest CreditAttribution: krisvannest commentedFWIW it also seems any editing to the Contemplate teaser field causes other modules content to be skipped. For instance, if I hit "reset" when editing my Contemplate template, the buttons for Service Links module show up on my CCK nodes fine. But if I do any manual editing to the teaser area of that same Contemplate template-- like even put in a single extra carriage return or whatever-- the Service Links buttons are then stripped when viewing the node. Hitting "reset" when editing the Contemplate template will then show them again (but that means I can't touch the template once Contemplate creates it).
Comment #8
bomarmonk CreditAttribution: bomarmonk commentedI suppose I should clarify my earlier statement that the content.module.patch does not work. I have tested it with the current 4.7.1-x developement and 4.7.3-release versions of CCK. In both cases the patch fails. The contemplate patch, however, seemed to work, unfortunately, the patched contemplate module no longer has any effect on the appearance of the CCK node
Comment #9
ednique CreditAttribution: ednique commentedFirst off, I stopped using contemplate as the latest CCK allows you to alter the teaser and body inside the CCK code...
to help you out, I checked the changes again...
The patches first of all are for 4.7.x version...
for the content.module you have to locate the function content_view in that function you will find:
change it to
This code makes it so that contemplate is called from the CCK...
Next you need to change the contemplate module so that its normal processing is done for NON-CCK content types and the function contemplate_view needs to be added.
see attached patch...
I hope this will help...
Comment #10
pvasener CreditAttribution: pvasener commentedYour solution is perfectly working with Drupal 4.7.x and I try to adapt it for Drupal 5.x. Up to now, I have not succeeded as the alter/view mechanism seems to have changed a bit but I will post here a solution once I have one. Any hint or help is, of course, welcome...
Comment #11
bomarmonk CreditAttribution: bomarmonk commentedWhy hasn't this patch been included for both projects? I am trying to bring some attention to this issue with this thread:
http://drupal.org/node/162042
Comment #12
bomarmonk CreditAttribution: bomarmonk commentedComment #13
bomarmonk CreditAttribution: bomarmonk commentedAny work on a fix for this issue on CCK 6? This problem may not prevent the module from being used, but it does make it much more difficult to use with book pages, etc. where other modules should be automatically adding links or content to a node.
Comment #14
dopry CreditAttribution: dopry commentedNo CCK will not call contemplate directly... ever!
Comment #15
lovedrupal6 CreditAttribution: lovedrupal6 commentedthe solution i got from http://drupal.org/node/265728
replace your contemplate template code with this:
Comment #16
vood002 CreditAttribution: vood002 commentedIn Drupal 6 CCK and Premium seem unable to mutually co-exist. I wasn't able to get anything else in this thread to work for me, so I wrote my own little hack to the Contemplate module.
I realize this is probably a terrible way to go about it...and if anyone has better ideas I'd love to hear them, but this is working for me so I figured I'd post it for anyone who is trying to get Premium to work on D6.
The workaround is pretty simple...in contemplate.module, within the call to hook_nodeapi:
Replace: (on like 180 in Contemplate 6.x.1.1)
With:
The workaround is very simple. If the Contemplate module is going to set $node->body to your templated output, it first checks if premium access is set. If it is not, it instead sets the $node->body equal to it's templated teaser output, adds the premium string, and outputs that instead.
If anyone has any tips on improving this code I'd love to hear them.
Comment #17
magpie5212 CreditAttribution: magpie5212 commentedsubscribing
Comment #18
geantbrun CreditAttribution: geantbrun commentedI have the same problem (I add a form with nodeapi in a custom module and it gets lost in contemplate). Can we have a status on that problem? I suppose that many things have changed since nov.2006 (first message in this issue) but I must admit that (as newbie), reading all the posts did not help me much... Is a hack the only solution?
Comment #19
bomarmonk CreditAttribution: bomarmonk commentedI still don't understand why this module cannot render a node the way Drupal does by default. When you enable a template through this module, it automatically removes any links (books, fivestar, etc., .etc) that would be normally viewed with the node. I guess it's just one of the limitations here, and its been this way for over three years. Fixing this would greatly improve the usability of this module.