Binders: function

TODO:

Use this binder to create a function that can later on be invoke with {{call…}}.

 

{{function name="promo"}}
    {{if date('Y-m-d') < $expiration}}
    <h1>Get this promotion Now!</h1>
    <p><i>Expires {{$expiration}}</i></p>
    {{/if}}
{{/function}}


{{call promo expiration="2017-03-05"}} 

 

Binders: goto

TODO:

 

/**
 * Redirect to a different page based on a condition (if provided).
 * 
 * 
 * @example 
 *
 * # 1: Redirect to a URL.
 *
 * {{goto url="/preview/?{{$post.post_permalink}}"}}
 *
 * 
 * # 2: Redirect to coming soon page when access product page.
 * 
 * {{goto key="{{$post.post_name}}" condition="equal" value="product" url="/coming-soon/"}}
 *
 * 
 * # 3: Redirect to product page if anything else.
 * 
 * {{goto key="{{$post.post_name}}" condition="not" value="product" url="/product/"}}
 *
 * 
 * # 4: Redirect to page if page URL contains a keyword.
 * 
 * {{goto key="{{$post.post_permalink}}" condition="match" value="/free/" url="/promotion/"}}
 *
 * 
 * # 5: Force redirect after certain date.
 * 
 * {{goto key="{{date format='Y-m-d'}}" condition="match" value="2017-02-28" url="/order-now/"}}
 *
 *
 *
 */

 

Binders: condition

TODO:

 

/**
 * Renders a block of text based on the provided condition.
 * 
 * 
 * @example 
 *
 * 
 * # 1: Show only on product page.
 * 
 * {{condition key="{{$post.post_name}}" operation="equal" value="product"}}
 * 	<p>This is the product page!</>
 * {{/condition}}
 *
 *
 * # 2: Show on every page but product.
 * 
 * {{condition key="{{$post.post_name}}" operation="not" value="product"}}
 * 	<p>This is not the product page!</>
 * {{/condition}}
 *
 * 
 * # 3: Show if matching a regex.
 * 
 * {{condition key="{{$post.post_permalink}}" operation="match" value="/free/"}}
 * 	<p>This promotion will expire soon!</p>
 * {{/condition}}
 *
 * 
 * # 4: Show on certain date.
 * 
 * {{condition key="{{date format='Y-m-d'}}" operation="match" value="2017-02-28"}}
 * 	<p>Today is the date!</p>
 * {{/condition}}
 *
 * 
 * # 5: Show after certain date.
 * 
 * {{condition key="{{date format='Y-m-d'}}" operation=">" value="2017-02-28"}}
 * 	<p>Sorry, you missed it :-(</p>
 * {{/condition}}
 *
 *
 */

 

Binders: url

TODO:

 

/**
 * Outputs commonly used URLs
 * 
 * @param {array} $params
 * @param {array} $params['src'] URL keyword identifier (e.g home, blog, resources, etc.)
 * @param {array} $params['assign_to'] A variable to which you would like to assign the URL value.
 * @param {array} $params['redirect'] If "logout" URL is required, you can specify the page to which you would like to redirect
 * 
 * @example
 * 
 * {{url src="current"}} // outputs the current page URL
 *
 * {{url src="home"}} // outputs: http://mysite.com
 * 
 * {{url src="resources"}} // outputs: http://mysite.com/resources
 * 
 * {{url src="blog"}} // outputs: http://mysite.com/blog
 * 
 * {{url src="builder"}} // outputs: htt://builder.simplifysites.com
 * 
 * {{url src="builder_resources"}} // outputs: http://builder.simplifysites.com/resources
 * 
 * {{url src="vendors"}} // outputs: http://builder.simplifysites.com/resources/vendors
 * 
 * {{url src="logout" redirect="http://mysite.com"}} 
 * 
 * {{url src="admin"}}
 * 
 * {{url src="admin_ajax"}}
 */

 

Example:

<ol>
    <li>{{url src=""}}</li> 
    <li>{{url src="home"}}</li> 
    <li>{{url assign_to="my_url"}} (empty)</li> 
    <li>{{$my_url}}</li> 
    <li>{{url src="admin"}}</li> 
    <li>{{url src="admin_ajax"}}</li> 
    <li>{{url src="logout" redirect_to="http://google.com"}}</li> 
    <li>{{url src="resources"}}</li> 
    <li>{{url src="builder"}}</li> 
    <li>{{url src="builder_resources"}}</li> 
    <li>{{url src="vendors"}}</li>  
</ol>
<!--
1.  http://myproject-appcropolis.simplifysites.com
2.  http://myproject-appcropolis.simplifysites.com
3.  (empty)
4.  http://myproject-appcropolis.simplifysites.com
5.  http://myproject-appcropolis.simplifysites.com/wp-admin
6.  http://myproject-appcropolis.simplifysites.com/sites/myproject-appcropolis/wp/wp-admin/admin-ajax.php
7.  http://myproject-appcropolis.simplifysites.com/sites/myproject-appcropolis/wp/wp-login.php?action=logout&_wpnonce=e39d8ff9cd
8.  http://myproject-appcropolis.simplifysites.com/resources
9.  http://builder.simplifysites.com
10. http://builder.simplifysites.com/resources
11. http://builder.simplifysites.com/resources/vendors
-->

 

Binders: mailto

If you are concern about bad people scraping your website looking for email addresses, keep reading, the {{mailto …}} binder is the answer to your problems.

This binder automates the creation of a mailto: anchor links while providing you with encoding capability.

Examples:

{{mailto address="me@example.com"}}
<a href="mailto:me@example.com" >me@example.com</a>

{{mailto address="me@example.com" text="send me some mail"}}
<a href="mailto:me@example.com" >send me some mail</a>

{{mailto address="me@example.com" encode="javascript"}}
<script type="text/javascript" language="javascript">
   eval(unescape('%64%6f% ... snipped ...%61%3e%27%29%3b'))
</script>

{{mailto address="me@example.com" encode="hex"}}
<a href="mailto:%6d%65.. snipped..3%6f%6d">m&..snipped...#x6f;m</a>

{{mailto address="me@example.com" subject="Hello to you!"}}
<a href="mailto:me@example.com?subject=Hello%20to%20you%21" >me@example.com</a>

{{mailto address="me@example.com" cc="you@example.com,they@example.com"}}
<a href="mailto:me@example.com?cc=you@example.com,they@example.com" >me@example.com</a>

{{mailto address="me@example.com" extra='class="email"'}}
<a href="mailto:me@example.com" class="email">me@example.com</a>

{{mailto address="me@example.com" encode="javascript_charcode"}}
<script type="text/javascript" language="javascript">
    {document.write(String.fromCharCode(60,97, ... snipped ....60,47,97,62))}
</script>