Drupal Navigation on Non-Drupal ShopSite Shopping Cart pages
denverrusty - March 27, 2008 - 01:27
I have a website that has pages generated from ShopSite shopping cart software that will not be Drupal pages. Is there a way to place Drupal standard navigation on these non-Drupal pages (they will be PHP pages) using an API or macro? Has anyone else integrated ShopSite with Drupal?

I found a way to create an include module for other pages
I created the following code which I placed in page.tpl.php. It creates an include module which I include on non-Drupal pages. Once an hour, when the homepage is accessed, the include gets updated.
$page_nav_dir = $_SERVER['DOCUMENT_ROOT'] . '/shop/includes';
$page_nav_file = 'nav.php';
$page_nav_include_file = $page_nav_dir . '/' . $page_nav_file;
if ($is_front) {
$update_nav_include = false;
if (file_exists($page_nav_include_file) ) {
$curr_day = date('dH');
$file_day = date('dH', filectime($page_nav_include_file));
if ($file_day != $curr_day) {
$update_nav_include = true;
}
} else {
$update_nav_include = true;
}
if ($update_nav_include) {
$nav_html = menu_tree('menu-navigation'); // Get left column user-defined navigation to allow saving to a include file
if ($fh = fopen($page_nav_include_file, "w")) {;
fwrite($fh, $nav_html);
fclose($fh);
}
}
}