CMS Configuration: Difference between revisions
Jump to navigation
Jump to search
(Created page with "==Framework== ===Page headers=== ====Breadcrumbs==== ====Utility links==== *Global variable <code>$nav_menu</code> **Declared in <code>/_hostmgr/_config/config.php</code> **<c...") |
No edit summary |
||
| Line 17: | Line 17: | ||
:*<code>$dom_id</code> (Optional) Sets the id attribute of the menu item element. Hook for selecting the element with JQuery. | :*<code>$dom_id</code> (Optional) Sets the id attribute of the menu item element. Hook for selecting the element with JQuery. | ||
:*<code>$attributes</code> (Optional) Hook to set any additional attributes for the menu item element. This could be set to <code>"data-id=\"123\""</code> for example. | :*<code>$attributes</code> (Optional) Hook to set any additional attributes for the menu item element. This could be set to <code>"data-id=\"123\""</code> for example. | ||
==Listings Pages== | |||
===JQuery/AJAX=== | |||
Bare-essentials listings handlers. Where the <code>.datepicker()</code> and <code>$('.update-cache')</code> handlers are extra optional functionality. | |||
The code below will attach the handlers and refresh them as content on the page gets refreshed after records are deleted and after paging, etc. | |||
Best practice is to roll whatever options are relevant here into a routine that can be shared by the various CMS sections of a site. E.g. <code>LITTLED.CMS.bindListingsHandlers()</code>. | |||
<syntaxhighlight lang="php"> | |||
$(document).ready(function() { | |||
LITTLED.init({ setSortables: LITTLED.Listings.bindListingsHandlers}); | |||
LITTLED.setSortables(); | |||
$('.datepicker').datepicker(); | |||
$('#listings-container').on('click', '.update-cache', LITTLED.updateCache); | |||
}); | |||
</syntaxhighlight> | |||
[[Category:CMS Documentation]] | [[Category:CMS Documentation]] | ||
Revision as of 16:58, 13 February 2012
Framework
Page headers
Breadcrumbs
Utility links
- Global variable
$nav_menu- Declared in
/_hostmgr/_config/config.php nav_menu_classdefined in[COMMON_CLASS_DIR]navmenu/nav_menu_class.php
- Declared in
- Create an new utility link with
$nav_menu->add_node($label, $url, $target, $onclick, $level, $dom_id, $attributes);
$labelText label displayed for this item in the navigation menu.$url(Optional) The URL the menu item links to.$target(Optional) Menu item target. Allows for opening the URL in a new browser window.$onclick(Optional) JavaScript "onclick" code. Best to set a selector with$dom_idand set the handler with JQuery on page load.$level(Optional) Indentation level of the menu item. Defaults to 0.$dom_id(Optional) Sets the id attribute of the menu item element. Hook for selecting the element with JQuery.$attributes(Optional) Hook to set any additional attributes for the menu item element. This could be set to"data-id=\"123\""for example.
Listings Pages
JQuery/AJAX
Bare-essentials listings handlers. Where the .datepicker() and $('.update-cache') handlers are extra optional functionality.
The code below will attach the handlers and refresh them as content on the page gets refreshed after records are deleted and after paging, etc.
Best practice is to roll whatever options are relevant here into a routine that can be shared by the various CMS sections of a site. E.g. LITTLED.CMS.bindListingsHandlers().
$(document).ready(function() {
LITTLED.init({ setSortables: LITTLED.Listings.bindListingsHandlers});
LITTLED.setSortables();
$('.datepicker').datepicker();
$('#listings-container').on('click', '.update-cache', LITTLED.updateCache);
});