iantearle.com

Dreamscape Menu in the Footer

Sometimes the menu position is just not enough. Especially when the design calls for the menu to be in a different postion, or perhaps you want to make a site map?

This code will help you get your Dreamscape CMS menu into your footer, or anywhere else you want it.

//Menu in Footer Code
function add_menu()
{
global $mainmenu, $themetemplates, $user_vars, $items, $option, $theme_suffix, $Database, $sections;
$tplext = TPL_EXT;
$sortdirection = ($option->sortdirection == 'ASC') ? true : false;
$sortby = (!empty($option->sortcats)) ? $option->sortcats : 'created';
$user_pages = $items->GetList(array(
array('pid', '=', 0),
array('online', '=', 1),
array('type', '=', 'static'),
array('created', '<=', time())), $sortby, $sortdirection);
//Grab the categories
$menu = $sections->GetList(array(array('pid', '=', 0), array('cat_type', '!=', 'pages')));
$mainmenu->sections = prepare_menu_content($menu);
$user_pages = prepare_menu_content($user_pages);
$custom = $items->GetList("SELECT
id, title, pid, dirtitle, menu_order
FROM *table*
WHERE online=1
AND menu_order != 0
AND created <=".time()."
AND type='static'
ORDER BY menu_order ASC");
$custom_sections = $sections->GetList("SELECT
id, pid, dirtitle, descr, sectionname as title, public, order_rank as menu_order
FROM *table*
WHERE public=1
AND cat_type != 'pages'
AND order_rank != 0
ORDER BY menu_order ASC");
$custom = array_merge($custom, $custom_sections);
csort($custom, 'menu_order');
$custom_menu = prepare_menu_content($custom);
$mainmenu->custom_menu = $custom_menu;
$mainmenu->user_pages = $user_pages;
$mainmenu->pages_list = '

    ' . "\n" . get_full_page_list() . "\n" . '

';
$mainmenu = inject_variables($mainmenu, $user_vars['menu']);
$mainmenu = inject_variables($mainmenu, $user_vars['loops']);
return $mainmenu;
}
$footer_menu = add_menu();

 

Then call your function inside a loop:

add_loop($footer_menu->custom_menu,'custom_menu','footer');

Posted On: Friday, February 13th, 2009 @ 7:07 pm by Ian Tearle


0 Comments

There are no comments on this entry. You should add one below.

Leave a comment

Be kind

If you would like to discuss anything about this post, please be polite and add your comments below.


 
 

Additionally

No HTML is allowed. All links, and new lines will be automagically converted to HTML for you.
Notice to spammers, all links will be sanitized with rel="nofollow".


Contact Me

Get In Touch

If you would like to discuss anything about your next project please drop me a line.


 

Prices

Projects start at £99.00 per month
We normally book 2–3 months in advance.

Additionally

No matter how small your project is, or if the prices above scare you, please do get in touch, I shall always listen and will advise freely alternative ideas or solutions. If you are a charity, let's talk!


Find Me On