favorite_nodes.module question

Keeper54 - March 12, 2007 - 13:34

First, I love the capability that this module provides. Excellent module. After searching through the forums, issues, release notes for this module, etc, I have the following two questions:

My questions are (1) whether I can drop this output into page content as opposed to keeping it in a block, and (2) whether I can theme it within the module (or otherwise) to display in a table format, with $type as the column header and the node titles underneath it. I have 5 node types I'm allowing as favorites and would like to have a tabbed landing page for my top-level users that contains a tab for 'favorites,' thus my unwillingness to leave the 'favorite_node' content in a block. I've tried half-heartedly to force the module to do what I want but I just don't know enough PHP to command the performance I need.

It would be a help if anyone could give my the PHP snippet to put into my node content to display the 'favorites' content. Even better would be if someone has solved the issue I'm having and can share their solution.

As always, thanks for any scraps of knowledge you can throw my way.

If you've already got (and

csc4 - March 12, 2007 - 15:18

If you've already got (and like) the block you might find Placing the contents of a block in any location helpful

Specifically -

<?php
    $block
= module_invoke('module_name', 'block', 'view', 0);
    print
$block['content'];
   
?>


To specify which block from which module, you simply edit the two following variables in the first line:

module_name = The name of the module
The number = Is the $delta of the block

For example to call the block on the Font Size module use:

<?php
    $block
= module_invoke('fontsize', 'block', 'view', 0);
    print
$block['content'];
   
?>


Or for example to display who is a new user:

<?php
    $block
= module_invoke('user', 'block', 'view', 2);
    print
$block['content'];
   
?>

Thank you

Keeper54 - March 12, 2007 - 17:43

Excellent link and code explanation. I really appreciate the response! Working like a champ now. Last thing for me to work on is the display of the content. Gonna have to dig into the module for this one I think...

 
 

Drupal is a registered trademark of Dries Buytaert.