Newly Installed Block not Showing in the Add Block Dialog
Permalink
After installing a new Block that I'm working on, I am unable to add it to an Area.
I'm attempting to create a new Block type. I've gotten to the point where I've created a Package and installed the Package. The Package shows on the 'Add Functionality' page of the Dashboard.
When I go to a page and add a Block to an Area, the new Block does not show in the 'Add Block' dialog box.
I've tried refreshing the database, but it didn't help. What database tables should have a reference to the new Block once it is installed. Perhaps I didn't have all my code correct before installation?
Any ideas are appreciated.
I'm attempting to create a new Block type. I've gotten to the point where I've created a Package and installed the Package. The Package shows on the 'Add Functionality' page of the Dashboard.
When I go to a page and add a Block to an Area, the new Block does not show in the 'Add Block' dialog box.
I've tried refreshing the database, but it didn't help. What database tables should have a reference to the new Block once it is installed. Perhaps I didn't have all my code correct before installation?
Any ideas are appreciated.
There are no Block Types on the Edit Page of the Package. Only the title and description of the Package.
Is this what you've requested I provide?
Is this what you've requested I provide?
class ListByTagPackage extends Package { protected $pkgHandle = 'list_by_tag'; protected $appVersionRequired = '5.2.0'; protected $pkgVersion = '1.0.1'; public function getPackageDescription() { return t("List pages based on their tags."); } public function getPackageName() { return t("List by Tag"); } public function install() { $pkg = parent::install(); // install block BlockType::installBlockTypeFromPackage('list_by_tag', $pkg); }
Viewing 15 lines of 16 lines. View entire code block.
Hi,
Try this
block_handle ==> is your block handle for instance if you have a block as list_tag then the block handle is list_tag.
Hope you understand
Try this
$pkg = Package::getByHandle('list_by_tag'); BlockType::installBlockTypeFromPackage('block_handle', $pkg)
block_handle ==> is your block handle for instance if you have a block as list_tag then the block handle is list_tag.
Hope you understand
Well, your controller looks correct...
Next place to check is your block controller.
Can you post up the first few lines of that please? The bit I really want to check is the class declaration which forms the block handle. Based on your code, it should read:
Is that what you have?
Jon
Next place to check is your block controller.
Can you post up the first few lines of that please? The bit I really want to check is the class declaration which forms the block handle. Based on your code, it should read:
class ListByTagBlockController extends BlockController {
Is that what you have?
Jon
This might be a caching issue, I would try to clear your cache and try it again. Everything looks correct with your controller which jbx said as well.
If you want to see if it's in the database you can find it in the table "BlockTypes". You will see the different block types and if they are associated to any packages. If it's in there then it's a matter of figuring out if your files are in the right spot and you are extending the proper base classes.
I would take a peek at /concrete/blocks/google_map for example. You must have a db.xml, controller.php, and I believe a view.php at the least. I might be wrong here but you can view the documentation for block creation at:http://www.concrete5.org/documentation/developers/blocks/directory-...
If you want to see if it's in the database you can find it in the table "BlockTypes". You will see the different block types and if they are associated to any packages. If it's in there then it's a matter of figuring out if your files are in the right spot and you are extending the proper base classes.
I would take a peek at /concrete/blocks/google_map for example. You must have a db.xml, controller.php, and I believe a view.php at the least. I might be wrong here but you can view the documentation for block creation at:http://www.concrete5.org/documentation/developers/blocks/directory-...
If you've done that, then try editing the package from this same page. It should show you you're associated block. If it doesn't, then the package is installed, but not the block inside it. Post up what you have in your package controller, so I can check you have everything correct there. In the install() method, you should have the following lines:
Jon