Anyone know if there is a snippet or module out there that will facilitate the making of blocks that display a page node (in full form, not teaser)?

Comments

tyswan’s picture

One way is to use the Views module.

The views module creates blocks.

Select the particluar node/s you want to display (filter on catgeory, sticky, nodequeue, whatever works for you).

Select display type as "Full Nodes"

Presto!

I actually use this method to create a block that shows search tips, or alternative ways to search the site (such as browsing categories), and then put the block on the default search page.

Hope that helps.

Cheers,

Tys.

JJacobsson’s picture

Well, that almost acomplises what I would like... But the filtering is a bit lacking for this purpose where I actualy want a specific node. As in, I know the ID of it. I could create separet categories for each node that I want to display like this, but I think it would get quite messy to manage as I have a bunch of nodes I want to display like this...

I'm going to use it sortof provide a separet "mission statement" for every taxonomy term I have... almost... If you get my meaning...

But thank you! I learned something about views I dident know!

tyswan’s picture

Look, I know nothing about PHP, but it seems you need one of those fancy php-this-might-break-your-site blocks.

I found this deep in th belly of the views module:

/**
 * Display the nodes of a view as plain nodes.
 */
function theme_views_view_nodes($view, $nodes, $teasers = false, $links = true) {
  foreach ($nodes as $n) {
    $node = node_load($n->nid);
    $output .= node_view($node, $teasers, false, $links);
  }
  return $output;
}

I imagine that you already know $n->nid, so what you need is
this line:
$output .= node_view($node, $teasers, false, $links);

Whether you want to experiment with this, I don't know, but perhaps you could find someone out there who can make more sense of this than me.

Anyway,

That's the last I can offer. Good luck...

Cheers,
Tys.

JJacobsson’s picture

<?php
$nid = 37;
$node = node_load ($nid );
echo node_view( $node, false, false, true );
?>

And Bob's my uncle! Thanks!