PHP: Render node with proper layout in ajax request

Events happening in the community are now at Drupal community events on www.drupal.org.
theduke's picture

Hi guys.

In an ajax request, I need to manually render several nodes which have a Panels Layout assigned.

I have tried the obvious:

$node = node_load(1);
$output = render(node_view($node));

But this gets me the plain node with it's field rendered, not the proper layout.

Any advice on this?

Comments

Try something like

mikey_p's picture

Try something like this:

<?php
$node
= node_load(1);
$output = render(node_show($node));
?>

Sadly gets me the same as

theduke's picture

Sadly gets me the same as render(node_view(...)).

I'm assuming that this might have to do with the page manager and context.

Panels

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: