I have created a query that will show the menu text of the parent from a left subnavigation option.
For example, the horizontal menu is:
1. Home
2. Collection
3. Contact
Subnavigation for Collection is
2.1 Collection 1
2.2 Collection 2
2.3 Collection 3
If I am at the page 2.2, then I want to show "Collection" as the parent on the page.
But the query below doesn't work.
Can anyone see what is wrong with this query?
Code: Select all
global $gCms;
$db =& $gCms->GetDb();
$vars =& $gCms->variables;
$query = "
SELECT menu_text
FROM ".cms_db_prefix()."content
WHERE content_id =
(
SELECT parent_id
FROM ".cms_db_prefix()."content
WHERE content_id = '".$vars['content_id']."'
);";
$row = $db->GetRow($query);
print_r($row);