Difference between revisions of "Functions:pageMenuGet"
Line 61: | Line 61: | ||
|text | |text | ||
|String: The output text of the link. This is what the web site visitors should see as the link. This text is rawurlencoded in the database but rawurldecoded before the value is placed in this element. | |String: The output text of the link. This is what the web site visitors should see as the link. This text is rawurlencoded in the database but rawurldecoded before the value is placed in this element. | ||
− | |Category X | + | |Category X<br> |
− | Specials | + | Specials<br> |
Subcategory Y | Subcategory Y | ||
|- | |- | ||
|textRaw | |textRaw | ||
|String: non-rawurldecoded version of "text" | |String: non-rawurldecoded version of "text" | ||
− | |Category%20X | + | |Category%20X<br> |
− | Specials | + | Specials<br> |
− | Subcategory%20Y | + | Subcategory%20Y<br> |
|- | |- | ||
|link | |link |
Revision as of 15:29, 1 October 2008
Description
eV::pageMenuGet() retrieves site menu data for use in displaying menus in page template management.
Syntax
$array = eV::pageMenuGet([$menuId]);
Paramaters
- $menuId INT (optional)
- specifies a specific menu to retrieve from the system. If not passed, the menu selected for the current page template will be used. If no menu is specified in the current page template, whichever menu is set as the default menu will be retrieved.
Return Values
Returns a multidimensional array where the first dimension is an associative array for each of the four menu locations (l,r,t,b), the second dimension is an array of the menu item in the location, and the third dimension is an associative array of menu item attributes. Return array is as follows:
Array ( [l] => Array ( [0] => Array ( [location] => String [id] => Int [text] => String [textRaw] => String [link] => String [newWindow] => INT [level] => INT [target] => String [display] => Bool [focus] => Bool ) [1] => Array ( .. same as above ..) [2]... ) [t] => Array ( .. same as above ..) [b] => Array ( .. same as above ..) [r] => Array ( .. same as above ..) )
Elements from the menu item associative array are as follows:
Element | Description | Example |
location | String: Reflects the menu bar location, either 'l' for left, 'r' for right, 't' for top, 'b' for bottom | r |
id | Integer: Returns the database unique id for this menu item. Useful to target specific menu items for individual display results or if individual menu items need to be tracked for certain purposes. | 196 |
text | String: The output text of the link. This is what the web site visitors should see as the link. This text is rawurlencoded in the database but rawurldecoded before the value is placed in this element. | Category X Specials |
textRaw | String: non-rawurldecoded version of "text" | Category%20X Specials |
link | String: use as the href value when linking the menu item. It is recommended that you test this element for content before creating the link, so that content managers can leave the content empty for non-linked menu elements (category headers, etc) | index.php?pageId=125 |
newWindow | Integer: either 1 or 0 to designate if clicking this link should open a new window or place the targetted url in the current window. This element is replaced by the target element. | 1 |
level | Integer: For tiered menus, designates what level of the tier this menu item is on. 0 for the top tier, increasing as the tiers lower. As many designs will have different styles for different tiers in the menu listing (especially for the left menu bar) this is useful to identify the current tier and output the appropriate style. | 2 |
target | String: the actual window the link is targeted towards (_self or _blank). This replaces the newWindow element. Simply place in the 'target' attribute of the href tag. | _blank |
display | Boolean: For reactive menus that display elements only as parent elements are selected, this will dignate
(via TRUE or FALSE) if this menu item is slated for display. This will also slate the parent menu item(s) to be displayed when a lower level menu item is selected |
TRUE |
focus | Boolean: States if this menu item is actually the current page the visitor is on. This is done by URL matching the contents of the 'link' element and the current URL. As some designs call for menu items that are current pages to be styled differently, this will allow identification of such menu items. | FALSE |
Examples
- example 1
example 1 goes here
- example 2
example 2 goes here