how to create custom tab with submenu in admin interface

Author Message

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

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Vytautas Germanavičius

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...

{set-block scope=root variable=cache_ttl}0{/set-block}

Łukasz Serwatka

Wednesday 08 February 2006 11:25:34 pm

This is currently not supported by eZ publish 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

Bruce Morrison

Thursday 09 February 2006 3:09:22 pm

Hi Vytis & Lukasz

@Lukasz
This is something I posted as a suggestion back in May 05
http://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.

@Vytis
In the meantime I end up adding the extension specific menu items to the main content area via an include.

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Łukasz Serwatka

Thursday 09 February 2006 11:44:29 pm

Hi Bruce,

Yes, this will be definitely improved in version 4 of eZ publish.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 31 2025 06:18:26
Script start
Timing: Jan 31 2025 06:18:26
Module start 'layout'
Timing: Jan 31 2025 06:18:26
Module start 'content'
Timing: Jan 31 2025 06:18:26
Module end 'content'
Timing: Jan 31 2025 06:18:26
Script end

Main resources:

Total runtime0.0144 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0050 588.3906151.2422
Module start 'layout' 0.00500.0020 739.632836.7109
Module start 'content' 0.00700.0058 776.343898.3438
Module end 'content' 0.01280.0015 874.687537.9922
Script end 0.0143  912.6797 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002316.2365140.0002
Check MTime0.00107.1395140.0001
Mysql Total
Database connection0.00064.493710.0006
Mysqli_queries0.002014.068430.0007
Looping result0.00000.069710.0000
Template Total0.00128.110.0012
Template load0.00085.830710.0008
Template processing0.00032.211210.0003
Override
Cache load0.00064.249910.0006
General
dbfile0.001912.882480.0002
String conversion0.00000.048140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs