PAC tree module snippet: Parent Node's ID, title, Brother nodes

PLEASE NOTE These snippets are user submitted. Use at your own risk.

Pretty simple and yet handy snippet for the PAC tree module - this assumes only one level of depth, which is quite naive of me, but it's all I needed for the current site. Anyone who wants to stretch it a bit, go nuts.

<?php

//Summons the Parent NID and Title
$parent_list = pacs_node($node->nid);
$parent = pacs_node($parent_list["pid"]);
print
$parent_list["pid"] . $parent["title"];
?>

Potential uses: On a child page, create a new 'brother' page under the parent node's id, at the same level as the current node.

<?php
$_SESSION
['pacs_new_node_pid'] = $parent_list["pid"];
print
'<a href="node/add/">New Brother Node</a>';
?>

 
 

Drupal is a registered trademark of Dries Buytaert.