Adding relatedcontent as independent parts of $node->content
z.stolar - May 14, 2008 - 08:19
| Project: | RelatedContent |
| Version: | 5.x-1.6 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
Currently relatedcontent simply concatenates it's output to the body, in _relatedcontent_node_view, either before it or after it, depends on the user's choice.
They should be added independently, to allow greater control and customization.
Instead of (starting line 460 in version 5-x.1-6):
<?php
// Theme the related content.
$output = theme('relatedcontent', $output, $output_grouped, $node->type, $teaser, $page);
// Add the themed output to the node's body.
switch ($output_placing) {
case 'beginning':
$node->content['body']['#value'] = $output . $node->content['body']['#value'];
break;
case 'end':
$node->content['body']['#value'] = $node->content['body']['#value'] . $output;
break;
}
?>we should have:
<?php
// Theme the related content.
$output = theme('relatedcontent', $output, $output_grouped, $node->type, $teaser, $page);
$node->content['relatedcontent']['#value'] = $output;
// Add the themed output to the node's body.
switch ($output_placing) {
case 'beginning':
$node->content['relatedcontent']['#weight'] = $node->content['body']['#weight'] - 1;
break;
case 'end':
$node->content['relatedcontent']['#weight'] = $node->content['body']['#weight'] + 1;
break;
}
?>
#1
Good idea. I will definitely consider it when I update the module next time.
#2
Has this been committed ?
#3
I've done an implementation of your suggestion in the development version I'm working on at home for the D6 version of this module. It still needs a lot of love and attention but i hope all work is done before the end of january 09.
#4
module finally available with the suggested alteration in it.
#5
Automatically closed -- issue fixed for 2 weeks with no activity.