I am resubmitting this issue for version 5x of the contemplate module (this was already noticed in 4.7 and has still not been officially addressed-- although there is a patch-- can the maintainer please review this patch, update it to 5x, and make it official).

What happens:
The contemplate works great with a standard page that is not including links or content added by other modules. However, if the book module needs to add book navigation, the organic groups module needs to add group content, premium needs to modify how the body or teaser is viewed, nodevote needs to add voting results, location needs to add location links (like "add another location," very important), then contemplate causes big headaches. All of these additions get lost when using contemplate... Simply adding a reference to node links doesn't get the module additions back into the template.

The sad thing is that there appears to be a working patch for 4.7 that should get added and then updated for 5.2. My problem is that I'm now running 5.2 and I was not successful in updating the patch on my own. Please see the patch here and help get this change working with contemplate and the content module: http://drupal.org/node/93935

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bomarmonk’s picture

Status: Active » Needs work
jjeff’s picture

Status: Needs work » Postponed

No patch is attached...

Please attach patch and mark for review.

bomarmonk’s picture

Status: Postponed » Needs review
FileSize
433 bytes

Keep in mind, that this patch no longer works with 5x. But it seems small enough...

Christefano-oldaccount’s picture

Status: Needs review » Postponed (maintainer needs more info)

bomarmonk, that patch is for CCK. Can you attach the patch for Contemplate?

bomarmonk’s picture

Ah, sorry about that... this one should be the contemplate patch. See the original thread for the contributor.

Christefano-oldaccount’s picture

Status: Postponed (maintainer needs more info) » Needs review
bomarmonk’s picture

I am still keeping an eye on these patches. The addition of this functionality would really make contemplate an easier solution for theming nodes. As it is, you have to dig around and try to find every line of code to add another module's links and other additions. +1 for adding this into the mix.

christefano’s picture

Has anyone reviewed this? I haven't yet but it does sound quite useful.

jrglasgow’s picture

Status: Needs review » Needs work

this patch does not work

+      if (!content_types($node->type) && $template = contemplate_get_template($node->type)){

this line will not work, I cannot find a function content_types you cold use node_get_types() to get a list of the types, but all node types would be listed, even those made with CCK

bomarmonk’s picture

These patches were originally for the 4.7 version and did work for that version. Jjeff asked for them to be reposted here.

lovedrupal6’s picture

the solution for the book navigation menu as i got from http://drupal.org/node/265728:

replace your contemplate template code with this:

<?php
ob_start(); ?>


// ... PASTE YOUR TEMPLATE HERE......


<?php
$node->content['body']['#value'] = ob_get_contents();
ob_end_clean();

// iterate through each child elements
foreach (element_children($node->content) as $key) {
  // we skip child elements which name preceeded by 'field_'
  if (substr($key, 0, 6) == 'field_') continue;
  // print child element
  print $node->content[$key]['#value'];
}
?>
plan9’s picture

Is this resolved? I was keen to try out contemplate but if it's going to ignore all of my contributed modules output and rely on code tweaks for each one it seems like more trouble than it's worth.

bomarmonk’s picture

This has never really been resolved, unless it was fixed in a very recent update. There is code you can plug in to the template to make the links display (such as the navigation links for books). It's not too tricky, but you would think a check box for including links would be even better.