Binders: pages

TODO:

 

/**
 * Smarty plugin
 * -------------------------------------------------------------
 * File:     function.bind.php
 * Type:     function
 * Name:     bind
 * Purpose:  includes template content
 * -------------------------------------------------------------
 *
 * @param {array} $params 
 *                  $params['child_of'] Parent page of which you wish to get its children
 *                  $params['assign_to'] Variable withing the template engine to which the content has to be assinged.
 *
 * @example
 * 
 * EXAMPLE #1:
 * {pages child_of="content-services"  assign_to="services_pages"}
 * 
 *
 */

 

Binders: page

TODO:

 

/**
 * Smarty plugin: page
 *
 * @param {array} $params 
 *                  $params['post_name'] Post/page slug name
 *                  $params['type'] Response data type
 *                  $params['assign_to'] Variable withing the template engine to which the content has to be assinged.
 *
 * @example
 * 
 * EXAMPLE #1:
 * {page post_name="about-us" assign_to="about_page"}
 * 
 */

 

Binders: meta

TODO:

 

/**
 * Smarty plugin: meta
 * Allow binding post or page metada to a template
 *
 * @param {array} $params 
 *            $params['post_id'] ID of the post or page
 *            $params['meta_key']
 *            $params['meta_value']
 *            $params['meta_single']
 *            $params['default']
 *            $params['type'] (optional) If is it set to 'object' it will return an object, otherwise it will return a JSON string.
 *            $params['assign_to'] Variable withing the template engine to which the content has to be assinged. 
 *
 * 
 * @example
 * 
 * # EXAMPLE 1 
 * {meta post_id="25" assign_to="my_meta"}
 * <p>My favorite color is {if $my_meta.data.color}$my_meta.data.color{else}UNKNOWN{/if}</p>
 * 
 * # EXAMPLE 2
 * {meta post_id="25" meta_key="color" assign_to="my_meta"}
 * <p>My favorite color is {if $my_meta.data.color}$my_meta.data.color{else}UNKNOWN{/if}</p>
 *
 * 
 * @see http://www.smarty.net/docs/en/plugins.functions.tpl
 *
 */

 

Binders: menu

TODO:

 

/**
 * Smarty plugin: menu
 * 
 * Binds menu data to a template
 *
 * @param {array} $params 
 *            $params['page_id'] 
 *            $params['menu_id']
 *            $params['assign_to'] Variable within the template engine to which the content has to be assigned. 
 *
 * 
 * @example
 * 
 * # EXAMPLE 
 * 
 * {menu menu_id="home" assign_to="menu" page_id="85"}
 * <ul>
 * 	<h2>My Menu</h2>
 * 	{foreach $menu as $item}
 * 		<li>
 * 			<a href="{$item.url}">{$item.title}</a>
 * 		</li>
 *  {/foreach}
 * </ul>
 *
 * 
 * @see http://www.smarty.net/docs/en/plugins.functions.tpl
 *
 */