Binders: header

TODO:

/**
 * Include required files and attributes in the page header.
 *
 * @param $params {array} 
 *          $params['title']
 *          $params['use_bootstrap']
 *          $params['use_fontawesome']
 *          $params['use_charset']
 *          $params['use_viewport']
 *          $params['use_wp_head']
 *          $params['use_compiled_stylesheet']
 *          $params['use_ie_compatible'] // http-equiv="X-UA-Compatible"
 *          $params['old_browser_support']  < IE9
 *          $params['assign_to']
 *
 */

 

Example:

<!DOCTYPE html>
<html lang="en">
    <head>
        {{header}}{{/header}}
    </head>
    <body>
        <!-- .appc-page -->
        <div class="appc-page">
            {{blocks}}
        </div><!-- /.appc-page -->

        {{footer}}{{/footer}}
    </body>
</html>

 

Binders: woocommerce_recently_viewed_products

If your websites features products, a great way to improve the user experience is to provide visitors with a quick way to go back to products that they have recently viewed. As your visitors navigate your e-commerce website, they will probably see many of the products that are featured in the website. If you track the product page, you should be able to display a list of the recently viewed products. The {{woocommerce_recently_viewed_products}} binder allows you to track products and display a list of recently viewed products that will help visitors jump back to a product int the list.

 

/**
 * This binder displays recently viewed products using WooCommerce default cookie.
 *
 * @param {array} $params 
 *            $params['size'] Maximum number of products to be displayed (default: 5)
 *            $params['count'] --Alias for $params['size']
 *            $params['action'] Intended action. Valid values are "track" which will track the product pages or 
 *						"show" which will render a list of recently viewed products.
 *            $params['show_last_first'] Whether or not to show the most recently viewed item at the beginning of the array returned. 
 *            $params['error_message'] HTML string with a message to be display if no items have been viewed yet. 
 *            $params['assign_to'] Variable within the template engine to which the content has to be assigned. 
*/

 

Track

{{woocommerce_recently_viewed_products action="track"}}

 

Display

<section class="container-fluid text-center hot-text hidden-print">
    {{woocommerce_recently_viewed_products size="5" assign_to="recently_viewed"}} 
    {{if count($recently_viewed) > 0}}
    <div class="text-center">
        <p>Recently viewed products</p>
    </div>
    
    <div class="text-center">
        
        {{foreach $recently_viewed as $recent}}
            <a title="{{$recent.post_title}}" class="recent" href="{{$recent.post_permalink}}">  
                <img class="img-responsive" src="{{$recent.post_thumbnail}}" /> 
            </a>
        {{/foreach}}
    </div>
    {{/if}}
</section> 

 

Access Your Appcropolis Builder Project From Your Domain URL

After you create a project using the Appcropolis Builder, you can add a domain. Basically, you can create a policy to allow Appcropolis’ server to serve your files when requests are made from your domain.

Lets’ say that your domain name is “mycompany.com”. You can create a project inside the Appcropolis Builder, and name it anything you want, for example, “mycompany”. Your project public URL will be [PROJECT_NAME]-[YOUR_USER_NAME].simplifysites.com. For this example, your public URL might read something like this “mycompany-raul.simplifysites.com”. If you wish to server your website from “mycompany.com”, all what you have to do is:

  1. Open your project in the builder
  2. From the “Projects” menu, select the option “Domain”
  3. Enter the domain you wish to link to your project (e.g. mycompany.com)
  4. Save.
  5. Go to your domain DNS admin page (e.g. GoDaddy – >Manage DNS)
  6. Set your domain’s A record to point to 159.203.148.146.
  7. Depending on your TTL (time to live), you may have to wait between 15 minutes and 6 hours before this change take effect.
  8. From the Browser, access your domain.
  9. Done! if the changes took effect you should be able to access your Appcropolis Builder Project from you domain URL.

 

How To Detect Bootstrap Responsive Breakpoints In Javascript

 

<section id="content-1-3" class="content-block content-1-3">
	<div class="container">
		<div class="row">
		    <div class="appc-helper device-xs visible-xs" data-device="xs">XS</div>
            <div class="appc-helper device-sm visible-sm" data-device="sm">SM</div>
            <div class="appc-helper device-md visible-md" data-device="md">MD</div>
            <div class="appc-helper device-lg visible-lg" data-device="lg">LG</div>
            <h1>Device Mode (js):</h1>
            <div class="mode"></div>
		</div><!-- /.row -->
	</div><!-- /.container -->
</section>

 

.appc-helper {
    float: left;
    position: fixed;
    top: -10000px;
}

 

// @see: http://stackoverflow.com/questions/18575582/how-to-detect-responsive-breakpoints-of-twitter-bootstrap-3-using-javascript

// Detects which UI element is visible
function getBreakPoint() {
   var device = $('[class*="device-"]').filter(':visible').attr('data-device');
    return device;
}

// check for changes
var waitForFinalEvent = function() {
    // Create a private scope to set, clear, and check for timeout.
    // This will prevent too many timeout intervals from being set.
    var b = {};
    return function(func, intervalTime, timeStamp) {
        // create a key name using timeStamp, if provided
        timeStamp || (timeStamp = "unknown");
        // if key is set in private scope, clear interval
        b[timeStamp] && clearTimeout(b[timeStamp]);
        // set timeout for the timeStamp key
        b[timeStamp] = setTimeout(func, intervalTime)
    }
}();

// initial, unique interval name.
var fullDateString = new Date();

// how often to check for changes in the layout
var checkEvery = 250;

$(window).resize(function () {
    waitForFinalEvent(function(){
        var mode = getBreakPoint();
        setMode(mode);
    }, checkEvery, fullDateString.getTime())
});

// not in use but handy
function isBreakpoint( alias ) {
    return $('.device-' + alias).is(':visible');
}

// set changes in the UI
function setMode(mode) {
    var $mode = $('.mode');
        $mode.html(mode);
}

var mode = getBreakPoint();
setMode(mode);

 

Binders: Tags

Returns the tags assigned to a post_id. If no ID is provided, this will return all the tags that are not empty.

 

<!--ALL TAGS (NOT EMPTY)-->
{{tags assign_to="tags"}}
<aside class="widget widget_tag_cloud">
    <h3 class="sidebar-title">Tags</h3>
    <div class="tagcloud">
    {{foreach $tags.data as $tag}}
    	<a href="{{$tag.permalink}}" class="tag-{{$tag.slug}}" title="{{$tag.name}}">{{$tag.name}}</a>
    {{/foreach}}
    </div>
</aside>

 

 <!--TAGS FOR AN SINGLE POST-->
 {{tags assign_to="tags" post_id="234"}}
<aside class="widget widget_tag_cloud">
    <h3 class="sidebar-title">Tags</h3>
    <div class="tagcloud">
    {{foreach $tags.data as $tag}}
    	<a href="{{$tag.permalink}}" class="tag-{{$tag.slug}}" title="{{$tag.name}}">{{$tag.name}}</a>
    {{/foreach}}
    </div>
</aside>

 

Pointing Your Domain Name To SimplifySites.com

Once you are done building your website using the Appcropolis Builder, you will have to do these two things to link your domain to the newly created website:

  1. From your domain name provider admin console (e.g. GoDaddy), go to the DNS setting section and change the A Record to make it point to 159.203.148.146. All other settings should remain the same. This means that your email settings will not be changed, but all website requests will be re-routed to simplifysites.com.
    NOTE: It might take 15 minutes to 24 hours for this change to be completed.

  2. Inside the builder, open your project and go to Project > Domain and add your domain name, click the verify button, accept the change if the domain link is available, and voila!

 

link-domain-to-project