I started using the Related Content module a few days ago and was a bit disappointed that for such a simple functionality no proper module seems to be around. While working perfectly a couple of things really got me thinking about how this could have been done better.
Using Taxonomy and Views you can achieve the exact same behavior with what I believe is a more intuitive configuration interface requiring less effort to manage your website's related content.
My issues with the Related Content module are the quite unintuitive setup in the beginning and mainly the unnecessary separate tab to define related content. I'd love that to be part of the node edit form.
Also, the two-way related content linking means that every time you add a node, you have to go to the existing nodes that are to be related and define the relation to the new node. That is just unacceptable. I want the related content to be configured solely from the content node being created. The easiest way is to define a taxonomy as a means of content grouping. That way, all nodes that share a node term from that taxonomy are considered related.
The worst of all, the Related Content's list block requires the block cache disabled. Nah, I'm putting something together myself!
The idea is to replace the module with either flags or tags to create a group of related content nodes. When new content is being added, user just picks a group from list directly in the node edit page. I reckon taxonomy provides more flexibility than the Flag module,
Create new vocabulary called Related content. Make it applicable to your content types you want to have the related content functionality available for, e. g. Story in my case.
Depending on your preferences, set up the vocabulary to serve as a related content group selector. I'm going for Tags, so that I can make use of autocompletion and also create new groups on fly. I don't expect to have content in multiple groups, but Multiple is always checked for Tags. Lastly, related content is going to be an optional content property, I don't want to enforce the related content group selection, thus I leave the Required unchecked. To have the Related content group input control always as the last one in the taxonomy configuration block, I set the Weight to 10. If I wanted to be fancy about it, I'd use taxonomy_content to place it underneath the content body block.
I add a couple of terms I know I'm going to use straight away, and those are Drupal tips and Pomodoro Technique.
Now edit the existing content to set the Related content group for each relevant node. There's not that much content I've got so far, so I'm doing it manually. You can use the Taxonomy Manager module to make your life easier.
We're going to create a view with block display, which will list all node titles linked to their nodes, sharing the same term in our Related content vocabulary. I'll leave the basic setup with you, your preferences and requirements. The only important part of the view, when it comes to our related content functionality, is two arguments and their default values.
It's quite logical that in the list of the currently viewed node's related content we don't want to list the node itself. That is very easy to achieve by following these few steps:
The second argument will help us to retrieve all nodes sharing the Related content vocabulary term with current node.
To make the PHP code use all vocabulary terms, not just the first one, which is sufficient for me, the code would look a bit like this:
node = node_load(arg(1)); $terms = taxonomy_node_get_terms_by_vocabulary($node, 4); $tids = array(); foreach ($terms as $term) $tids = $term->tid; return $tids;
My Related content's vocabulary VID is 4, and that's the second, hardcoded parameter to the taxonomy_node_get_terms_by_vocabulary() function call. You can work out your vocabulary's VID in the taxonomy administration pages. Edit vocabulary page will have the vocabulary's VID in it's URL.
Watch out! Return value of the taxonomy_node_get_terms_by_vocabulary() function is an associative array with the term id's used for keys. That means, you can't just do $terms->tid. May seem obvious to you, I've just spent an hour learning the hard way...
Also, the argument type must be Term ID (with depth). Plain Term ID would work too, but we want to make use of the percent substitution to dynamicaly set the view title. With the latter, we'd end up with the actual numeric Term ID instead of the term name.
To have the view title dynamically contain the related content group, set the arguments Title to something along the lines of "Related in %2", where %2 will get replaced with the term name.
Place the block wherever you see fit, in the sidebar or append it to the end of the content for your users to have somewhere to go when done with the current story.
After that, all you have to do for the related content functionality to be useful, is to add your nodes to respective related content groups. And the best part is that you only have to do it once.