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
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

TBarregren - May 14, 2008 - 08:23

Good idea. I will definitely consider it when I update the module next time.

#2

open-keywords - November 21, 2008 - 09:00

Has this been committed ?

#3

peter-boeren - December 26, 2008 - 22:44

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

peter-boeren - July 12, 2009 - 07:08
Status:active» fixed

module finally available with the suggested alteration in it.

#5

System Message - July 26, 2009 - 07:10
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.