Binders: geolocation

TODO:

 

/*
 * Get geolocation

{{geolocation}}

{{geolocation assign_to="geolocation"}}




  $geolocation['country']         // United States
  $geolocation['country_code']    // US
  $geolocation['city']            // Saint Louis
  $geolocation['region'] =        // Missouri
  $geolocation['region_code']     // MO
  $geolocation['latitude']        // 38.6134
  $geolocation['longitude']       // -90.290703
  $geolocation['currency']        // $
  $geolocation['currency_symbol'] // &#36
  $geolocation['ip']              // 71.85.231.226
  $geolocation['data'] = {object};
   {
    "geoplugin_request":"71.85.231.226",
    "geoplugin_status":200,
    "geoplugin_credit":"Some of the returned data includes GeoLite data created by MaxMind, available from <a href=\\'http:\/\/www.maxmind.com\\'>http:\/\/www.maxmind.com<\/a>.",
    "geoplugin_city":"Saint Louis",
    "geoplugin_region":"MO",
    "geoplugin_areaCode":"314",
    "geoplugin_dmaCode":"609",
    "geoplugin_countryCode":"US",
    "geoplugin_countryName":"United States",
    "geoplugin_continentCode":"NA",
    "geoplugin_latitude":"38.6134",
    "geoplugin_longitude":"-90.290703",
    "geoplugin_regionCode":"MO",
    "geoplugin_regionName":"Missouri",
    "geoplugin_currencyCode":"USD",
    "geoplugin_currencySymbol":"&#36",
    "geoplugin_currencySymbol_UTF8":"$",
    "geoplugin_currencyConverter":1
  }


 */

 

Binders: gallery

TODO:

 

/**
 * Access an image gallery embedded inside a post or page.
 *
 * TODO: consider writing a "galleries" binder to handle multiple galleries
 *  {{gallery post_name="some-page-slug" assign_to="my_gallery"}}
 */


<!-- example -->

{{gallery post_name="my_gallery" assign_to="my_gallery"}}
{{foreach $my_gallery.data as $photo}}
<div class="col-md-3 col-sm-6 project">
	<div class="background-image-holder">
		<img class="background-image" alt="{{$photo.data.post_title}}" src="{{$photo.url}}">  
	</div>
</div>
{{/foreach}}

 

Binders: dump

In doubt dump. The dump binder will allow to output any variable available in the template. If you use a different binder and assign the response to a variable, you can use the dump binder to inspect the content of the variable and recursively print all its properties.

Parameters

var

(string) (required) The name of the variable that you wish to inspect.

 

Return

Outputs the content of the specified variable. If the variable does not exists, dump will an HTML comment indicating that the variable is missing.

 

Example

 

{{dump var="foo"}}

# OR

{{dump var="{{$some_variable}}"}}

 

 

Binders: date

TODO:

 

/**
 * Appcropolis Site Binder: date
 * 
 * Reformat a post/page date
 *
 * @param {array} $params 
 *            $params['format'] 
 *            $params['when'] Post/Page date . If not value is passed, this will return the current date with the provided format.
 *            $params['elapsed'] If set (to any value), it will return the time ago.
 *            $params['daysafter'] Number the of days after present date.
 *            $params['daysbefore'] Number the of days before present date.
 *            $params['assign_to'] Variable withing the template engine to which the content has to be assinged. 
 *
 * 
 * @example
 * 
 * # EXAMPLE 1
 * 
 * {{date format="F j, Y" when="2015-02-27 11:33:20" assign_to="my_date"}}
 * <p>Created on {{$my_date}}</p>
 * 
 * # EXAMPLE 2
 * 
 * {{date elapsed="true" when="2015-02-27 11:33:20" assign_to="time_ago"}}
 * <p>Created {{$time_ago} ago</p>
 * 
 * # EXAMPLE 3
 * 
 * <p>Created {{date when="2015-02-27 11:33:20" elapsed="true"}} ago</p>
 * 
 * # EXAMPLE 4
 * 
 * <p>This post was created {{date when="{{$post.post_date}}" elapsed="true"}} ago</p>
 *
 * 
 * @see http://php.net/manual/en/function.date.php
 *
 */