Getting contents of a page -no header, footer, blocks- by code

farzan - May 4, 2008 - 13:52

Hello,

How can I get contents of a page using code? For example, I need the contents of a page, like node/5 or admin/settings. By content i mean value of $content that appears in page.tpl.php; I don't want it to include the header, footer etc.

I need this functionality to show contents of several pages in Panels.

Thank you.

For content (e.g.

BladeRider - May 4, 2008 - 17:47

For content (e.g. node/6):

<?php
$content
= node_view(6);
?>

For forms, you'll need to know the name of the form (look for functions called XXX_form, the XXX part is what you want):

<?php
$content
= drupal_get_form('user_login');
?>

 
 

Drupal is a registered trademark of Dries Buytaert.