问题描述
在模块开发(webtv)中,我提供了可以为其内容(播放列表)配置的通用块。在配置表单上有添加内容(播放列表)的列表,以及链接添加新播放列表和编辑每个条目旁边的现有的列表。因为块配置路径是:admin / build / block / configure / [my_module_name] / [block_delta]。
我期望添加/编辑播放列表在单独的页面上,应该可以访问:
admin / build / block / configure / [my_module_name] / [block_delta] / playlist / add
和
admin / build / block / configure / [my_module_name] / [block_delta] / playlist / [playlist_id] / edit
为此,我在hook_menu中添加了两个条目,页面回调为drupal_get_form和页面参数作为表单定义函数
清除缓存并运行cron后,链接不会将服务器播放列表添加/编辑页面重定向到块配置页面。
$ b $我做错了什么?是否可以将块配置页面扩展到子页面?
在drupal(6)URL中允许的最大菜单部分是限制为7.在我的问题中,我引用了8和9部分的路径,这是问题。
admin / build / block / configure / [my_module_name] / [block_delta] / playlist / add
admin / build / block / configure / [my_module_name] / [block_delta] / playlist / [playlist_id] / edit
在Drupal 7中,限制扩展为9。
可手动更改在 drupal / includes / menu.inc
作为 define('MENU_MAX_PARTS',12);
In a module development (webtv) I am providing a generic block that can be configured for its contents (playlists). On the configure form there is a list of added contents (playlists) along with links "add new playlist" and "edit" existing one placed next to each entry. As the block configuration path is: "admin/build/block/configure/[my_module_name]/[block_delta]".
And I am expecting to add/edit playlist form on a separate page and should be accessible on:admin/build/block/configure/[my_module_name]/[block_delta]/playlist/addandadmin/build/block/configure/[my_module_name]/[block_delta]/playlist/[playlist_id]/edit
For this I added two entries in hook_menu with page callback as drupal_get_form and page argument as form defining function.
After clearing cache and running cron, links does not server playlist add/edit page but redirects to block configure page.
What am I doing wrong? Is it possible to extend block configure page into sub pages?
The maximum allowed menu parts in a drupal(6) URL are limited to 7. In my problem I have quoted paths with 8 and 9 parts that was the issue.
admin/build/block/configure/[my_module_name]/[block_delta]/playlist/add
admin/build/block/configure/[my_module_name]/[block_delta]/playlist/[playlist_id]/edit
In Drupal 7 the limit is expanded to 9.
It can manually be changed in the file drupal/includes/menu.inc
as define('MENU_MAX_PARTS', 12);
这篇关于Drupal过多的菜单部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!