HOW TO create tree menu works with different links?

Discuss everything related to ApPHP TreeMenu. Any questions related to the ApPHP TreeMenu developing or using should be posted to this forum.

Moderators: ne_moj, zewa, Milton

HOW TO create tree menu works with different links?

Postby administrator on Nov 17th, '10, 21:12

Sometime you need to create a side menu, that will work like tree menu and will reopen the page with different parameters.

Here the possible example:

$italy=$treeMenu->AddNode("Italy","index.php?page=category&cid=1");
$italy->OpenNewWindow(true);
$rome = $italy->AddNode("Rome","index.php?page=category&cid=2");
$rome->OpenNewWindow(true);
$milan = $italy->AddNode("Milan","index.php?page=category&cid=3");
$milan->OpenNewWindow(true);


and a result:
untitled.PNG
untitled.PNG (1.42 KiB) Viewed 2035 times
User avatar
administrator
Site Admin
Site Admin
 
Posts: 5904
Joined: Jan 7th, '09, 23:18

Re: HOW TO create tree menu works with different links?

Postby Melisabz on May 21st, '16, 11:53

I tried this code, but i have received some bug. Can you please check above code as working good or not
Melisabz
Newbie
Newbie
 
Posts: 1
Joined: May 21st, '16, 11:43
Location: Chennai

Re: HOW TO create tree menu works with different links?

Postby ne_moj on May 23rd, '16, 06:16

Hello Melisabz

Here is a working example, but you have to specify where is located the module TreeMenu:
Code: Select all
   if(!defined('TREEMENU_DIR')){
      ## *** include TreeMenu class
      define ('TREEMENU_DIR', 'modules/treemenu/');                  /* Ex.: 'treemenu/' */
      ## *** include TreeMenu class
      require_once(TREEMENU_DIR.'treemenu.class.php');
   }
   ## *** create TreeMenu object
   $treeMenu = new TreeMenu();
        ## *** set text direction
   $treeMenu->SetDirection(Application::Get('lang_dir'));
   ## *** set unique numeric (integer-valued) identifier for TreeMenu
   ## *** (if you want to use several independently configured TreeMenu objects on single page)
   $treeMenu->SetId(99);
   ##  *** set style for TreeMenu
   $treeMenu->SetStyle('vista');
   ## *** show debug info - false|true
   $treeMenu->Debug(false);
   ## *** set postback method: 'get', 'post' or 'ajax'
   $treeMenu->SetPostBackMethod('post');
   ## *** show number of subnodes to the left of every node - false|true
   $treeMenu->ShowNumSubNodes(true);
       
   $italy=$treeMenu->AddNode("Italy","index.php?page=category&cid=1");
   $italy->OpenNewWindow(true);
   $rome = $italy->AddNode("Rome","index.php?page=category&cid=2");
   $rome->OpenNewWindow(true);
   $milan = $italy->AddNode("Milan","index.php?page=category&cid=3");
   $milan->OpenNewWindow(true);
   
   $treeMenu->ShowTree();
User avatar
ne_moj
Master
Master
 
Posts: 208
Joined: Jan 1st, '16, 14:11


Return to ApPHP TreeMenu

Who is online

Users browsing this forum: No registered users and 1 guest