Help with menu syntax? [solved]

General project discussion. NOT for help questions.
Post Reply
mwy

Help with menu syntax? [solved]

Post by mwy »

Hello

I have had a slightly odd request from my client for the menu on the left of my screen. I think the answer lies in changing my menu_manager template code but I'm too much of a novice to manage it.

At present, the top level of menu choice is the horizontal menu, appearing on all pages. Entering the site there is no left hand menu. Clicking a toplevel option gives you that page contents, and (on the now appearing left menu) its children as links. Subsequent clicking down into the tree always gave you that page contents and (on the left menu) its children.

The client has now requested that the lefthand menu should:
(for clarity, I'm refering to the top level as Level 1)
  • At level 2, show only the children of the current page
  • At any level greater than 2, show only the page's parent, its siblings, and its children if any.
Is there a menu manager coding expert out there who could tell me what the syntax might be?

Thanks in advance

The above problem has been solved with a User Defined Tag containing the following code:
-----------------------
//Call menu manager with parent of current page unless at level 2
// coded PR 31-7-2007

global $gCms;
$menuModule = &$gCms->modules['MenuManager']['object'];
$position=$params['position'];
$arg['template']=$params['template'];
$arg['collapse']=1;
if (preg_match ("/^.....\......$/", $position))
    // at level 2
    $arg['start_level']=3;
else
  // deeper, truncate position to get parent
    $arg['start_element']=preg_replace("/\......$/", "", $position);

// call {Menu ...} smarty tag
$menuModule->DoAction('default', $id, $arg);
---------------------------------
and called in the template like this:
--------------------------------
{AceLeftMenu position=$position template='ACE_Menu_Left_temp'}
---------------------------------

hope that's helpful to someone! Let me know if there's somewhere else I can put this too
Last edited by mwy on Wed Aug 01, 2007 9:01 am, edited 1 time in total.
SimonSchaufi

Re: Help with menu syntax?

Post by SimonSchaufi »

i could help you. can you send a link?
mwy

Re: Help with menu syntax?

Post by mwy »

the website is

http://www.bath.ac.uk/ace/new

I've only been testing the menu code in one of my [sadly many] templates, so to see the existing state, click on anything two levels below Research (top) To see my attempt (!) at solving the problem, click on anything under Courses.

FYI: in the old version, I'm calling the menu using {menu template='ACE_menu_left' start_page=$page collapse='1'}

Let me know what other info you need -- I'm really appreciative of your time
Last edited by mwy on Sat Jul 28, 2007 6:14 pm, edited 1 time in total.
Post Reply

Return to “General Discussion”