Help with blocks
PermalinkI want a block with this as the view
<div class="box"> <h2> <a href="#" id="toggle-blockquote">Testimonials</a> </h2> <div class="block" id="blockquote"> <? $a = new Area('TestimonialsArea'); $a->display($c); ?> </div> </div>
So I want to build a basic block that simply holds some html and a editable html region. how would I create it, and how would I write the db file to have default content
What would I need to do to duplicate the HTML block, say I didn't want to use a template for some particular reason. What would need to be modified and how would I pre-populate it.
So all I want to do is copy block, icon, name, description and view.
and use same dd as html block.
this is all I did
class TestimonialsHtmlBlockController extends BlockController { var $pobj; protected $btTable = 'btContentLocal'; protected $btInterfaceWidth = "640"; protected $btInterfaceHeight = "200"; public $content = ""; public function getBlockTypeDescription() { return t("Add testimonials to your site."); } public function getBlockTypeName() { return t("Testimonials"); }
c5WebsiteRoot/blocks/html/templates/box_view.php
to get started, just copy the view from: c5WebsiteRoot/concrete/blocks/html/view.php
...and make any changes you need.
To actually select that template, after the html block has been added to the page, click on it, then click the "custom template" option, and select your template.