Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Needs to be ported to Drupal 7.
Comment | File | Size | Author |
---|---|---|---|
#35 | 1037362-35.patch | 2.92 KB | sammys |
#33 | container.png | 41.66 KB | schildi |
#30 | drupal-7-port-1037362-30.patch | 7.49 KB | bocaj |
#30 | menu_item_container.zip | 59.92 KB | bocaj |
#22 | drupal-7-port-1037362-22.patch | 8.81 KB | bocaj |
Comments
Comment #1
JohnAlbinGetting started.
http://drupal.org/cvs?commit=495554
http://drupal.org/cvs?commit=495820
http://drupal.org/cvs?commit=495828
But not done yet.
Comment #2
Kreativs CreditAttribution: Kreativs commentedsubscibe
Comment #3
enkara CreditAttribution: enkara commentedsubscribing
Comment #4
santam CreditAttribution: santam commentedsubscribing
Comment #5
Jarek_Sz CreditAttribution: Jarek_Sz commentedsubscribe
Comment #6
psnabe CreditAttribution: psnabe commentedAny news about this?
Comment #7
jonasdowney CreditAttribution: jonasdowney commentedsubscribe
Comment #8
ryan.armstrong CreditAttribution: ryan.armstrong commentedsub. Saw your presentation at Chicago John, looking good!
Comment #9
BenK CreditAttribution: BenK commentedAlso subscribing after attending your DrupalCon presentation... looking forward to this in D7!
--Ben
Comment #10
ckrinasubscribe
Comment #11
KirstenLangholz CreditAttribution: KirstenLangholz commentedSubscribing and kindly asking for a time frame....thank you so much!!!!
Comment #12
NPC CreditAttribution: NPC commentedSubscribing :)
Comment #13
Countzero CreditAttribution: Countzero commentedSubscribing. This is much needed for advanced menu management in D7. I'll have a look to see if I can be of any help.
Thanks for your work.
Comment #14
Countzero CreditAttribution: Countzero commentedI worked on the port yesterday, but I must say there is really a lot of work to be done :
- the menu system completely changed
- the database API too
- the form API too
So updating the code for the management forms (with validations and submit functions, and the correct menu arrays) tends toward a complete rewrite.
I'm asking myself if starting from scratch wouldn't be a better option.
What do the maintainers think about this ?
Comment #15
dgastudio CreditAttribution: dgastudio commentedsub
Comment #16
ovg CreditAttribution: ovg commentedThere is another module: http://drupal.org/project/special_menu_items, with a d7 version that worked for me: http://drupal.org/node/1007054#comment-4370936.
Comment #17
vishalkhialani CreditAttribution: vishalkhialani commentedthis link is for d6 not d7. Did you make some changes ?
cheers,
Vishal
Comment #18
gagarine CreditAttribution: gagarine commentedThis module is almost the same than special menu item. They should fusione. This is not an hard task they are very simple module.
I'm for keepking special menu item because they are way more user. So I don't think we should make a D7 version of this module. As mentioned they is already a port https://github.com/webflo/special_menu_items so fork it and add the features you want to see (it's fast is on github for the moment).
Comment #19
ovg CreditAttribution: ovg commented@Vishal: the file I downloaded on the 1st of June also had 6 in the file name, but it really had 7 inside. I see they have fixed that now.
Comment #20
vishalkhialani CreditAttribution: vishalkhialani commented@ovg: thanks I got it done :)
Comment #21
lsancheztapia CreditAttribution: lsancheztapia commentedsubscribe
Comment #22
bocaj CreditAttribution: bocaj commentedI prefer this module over Special Menu Items (just personal preference) and am in the middle of a website that I needed this functionality for. I decided that I would pick up where @JohnAlbin left off on the D7 port.
Below is a patch and the complete module for anyone else that is interested.
The patch is rolled against: http://drupal.org/node/1014334/release?api_version[]=103 (January 23, 2011)
EDIT: Don't use this patch/zip file! Use one below instead.
Comment #23
bocaj CreditAttribution: bocaj commentedAs I got more into the project I realized that there were some things that I missed :-/
Here is an update that hopefully fixes things a little better!
Comment #24
keva CreditAttribution: keva commentedInstalling the module in #23 gave this error:
Then adding a container in the menu gave these errors:
The menu item is created, but instead of being a container, it's a link with path "/menu-item-container/1" (note: the container link appears in a Nice Menu; in the menu edit screen at admin/structure/menu/manage/main-menu/list, the container does not have a link).
Clicking "edit" for the container gives these errors:
Comment #25
bocaj CreditAttribution: bocaj commented@keva: You are correct on the Nice Menus issue. I don't know Nice Menus well enough to know how to handle it. Maybe someone here will know of a way to handle the Menu Item Container "links" when presented in Nice Menus. If I get a chance I will look into it, but since I don't (or rarely) use Nice Menus I'm not sure when that would be.
The "errors" that you are referring to are actually notices (as you can see each line starts with "Notice:"). From what I understand from what I've read Drupal 7 changed the error reporting settings from Drupal 6, in order to get ready for the new requirements/recommendations of PHP 6 (I think)? Anyway, as you can tell I'm not completely sure of the exact changes, but I found a blog post (http://www.citytree.be/blog/undefined-index-quick-fix-in-drupal7-error-r...) that tells how to get rid of those notices. Unfortunately it seems to get rid of legitimate errors as well so beware of that if you are a developer.
Having said all that, those notices are probably something that should be addressed anyway, so if/when I get a chance I will try to reroll a patch that eliminates those.
Comment #26
santam CreditAttribution: santam commentedThe same issue is seen with the superfish module as above
Comment #27
podaroksubscribe
Comment #28
EvanDonovan CreditAttribution: EvanDonovan commentedFrom what I remember of John Albin's Chicago presentation, this module has a better architecture than Special Menu Items so I would support its being ported in preference to that module.
Is #23 the most recent work done on a port?
Comment #29
gagarine CreditAttribution: gagarine commentedI change the architecture of the D7 version of Special Menu items (I didn't write the D6). But what I really want is #1287610: Create a Menu Item Type API so we can fusion those two module and also menu first child.
Comment #30
bocaj CreditAttribution: bocaj commentedHere is an updated version I put together that should take care of the PHP notices mentioned in #24 and added preliminary support for Nice Menus module.
Still needs a lot of testing and could probably use a good code review.
One thing I did notice that I didn't do anything with is that there is a call to hook_preprocess_page() that is modifying the main and secondary menus. That should probably be pulled out of hook_preprocess_page() and be put into the appropriate menu preprocess function(s).
Comment #31
zroger CreditAttribution: zroger commentedpatch does not apply. I'm testing #23 in the meantime.
Comment #32
TaraRowell CreditAttribution: TaraRowell commentedComment #33
schildi CreditAttribution: schildi commentedUsing your module from #30 in combination with "nice menus" or "superfish" always leads to the "notice" that the index "breadcrumb" is invalid. The output of module devel is attached as screenshot to this post.
EDIT:
the problem seems to be at the end of function menu_item_container_clean_breadcrumb when returning some result.
return $function($breadcrumb);
The function "garland_breadcrumb" is called with the empty array "breadcrumb" as argument.
Does this tell something meaningful to somebody?
I am completely unfamiliar with this module but need it. Please help!
Comment #34
couloir007 CreditAttribution: couloir007 commentedsubscribe
I'm using Omega and getting the exact same breadcrumb error.
Comment #35
sammys CreditAttribution: sammys commentedHi there. Thanks for a super module (D6 hehe).
I've had to patch the D7 port further to get it working for live use. The patch applies to the master branch as of 21 Feb (commit 87db3203e4505b2b2cc73e838e5cb81a7df2834f).
The fixes in this patch are:
$link
array as a stringComment #36
schildi CreditAttribution: schildi commented@sammys
thank you very much for your efforts and reacting so quickly!
But, sorry, I can't find the commit you pointed to. What I can see is
- a message "There is no code in the master branch ..."
- searching for the commit-ID you provided did not succeed
- last commit seems to be from 14. Dec. 2011
Probably that is my fault since I am not an experienced GIT user. Or is there a larger delay until the recent commit will be visible?
Comment #37
carl.ben CreditAttribution: carl.ben commented@schildi:
the git branch is at https://github.com/jacobneher/menu_item_container
Comment #38
schildi CreditAttribution: schildi commented@carl.ben
thanks for the hint. Now I got it.
@sammys
I installed your sources and applied the patch from #35. The formerly described errors don't appear any longer. Only the warnings - as discussed in #24 / #25 - are still present when editing a block
admin/structure/menu/item/[some ID]/container/edit
And when entering /admin/structure/block or /admin/structure/menu the following message comes up
Comment #39
ceberlin CreditAttribution: ceberlin commentedI need this sort of module right now to structure an overlong menu and I prefer the concept of this module much over Special Menu Item.
I tried the latest GIT version from February 12 - thanks, as always, for the commit!!!
Small bug: If I edit the settings, the Parent link is not shown correctly but something completely different.(fixed with patch from #35 above)If I may add a small suggestion, since this module is both a menu item and also kind of a block item. I would love very much to have different fields for the Administrative Title (internal name) and the Block Title (headline to display for this sub-block). A behavior which the very cool Menu Blocks Module has implemented for the same reasons. For Example I could use CAPITALS internally and normal writing externally. This makes Parent Item selections within Node edits much more accessible.
Comment #40
ceberlin CreditAttribution: ceberlin commentedI could not access the titles of the containers via css... just could not get it working. No idea, why...
So I changed something in the module to make them accessible for me (needed some tags around the titles).
Last line in module, added h4 tags - just as a proof of concept:
+ return '<' . $tag . drupal_attributes($options['attributes']) . '>' . (!empty($options['html']) ? '<h4>'.$element['#title'].'</h4>' : '<h4>'.check_plain($element['#title'])).'</h4>' . $sub_menu . '</' . $tag . '>';
So, is this a good idea? - or how would be the proper way to style the titles?
I am a designer, not a coder.... and I would normally NEVER touch modules.
But I needed a quick solution and this D7 module version seems not to be maintained, right now?
Comment #41
JohnAlbinReverting title
Comment #42
ceberlin CreditAttribution: ceberlin commentedUps. sorry.
Comment #43
p.michaelis CreditAttribution: p.michaelis commentedsubscribe
Comment #44
mikeker CreditAttribution: mikeker commentedIt seems that the D7 port is getting hung up on compatibility issues with other menu-related modules such as Nice Menus and Superfish (with more to come, I would guess).
I was playing around with getting MIC working on D7 this weekend and through it might be a better approach to move menu compatibility to submodules and provide a couple of hooks (eg:
hook_menu_item_container_theme_hooks
andhook_menu_item_container_breadcrumbs
) which would allow the Nice Menus submodule to tweak the display of containers and breadcrumbs when Nice Menus is enabled.Advantage is that we could get the "core" MIC module ported to D7 quickly without a lot of
if (module_exists('...'))
clutter. Downside: lots of little bitty modules which might complicate the installation for newer users.I'm most of the way to a patch that would do this (it is based on JohnAlbin's commits from #1 plus the patch in #23). But I wanted to see if anyone had thoughts on this approach. Good idea or overzealous abstraction?
Comment #45
bocaj CreditAttribution: bocaj commented@mikeker: I like the idea. If nothing else just temporarily while getting MIC fully D7 compatible. I think that having separate submodules could be nice permanently as well. It would definitely help with maintenance I think and wouldn't be too much of an inconvenience for usability. I'd say post the patch and we can all take a look at it! Thanks for your work on this! I'd love to see MIC get fully integrated with D7. I'm using my patch in #23 for projects now, but it's definitely not ideal.
Comment #46
likewhoa CreditAttribution: likewhoa commentedupdating to keep better track of task.
Comment #47
Alexandr.P CreditAttribution: Alexandr.P commentedCalled from \menu_item_container\menu_item_container.admin.inc, line 122
fix
old
new
Undefined index: menu_name in menu_item_container_route_menu_item()
old
new
Comment #48
Alexandr.P CreditAttribution: Alexandr.P commentedWhen you delete a menu item.
Warning: Parameter 1 to menu_item_container_delete_form() expected to be a reference, value given in call_user_func_array() (line 795 of \includes\form.inc). =>
Comment #49
klonos...I say we close this issue here (since it was about creating an initial 7.x version and we do have one now) and file separate issues against the 7.x branch. Reporting all issues related to the 7.x-dev in this single place is confusing and hard to keep track.
Comment #50
JohnAlbinThe port in the 7.x-1.x-dev isn't complete. And the patches posted here (and the github repo) haven't been included in this project.
Comment #51
granticusiv CreditAttribution: granticusiv commentedIs there an alternative to this module in D7?
Comment #52
SebCorbin CreditAttribution: SebCorbin commentedYes, see Special Menu Items https://www.drupal.org/project/special_menu_items and its keyword
BTW, Menu Item Container should update its description mentioning this
Comment #53
granticusiv CreditAttribution: granticusiv commentedThanks Seb
Comment #54
Mile23This module seems to fit my use case where special_menu_items can't.
I want a top-level menu item that isn't a link, that has child links. Maybe I'm missing a feature of SMI.
Anyway, what will it take to move this forward to at least have a dev release?
Help me get rid of the PHP filter menu block they put on this site I'm maintaining! :-)
Comment #55
timfletcher CreditAttribution: timfletcher as a volunteer commentedI'm in the same boat as @Mile23, special_menu_items causes my PathAuto URL paths to break by adding 'nolink'into them and not respecting pre-set URL values. Instead, menu link URLs are transliterated by PathAuto based on the menu item title...