[drupal-devel] [feature] menu.module feature: visible in breadcrumb, but not visible in tree

DFG drupal-devel at drupal.org
Tue Sep 20 02:04:46 UTC 2005


Issue status update for 
http://drupal.org/node/29621
Post a follow up: 
http://drupal.org/project/comments/add/29621

 Project:      Drupal
 Version:      cvs
 Component:    menu system
 Category:     feature requests
 Priority:     normal
 Assigned to:  DFG
 Reported by:  DFG
 Updated by:   DFG
 Status:       patch (code needs review)

I am still thinking, that it's worth to be commited.


Impatient, but tough, DFG




DFG



Previous comments:
------------------------------------------------------------------------

Thu, 25 Aug 2005 08:06:04 +0000 : DFG

Attachment: http://drupal.org/files/issues/menu.module_0.patch (3.9 KB)

I wonder that it isn't (until now) possible to add menu items, that are
visible in the breadcrumb but not in the menu tree. You need this e.g.
if you don't want to overbloat the menu, while have pages with subpages
that have also subpages and so on.


The menu system is already capable of this feature, but I am speaking
about menu.module, that is missing a way to configure this.


I added checkboxes, so that you have e.g. (the following is the
default):


  [x] Visible in tree
  [ ] Expanded
  [x] Visible in breadcrumb


You now have these checkboxes when editing an item in admin/menu, but
also in the new menu (on-the-fly) group when adding/editing a node.


I have a technical description of the changes that my patch will
commit, but also many screenshots, that show what is possible and how
the changes look.


I start with the screenshots:


(1) http://d-f-g.net/drupal/menu-module-patch/node-view.png
    Here you can see a very long breadcrumb, that was configured using
the menu module. The menu tree on the left is expanded until the last
menu item with the MENU_VISIBLE_IN_TREE flag.


(2) http://d-f-g.net/drupal/menu-module-patch/phpmyadmin-menu-table.png
    This is the interesting part of the menu table, viewed with
phpmyadmin.


(3) http://d-f-g.net/drupal/menu-module-patch/node-add.png
(4) http://d-f-g.net/drupal/menu-module-patch/node-edit.png
(5) http://d-f-g.net/drupal/menu-module-patch/admin-menu.png
(6) http://d-f-g.net/drupal/menu-module-patch/admin-menu-edit.png


------------------------------------------------------------------
Technical description, all changes in menu.module
------------------------------------------------------------------


- added 2 checkboxes in menu_edit_item_form():
  - checkbox "Expanded" was already there
  - checkboxes: added "Visible in tree" and "Visible in breadcrumb"
    - used the same coding style as for "Expanded"


- added handling of the 2 new checkboxes in menu_edit_item_save():
  - used the same handling style as for "Expanded"


- menu_overview_tree_rows():
  - the t('edit') button is no longer bound to MENU_VISIBLE_IN_TREE
    - instead to (MENU_VISIBLE_IN_TREE | MENU_VISIBLE_IN_BREADCRUMB)


- added the 3 checkboxes in menu_node_form():
  - this is the menu otf section (some call it so). the checkboxes
should not be missed there.


- menu_parent_options() and menu_overview_tree_rows():
  - t('disabled') no longer bound to !& MENU_VISIBLE_IN_TREE (see the
code...)
    - instead to !& (MENU_VISIBLE_IN_TREE | MENU_VISIBLE_IN_BREADCRUMB)


------------------------------------------------------------------


Best regards, DFG




------------------------------------------------------------------------

Sat, 27 Aug 2005 15:18:46 +0000 : jakeg

+1


Looks good, works well.


Only comment is  if we have "Home > 1 > 2" and you choose *not* to
display 2 in the breadcrumb, when on 3 (child of 2) should the crumb be
"Home > 1" or just "Home" ? At the moment the patch makes it just 'Home'
but I would opt for "Home > 1". That's how it works on the menu block
side of things as well..




------------------------------------------------------------------------

Sat, 27 Aug 2005 15:25:02 +0000 : jakeg

I take back my comment. It works as intended, my mistake.







More information about the drupal-devel mailing list