Hello,

When using
rowstyle->Fields
Is there anyway to access and render the other aspects of a node, like $links or associated comments?
I'm in a situation where using "Fields" makes more sense than rendering "nodes" but I still need access to the node's related links and comments [and possibly other data fields]. Is this simply not possible? Or is there a way to do this that I am missing?

Thank you kindly for your time and help,

Sebastian.

Comments

dawehner’s picture

Status: Active » Fixed

You have to do some custom coding, perhaps you could integrate this in a field.

First you have to create a fake node object.

    $node->links = module_invoke_all('link', 'node', $node, $teaser);
    drupal_alter('link', $node->links, $node);

Then you have to use this fake node object to create the node links, and render it with theme('links', $node->links);

Status: Fixed » Closed (fixed)

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

schedal’s picture

Priority: Normal » Minor
Status: Closed (fixed) » Fixed

Thanks Dereine, I will look into your suggestion.

Another another solution, which is perhaps easier.

Either from a node-[name].tpl.php or from a ConTemplate:

call the View you want with print views_embed_view ('view_name', 'default', arg(0)); where arg = argument.

It's a little ass backwards, but it DOES work; also combines well with NodeQueue to make a Pseudo ViewsQueue...

Using this method I can arrange the links/comments area either before or after the fields I need generated.

merlinofchaos’s picture

A better solution than views_embed_view would be views_attach module

Status: Fixed » Closed (fixed)

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