Here's what I tried (not really expecting it to work--and it didn't) but you'll get the idea of what I'm trying to do. (I know how to get the parent id from the globals array, I'm just using that as a test scenario here):
Code: Select all
global $gCms, $dbinstance;
$alias = $gCms->variables['page'];
///Get the info for the current page
$query = "SELECT parent_id FROM cms_content WHERE content_alias = '$alias'";
$result = mysql_query($query,$dbinstance);
$content = mysql_fetch_assoc($result);
$parent_id = $content['parent_id'];
echo "Parent id: ".$parent_id;
