Hi all!

I'm currently working on my very first Drupal site and I ran into a problem. I'm using the module Relevant Content for displaying a block of relevant contents to my site's right sidebar.

So far, so (almost) good. There are 2 things I don't understand, and I was wondering if anybody could help me out with this.

The site i'm talking about is located here. If you click Dienstenpakket > Coaching you'll see one related node (article) on the right sidebar. If you click that related node and it loads in the related node, the list on the right sidebar is gone. How can I display this list of related nodes, even when I'm reading the current relevant node?

Second question is a bit harder I guess. I not only want to show the node title that links to its node, but I also want to display another field I've added with CCK to Content Type "Article", and that's the node's subtitle.

So all in all, I want to display the block of related content like this: [image]
instead of just titles-only.

So I opened the module relevant_content.module and found a small piece of code that kinda confuses me:

/**
 * Theme function for rendering the relevant nodes into a block.
 *
 * This is provided so that an item list is the default, however a themer can
 * easily override this to make a teaser list or table.
 *
 * @param $nodes
 *   Associative array where the key is the node id and the value is the node title
 * @param $header
 *   Optional string to display at the top of the block
 */

function theme_relevant_content_block($nodes, $header = FALSE) {
  $items = array();
  foreach ($nodes as $node) {
    $items[] = l($node['title'], 'node/'. $node['nid']);
  }

  $output = '';
  if ($header) {
    $output = check_markup($header);
  }

  $output .= theme('item_list', $items);
  return $output;
}

My question is now, how can I edit this module, so that it displays my custom CCK field 'article_subtitle'?

I hope I made myself clear, and that one can point me in the right direction. Please keep in mind my PHP knowledge is limited.

Thanks in advance!

Jasper

Comments

JayNL’s picture

Views for the list of contents and then a few invisible menu items saved the day! :) I just added the articles to my primary links, disabled them and placed them in the correct position in my menu.

Problem solved! :) God, I love finding things out for myself and I love Drupal :)