Recommended Links

Common For all pages

This section shows you how you can have editable content which is the same throughout the site ( NOTE: It is language specific ) .All the navs below are generated using snippets that are included with the framework, edit this content to see how it was generated

Sub Nav:

Main Nav:

Footer Nav:

Unique Per Page

Snippets

A Snippet is a PHP class file that is placed under the '/snippets/' directory. The name of the class must be the same as that of the php file i.e if you have a class file 'SubNav.php' the class name should be 'SubNav'.

A snippet is automaticly called by the framework there is no configuration needed

The Snippet Class must implement 2 static functions

  • public static function init( $currentController ) - This is called when the snippet class file is loaded.
  • public static function start( $params = array() ) - This is called everytime the snippet is parsed/executed.

It can be implemented through the view and can even be inserted using the WYSIWYG Editor in the following manner: {SnippetName?param1=`val1`&param2=`value2`} . A snippet may or may not have parameters associated with it .

There are a number of snippets that are now included, which make things allot simpler for integrating an new template into the Framework:

  • GenerateAdminNav | USAGE: {SnippetName?navId=`nav`}
    • Used to generate the Login and Logout Nav
  • GenerateBreadCrumb | USAGE: {SnippetName?navId=`nav`}
    • Used to generate the breadcrumb nav
       
  • GenerateFooterNav | USAGE: {SnippetName?navId=`nav`}
    • Used to generate the footer nav
       
  • GenerateLanguageSwitcherNav | USAGE: {SnippetName?navId=`nav`}
    • Used to generate the Language Switcher Nav
       
  • GenerateMainMenuNav | USAGE: {SnippetName?navId=`nav`}
    • Used to generate the Main Menu
       
  • GenerateSiteMap | USAGE: {SnippetName?navId=`nav`}
    • Used to generate the site map
       
  • GenerateSubNav | USAGE: {SnippetName?navId=`nav`}
    • Used to generate the sub nav of the current page
       
  • GenerateNav | USAGE: {SnippetName?controller=`main`&function=`index`&depth=`-1` ... }
    • Generates a Nav based on parameter arguments:
      • controller: The controller of the Node, this can be found from the "Edit Site Properties" section of the CMS
      • function: The function of the Node, this can be found from the "Edit Site Properties" section of the CMS
      • depth: the depth level of the nav to generate, it is set to -1 ( infinite depth ) by default, 0 is for first level
  • SearchForm | USAGE: ( USAGE: {SnippetName?formId=`searchForm`&label=`Search Site`} )
    • Used to generate the search form
      • formId: The ID of the form
      • label: The Label for the search box
  • LoadContentBucket | USAGE: {SnippetName?contentName=`uniqueSideContent`&editable=`true`&uniquePerPage=`true`}
    • Loads the contentBucket based on parameter arguments:
      • contentName: The Name of the content to load / set
      • editable: If true then it allows the admin's to be able to edit the content using the Edit In Place Editor
      • uniquePerPage: Specifies wether the content is common for the entire site or unique to the current page
         
  • GenerateBingMap | USAGE: {SnippetName?mapId=`bingMap1`&address=`1 Microsoft Way, Redmond, WA`&desc=`Microsoft HQ`}
    • Generates a Bing Map to the address given

See the BingMaps Snippet in action below ( You can edit this page and see how it was generated ) :


Site Powered by Mac's PHP MVC Framework Framework of the future
Design downloaded from Zeroweb.org: Free website templates, layouts, and tools.