Forums / Developer / how to create custom tab with submenu in admin interface
Vytautas Germanavičius
Wednesday 08 February 2006 11:00:48 am
i have extension which hase several functions.How to make theese function acessible from menu in admin interface.
{set-block scope=root variable=cache_ttl}0{/set-block}
Bruce Morrison
Wednesday 08 February 2006 2:22:20 pm
Hi Vytis
You need to add a menu.ini.append.php to the settings directory of your extension.
<?php /* #?ini charset="iso-8859-1"? [NavigationPart] Part[ezformsnavigationpart]=Forms [TopAdminMenu] Tabs[]=[modulename] [Topmenu_[modulename]] NavigationPartIdentifier=ez[modulename]navigationpart Name=[Text you want to appear on tab] Tooltip=[Tooltip when you mouse over the tab] URL[] URL[default]=[URL to extension main function] Enabled[] Enabled[default]=true Enabled[browse]=false Enabled[edit]=false Shown[] Shown[default]=true Shown[navigation]=true Shown[browse]=true */ ?>
To ensure the Tab is selected when you are within your extension you need to define the function views in modules/modulename/module.php like this
$ViewList["setup"] = array( 'functions' => array( 'edit' ), "script" => "setup.php", "params" => array( ), "default_navigation_part" => 'ez[modulename]navigationpart' );
in all examples [modulename] (including [] ) should be replaced with your module name.
HTH
CheersBruce
My Blog: http://www.stuffandcontent.com/ Follow me on twitter: http://twitter.com/brucemorrison Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish
Wednesday 08 February 2006 11:09:51 pm
tab in the top - it's easy. i found description how to do it in documentation. Thing what i missed - how to craete submenu in the left side. I need it , because my extension has several function and i cannot put everything to top menu. Looked to all ini files, and php files, but i did not found where it is created.I cannot believe, that menu is hardcoded to templates...
Łukasz Serwatka
Wednesday 08 February 2006 11:25:34 pm
This is currently not supported by Exponential 3. If you want to add right sub-menu you need to edit design/admin/templates/pagelayout.tpl template.
Personal website -> http://serwatka.net Blog (about eZ Publish) -> http://serwatka.net/blog
Thursday 09 February 2006 3:09:22 pm
Hi Vytis & Lukasz
@Lukasz This is something I posted as a suggestion back in May 05http://ez.no/community/bugs/ability_to_include_extension_specific_left_hand_menus_in_admin_interface
Do you know if there is any chance that this may be added ? Having modifed pagelayout for admin just for an extension is a real overkill and makes upgrades an issue.
@VytisIn the meantime I end up adding the extension specific menu items to the main content area via an include.
Thursday 09 February 2006 11:44:29 pm
Hi Bruce,
Yes, this will be definitely improved in version 4 of Exponential.