Addition of other Modules Lost
| Project: | Content Templates (Contemplate) |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | needs work |
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

#1
#2
No patch is attached...
Please attach patch and mark for review.
#3
Keep in mind, that this patch no longer works with 5x. But it seems small enough...
#4
bomarmonk, that patch is for CCK. Can you attach the patch for Contemplate?
#5
Ah, sorry about that... this one should be the contemplate patch. See the original thread for the contributor.
#6
#7
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.
#8
Has anyone reviewed this? I haven't yet but it does sound quite useful.
#9
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
<?phpnode_get_types()
?>
#10
These patches were originally for the 4.7 version and did work for that version. Jjeff asked for them to be reposted here.
#11
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'];
}
?>
#12
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.
#13
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.