From 9b899004c5fc73c7609a1d58a814d782fe3eaab7 Mon Sep 17 00:00:00 2001 From: Cameron Date: Sun, 15 Oct 2017 13:14:14 -0700 Subject: [PATCH] Issue #2819 - New Navigation Shortcode Param options: {NAVIGATION: type=footer&layout=main} --- e107_core/shortcodes/single/navigation.php | 38 +++++++++++++++++++--- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/e107_core/shortcodes/single/navigation.php b/e107_core/shortcodes/single/navigation.php index 2e30956eb..fe6ac41df 100644 --- a/e107_core/shortcodes/single/navigation.php +++ b/e107_core/shortcodes/single/navigation.php @@ -1,6 +1,13 @@ 1, @@ -10,11 +17,32 @@ function navigation_shortcode($parm='') 'alt5' => 5, 'alt6' => 6, ); - - $category = varset($types[$parm], 1); - $tmpl = vartrue($parm, 'main'); + + + if(is_array($parm) && !empty($parm)) + { + $category = 1; + $tmpl = 'main'; + + if(!empty($parm['type'])) + { + $cat = $parm['type']; + $category = varset($types[$cat], 1); + } + + if(!empty($parm['layout'])) + { + $tmpl= $parm['layout']; + } + } + else + { + $category = varset($types[$parm], 1); + $tmpl = vartrue($parm, 'main'); + } + $nav = e107::getNav(); - + $template = e107::getCoreTemplate('navigation', $tmpl); $data = $nav->initData($category); // $data = $nav->collection($category);