While iterating through the related content in the tpl file, I'd like to load the nodes I'm iterating and then be able to output very specifically styled items.
What I have so far:

<?php 
  foreach ($output as $group => $contents) { ?>
  <?php foreach ($contents as $content) { ?>
    <div class="catalog_1">
	<?php
       echo $content; 
	?>
    </div>	
	<?php 
	  } 
	?>
<?php 
  } 
  ?>

What I want to be able to do is to use node_load on something to be able to see all of the variables of the node which I am echoing as $content. The node has an image and content which I need to wrap very specifically in my HTML in order to achieve my desired output.

Can anyone help me get access to this var?

I use devel module and trying to do a dprint_r on everything I can think of but have no logical approach for how to access this information.

Please advise.

Cheers,

Adam

Comments

nimzie’s picture

or how do I just list all of the arrays loaded in memory? I'm just trying to get at the nodes for relatedcontent and then be able to properly theme the output...
I would imagine this is a reasonably generic technique that I hope I'll be able to apply elsewhere!
Thanks for your assistance...

Adam

nimzie’s picture

If I have a function :

function relatedcontent_get_nodes(&$node) {
  $nodes = $node->nodes; // Keeps $node immutable.
  asort($nodes, SORT_NUMERIC);
  return array_keys($nodes);
}

How would I call it with an empty array, then I can dprint_r on it?

I know .. really nooby question... thanks for teh tips.