Forums / Setup & design / New tab in administration menu

New tab in administration menu

Author Message

Pascal France

Thursday 26 January 2006 7:39:27 am

Hi,

I'm trying, since yesterday, to add a new tab (like Content structure Media library User accounts Webshop Design Setup My account) to the administration menu.

I've added this line:

Part[ezpascalnavigationpart]=My new tab

to settings/siteaccess/mydomain_admin/menu.ini.append.php (in [NavigationPart]) and this one:

Tabs[]=My new tab
in the same file (in [TopAdminMenu])

But something is missing and I realy don't know what.
I can see the new tab but without any link inside. I would hope there would have "My new tab" link.

Thinks for your help

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Sebastian Picklum

Thursday 26 January 2006 8:14:58 am

Hi,

I understand you entered something like this:

[NavigationPart]
Part[ezyournavigationpart]=yourtab
...
[TopAdminMenu]
Tabs[]=yourtag
...

So far, so good! But one thing is missing: Below [TopAdminMenu] you'll need to insert something like this:

[Topmenu_yourtab]
# Uses a custom navigation part (See list NavigationPart group above)
NavigationPartIdentifier=ezyournavigationpart
Name=Label of the Menu-Item
#Tooltip=A custom tab for eZ publish
URL[]
URL[default]=content/view/example
Enabled[]
Enabled[default]=true
Enabled[browse]=false
Enabled[edit]=false
Shown[]
Shown[default]=true
Shown[edit]=true
Shown[navigation]=true
# # We don't show it in browse mode
# Shown[browse]=false

I think, you can figure the rest out yourself... :-)

Regards

Sebastian

sp@php.net

Pascal France

Thursday 26 January 2006 9:29:07 am

Hi Sebastian,

There is something wrong with:

Tabs[]=mytag

It doesn't display anything.

I've notice that, for exemple, the last default "Tabs" is

Tabs[]=my_account

and "my_account" can't be anything. If I replace it by "aaaaa" the link desappears in the tab. And it's the same for each "Tabs"

But, what are "content" "media" "users" "shop" "design" "setup" "my_account" ?
At fisrt, I thought they were "Sections". But not at all.
So, where are they defined ?

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Sebastian Picklum

Thursday 26 January 2006 12:08:01 pm

yourtag was a typo of a placeholder named "yourtab" :-)

In the code-samples I gave you, you have to replace all occurrences of "yourtab" and "ezyournavigationpart" with your values, e.g. you want to display a tab with the label "Community" then you could replace "yourtab" with "communitytab", "[Topmenu_yourtab]" with "[Topmenu_communitytab]", "ezyournavigationpart" with "ezcommunitypart" and so on.

By the way. In the [Topmenu_...] section you can specify the string that you will see on your tab by assigning it to Name=

To make the system a little bit clearer:

First, define with a [Topmenu_...] section the attributes you want your tab to have (name, URL etc) then assign this as a [NavigationPart]. Remeber that Part[XXX]=YYY of the navigationpart section has to be equal to NavigationPartIdenfifier=XXX in the [Topmenu_YYY] section.

Now, you have a tab that can be integrated into a menu.

To show your tab in the top admin menu, just add the Tabs[]=YYY tab to the [TopAdminMenu] section.

sp@php.net

Pascal France

Thursday 26 January 2006 12:44:22 pm

Hi Sebastian,

Of course I took care about the syntax.
But I think this is not sufficient.
I've dicover this file:

kernel/common/eztopmenuoperator.php

and it seems it's the first place where we have to define the new tab (even its name) in order it appears in the menu. If you change a name in menu.ini, you will see there is no effect. Anyway, it's like that for me !

After, I think we have to configure menu.ini

When I would have finish to look at all that I will give my feedback. I'm not realy sure to have understand all about navigation part ;-)

Regards

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Sebastian Picklum

Thursday 26 January 2006 1:43:25 pm

Hi Pascal,

the following file is the complete menu.ini of an eZp 3.6.5 installation that has an additional "Batch-Upload"-Tab.
http://www.muenster.de/~picklum/menu.ini

In my setup, this configuration looks like
http://www.muenster.de/~picklum/topmenu.png

The complete tab definition was done in the ini-file. I haven't had to modify anything besides menu.ini.

Regards,

Sebastian

sp@php.net

Pascal France

Friday 27 January 2006 3:46:46 am

Hi Sebastian,

I've tried another time and... you're absolutely right !

I would like to do another "Content structure" (but with some other objects inside of course) which will be named "My new part".
Now, I've a new tab named "mynewpart" with a link "My new part" inside.
I've to modify "URL[default]=" but how should I change it ?
I've noticed that there is a kernel/<folder> for each existing tab and I've tried to copy kernel/content to kernel/mynewpart and I've put:

URL[default]=mynewpart/view/full/
URL[browse]=mynewpart/browse/

But of course the object number is missing.
How can I display a left empty menu when I clic on the link "My new part" to be able to create the first object like "eZ publish" in the left menu in "Content structure" ?

Thinks a lot for your help.

Regards

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Sebastian Picklum

Sunday 29 January 2006 11:31:08 pm

Hi Pascal,

You want to have a second content tree? I think that's not possible (eZ Crew: Please correct me if I'm wrong).

What you can do: Create two folders at the top level of the content tree and configure your first siteaccess to use the first folder as root node and the second siteaccess to use the second folder as root node.

Regards,

Sebastian

sp@php.net