Starter Templates
Permalink Browser Info Environment
Blocks by AJAX includes a standard starter template for those wishing to develop their own block templates. In most cases, creating a Blocks by AJAX template is as simple as inserting the original block view code where marked.
This starter template is included with the addon and is also attached here.
<?php defined('C5_EXECUTE') or die("Access Denied."); /* Blocks by AJAX starter template. Simply insering the guts of an existing template where it says ORIGINAL BLOCK CONTENT HERE will serve to create an ajax template for most bocks. */ $c = Page::getCurrentPage(); $blkah = Loader::Helper('blocks_by_ajax','jl_blocks_by_ajax'); if($blkah->regular_block($bID) ) { if($c->isEditMode()) { echo $blkah->edit_mode_marker(); } /* ORIGINAL BLOCK CONTENT HERE
Viewing 15 lines of 19 lines. View entire code block.
This starter template is included with the addon and is also attached here.
Type: | Discussion |
---|---|
Status: | Archived |
If Blocks by AJAX is not installed, in edit mode an error message is shown. In normal display it is deliberately left to give a code error about the missing object/method (seems like the best way to get the editing user's attention).
From v1.1 this code is also included with the Blocks by AJAX package and is also attached here.