0
votes

I'm following this official tutorial

http://www.concrete5.org/documentation/how-tos/developers/understanding-and-building-blocks-in-concrete5/

to add a new block to my fresh installation of concrete5. When I downloaded the zip and unzipped it in concrete/blocks, it says nothing is waiting to be installed under Block Types. When I place it in application/blocks, it gives an error "Class 'BlockController' not found". I already tried clearing the cache. I am using concrete 5.7.2

What am I doing wrong? Thanks

1
The tutorial you link to is meant for <5.7, you'll need to wait for developer docs to have a clear outline. Likely, you'll need to namespace your block's controller, and extend \Concrete\Core\Block\BlockController. - Korvin Szanto
@KorvinSzanto , maybe the old docs should make note of the fact that they only apply to 5.6? I could see this causing a lot of problems for people new to C5 (which is when people are most likely to just walk away when confronted by problems because they haven't invested a lot into the system yet). - Jordan Lev

1 Answers

1
votes

I did the below and it seems to be working. Not really certain about the Namespace

<?php
namespace Application\Block\BasicTest;

use Concrete\Core\Block\BlockController;

class Controller extends BlockController {
	
	protected $btTable = "btBasicTest";
	protected $btInterfaceWidth = "350";
	protected $btInterfaceHeight = "300";

	public function getBlockTypeName() {
		return t('Basic Test JR');
	}

	public function getBlockTypeDescription() {
		return t('A simple testing block for developers');
	}
}
?>