Help with blocks
Permalink
Can I get some help explaining the process to implement this block
I want a block with this as the view
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
I 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
Thanks, that makes sense.
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.
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.
yes, you could create a whole new block for this too. Just copy the HTML or Content block from the /concrete/blocks/ directory into the /blocks/ directory, rename the folder to /blocks/block_name/, rename the controller to BlockNameController. You can then either use the same table name as the original block (in that case delete the db.xml file), or you can change the table name in the controller.php and the db.xml file. That should do it (maybe).
I tried that but for some reason it would not show up as available to install. any ideas? ill try again.
Any idea it would say block type installed but the block remains on the "new" side and not the currently installed
this is all I did
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.