• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: collapseable menus
PostPosted: Mon Nov 01, 2004 12:31 pm 
Offline
Forum Members
Forum Members

Joined: Thu Sep 23, 2004 11:06 am
Posts: 74
Is there away already to have lets say a bulletmenu for the navigation menu.

This menu when click would look exactly the same except the section that was cliked then would have its children displayed?

like this:

\$1:
item 1
item 2
item 3




item 2 is clicked

next page then looks like.

\$1:
item 1
item 2
  sub_item1
  sub_item2
item 3



Thanks in advance..
Rob


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: collapseable menus
PostPosted: Mon Nov 01, 2004 6:59 pm 
Offline
Power Poster
Power Poster

Joined: Sun Sep 26, 2004 6:15 pm
Posts: 598
Location: Saskatchewan - Canada
Like this one ...

Switch Menu

I am using this on one of my websites, works very well and is very minimal amount of code.

_________________
Greg


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: collapseable menus
PostPosted: Thu Jan 27, 2005 7:12 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Thu Jan 27, 2005 5:11 pm
Posts: 310
Location: Los Angeles, CA
brownrl \brownrl:
Is there away already to have lets say a bulletmenu for the navigation menu.

This menu when click would look exactly the same except the section that was cliked then would have its children displayed?

like this:

\$1:
item 1
item 2
item 3




item 2 is clicked

next page then looks like.

\$1:
item 1
item 2
  sub_item1
  sub_item2
item 3



Thanks in advance..
Rob


I don't know if you're still looking, but I just uploaded an alpha version of a module to the Wiki that includes functionality like this.

_________________
Many modules available from the http://dev.cmsmadesimple.org
The CMS Made Simple Developer Cookbook is now available from Packt Publishers!


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: collapseable menus
PostPosted: Thu Jan 27, 2005 8:06 pm 
Offline
Power Poster
Power Poster

Joined: Sun Sep 26, 2004 6:15 pm
Posts: 598
Location: Saskatchewan - Canada
I have the switch menu code working but the javascript conflicts with javascript from phplayers if it is installed. So you can have either the switch menu or the phplayers menu working on your site but not both at the same time!!

_________________
Greg


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: collapseable menus
PostPosted: Fri Feb 11, 2005 10:09 pm 
Greg,
Have u implemented switch menu to work as phplayers works? I mean when u add smth in content management it appears on the switch menu?
if yes, could u paste the code..

thx in advance.


Top
   
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Patch to bulletmenu
PostPosted: Fri Feb 18, 2005 12:58 pm 
I've patched the bulletmenu plugin to do exactly what you're describing. Apply this patch and then call bulletmenu with "collapse='1'" to see it in action.

If this patch doesn't come through in the forum very well, email me or get me on the IRC channel, I'll upload it somewhere and/or email it to whomever wants to commit it to SVN.


\$1:
Index: plugins/function.bulletmenu.php
===================================================================
--- plugins/function.bulletmenu.php   (revision 101)
+++ plugins/function.bulletmenu.php   (revision 103)
@@ -24,6 +24,8 @@
    # getting menu parameters
    $showadmin = isset($params["showadmin"]) ? $params["showadmin"] : 1 ;
 
+   $collapse = isset($params["collapse"]) ? $params["collapse"] : 0 ;
+
    $allcontent = ContentManager::GetAllContent();
 
    # defining variables
@@ -32,8 +34,20 @@
    $count = 0;
    $in_hr = 0;
 
+
+
    if (count($allcontent))
    {
+
+      if ($collapse) {
+         # find hierarchy
+         foreach ($allcontent as $onecontent) {
+            if ($gCms->variables['page_id'] == $onecontent->Id()) {
+               $myhier = $onecontent->Hierarchy();
+            }
+         }
+      }
+
       $menu .= "<div class="bulletmenu">\n";
 
       foreach ($allcontent as $onecontent)
@@ -51,6 +65,73 @@
             }
          }
 
+
+                  if ($collapse) {
+                     $thishier = $onecontent->Hierarchy();
+                     $mypieces = explode(".", $myhier);
+                     $thispieces = explode(".", $thishier);
+
+                     if (count($mypieces) > $thispieces)   
+                        $l = count($mypieces);
+                     else
+                        $l = count($thispieces);
+
+                     # root-level is excepted
+                     if (count($thispieces) > 1) {
+                        $continue = 1;
+                        $myh = $mypieces[0];
+                        $thish = $thispieces[0];
+                        for($i = 1; $i < $l; $i++) {
+
+                           if ($myh == $thish) {$continue = 0; continue;}
+                           if ($thispieces[$i] != '') $thish .= '.' . $thispieces[$i];
+
+                           if ($myh == $thish) {$continue = 0; continue;}
+                           if ($mypieces[$i] != '') $myh .= '.' . $mypieces[$i];
+
+                        }
+                        if ($continue) continue;
+                        if (count($thispieces) > count($mypieces)+1) continue;
+                        $tt = join('.', array_slice($thispieces,0,count($mypieces)));
+                        if (count($thispieces) > count($mypieces) && $myhier != $tt) continue;
+                     }
+                  }
+
          #Now check to make sure we're not too many levels deep if number_of_levels is set
          if (isset($params['number_of_levels']))
          {
@@ -110,13 +191,16 @@
             }
             else
             {
-               $menu .= "<li><a href="".$onecontent->GetURL().""";
+               $menu .= "<li class="bulletmenudepth" . count(explode(".", $onecontent->Hierarchy())). """;
+               $menu .= "><a href="".$onecontent->GetURL().""";
                if (isset($gCms->variables['page_id']) && $onecontent->Id() == $gCms->variables['page_id'])
                {
                   $menu .= " class="currentpage"";
+               } else {
+                  $menu .= " class="bulletmenudepth".count(explode(".", $onecontent->Hierarchy())) . """;
                }
                $menu .= ">".$onecontent->MenuText()."</a>";
-            }
+         }
             $in_hr = 1;
             $last_level = $depth;
          }
@@ -148,6 +232,7 @@
       <li><em>(optional)</em> <tt>showadmin</tt> - 1/0, whether you want to show or not the admin link.</li>
       <li><em>(optional)</em> <tt>start_element</tt> - the hierarchy of your element (ie : 1.2 or 3.5.1 for example). This parameter sets the root of the menu.</li>
       <li><em>(optional)</em> <tt>number_of_levels</tt> - an integer, the number of levels you want to show in your menu.</li>
+      <li><em>(optional)</em> <tt>collapse</tt> - 1/0, whether you want the menu to collapse all but the current.</li>
    </ul>
    </p>
 


Top
   
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: collapseable menus
PostPosted: Sat Feb 19, 2005 6:45 am 
Offline
Forum Members
Forum Members

Joined: Wed Jan 12, 2005 12:18 am
Posts: 131
I apologize for my ignorance... but how do I patch what I have with what you have? Is is supposed to be merged with the original? Or does it replace it?

thanks.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: collapseable menus
PostPosted: Tue Feb 22, 2005 3:35 pm 
Hi!

I still can't get how to patch the bulletmenu. Can someone experienced please help on this?

Krol


Top
   
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: collapseable menus
PostPosted: Tue Feb 22, 2005 3:36 pm 
Offline
Administrator
Administrator
User avatar

Joined: Fri Jun 11, 2004 6:58 pm
Posts: 3329
Location: Fairless Hills, Pa USA
This functionality is also in the bulletmenu version released with 0.9.

_________________
http://about.me/tedkulp


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: collapseable menus
PostPosted: Tue Feb 22, 2005 5:05 pm 
wishy \wishy:
This functionality is also in the bulletmenu version released with 0.9.


This is good!
But can I make Section Headers clickable, too?


Top
   
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: collapseable menus
PostPosted: Tue Feb 22, 2005 5:41 pm 
Offline
Administrator
Administrator
User avatar

Joined: Fri Jun 11, 2004 6:58 pm
Posts: 3329
Location: Fairless Hills, Pa USA
I didn't think of that... I'll have to come up with a fix somehow. Thanks.

_________________
http://about.me/tedkulp


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
A2 Hosting