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.

Comments

BladeRider’s picture

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


$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):


$content = drupal_get_form('user_login');