21 November 2013

Joomla: Table Menu

After experimenting with `#__menu` table I have discovered many interesting features.

There is a DB Table called #__menu in the joomla installation database. The function of each column is stated below.

id(INT) Primary key.

title(VARCHAR) Display name of the menu. Very important field.

Menu type(VARCHAR) *Tells if the menu is ‘main menu’, ‘top menu’ , ‘left-menu’ …. Admin menus are supposed to have ‘main’ value. But whether they are displayed on the back end or not is determined by ‘client_id’ field (see below), not here.*

alias(VARCHAR) Alias of ‘title’. But it doesn’t make any effect if it is populated or not. I tried to populate it and left the ‘title’ field blank. Then the menu became blank. But if I left ‘alias’ blank and fill ‘title’, the menu got text.

note(VARCHAR) Remark (or note).

path(VARCHAR) Path name to be displayed in the browser address bar. It doesn’t have to relate with the ‘link’ information. (But both ‘path’ and ‘link’ fields have to be filled in order the menu to work properly).

link(VARCHAR) URL. Tells where the system will go when the menu is clicked. Important.

type (VARCHAR) Tells if the menu is component or url(external link) … . (Seems, it is just an ‘extra’ information – no visible effect on the menu).

published (TINYINT)
1 – Published. 0 – Not published. Hide/Show the menu in the front end.


parent_id (INT)
0- ‘Main Item root’ value. It should exist only once.
1- List among menu items on level one.
x- If this value is given another menu’s id then it will automatically become a child (second level) menu and ‘pops out ‘of its parent menu.


level (INT) Level is expected to reflect its position in the menu hierarchy. Eg. If the menu has a parent of level one, its level must be 2. If it has a parent of level 5 it has to be level 6 menu. But Joomla seems to calculate its actual level by looking to its parents and ignore this value.

component_id (INT) Component id. Value is taken from #__extensions table. (But emptying this field doesn’t seem to have any effect).

ordering (INT) Ordering (standard joomla column).

checked_out (INT) Check out (standard joomla column).

checked_out_time (TIMESTAMP) Check out time (standard joomla column).

browserNav (TINYINT) ?

access (INT) Very important field.
1 – Public
2 – Registered users only.
3 – Special Users (Eg. Managers and Admins )


img (VARCHAR) Image path if you want the menu have a background image.

template_style_id (INT) Template Id attached to while viewing the page associated with this menu.

params (TEXT) Component configuration data.

lft (INT) ?

rgt (INT) ?

home (TINYINT) Joomla has to have one and only one default page. This value determines this.
1 – This page is default.
0 – Not default. Only one menu has to have value 1. (Most of the time ‘home’).
language (CHAR) For which languages the menu displays.

client_id (TINYINT)
0 – Open to public.
1 – Back end menu. Even if the menu is given a back end menu item as a parent_id, if ‘client_id’ has value of 0, the menu will not display in admin side. But whatever value you give in ‘Menu type’ field, as long as ‘client_id’ value is 1 it will display in the back end.


Scenarios:
Menu type => ’main’ client_id =>’1’, published=> 1/0: In this case menu is only displayed in the back end. Published value has no effect.

Menutype=> ‘mainmenu’, ‘client_id’=>1, published=>1: The menu is displayed in both back end and front end. Published value determines its visibility. Whether the ‘menutype’ value is ‘main’ ,’mainmenu’, ‘top-menu’ … has no effect on its visibility in back end – only ‘client_id’ matters.

Menutype=> ‘mainmenu’, ‘client_id’=>1, published=>0: Has the same effect for admin side as the scenario above. But in front side, the menu is not visible (with published state 0).
ref:http://stackoverflow.com/questions/17142321/adding-joomla-menu-for-new-component-directly-in-db-joomla-2-5

No comments:

Post a Comment

Terima kasih