Custom block installation problem
Permalink
I created a custom block that shows up on the add functionality page. When I click 'Install', however, it tells me that the block has been installed but it leaves it in the install column and it no where to be found. I can 'install' it over and over and it still just stays in the install column.
I found that when I add a db.xml and declare an arbitrary table it lets me install the block. I don't even have a table name definition in the controller.
I'm trying to learn how to develop C5 blocks. Any help is appreciated.
I found that when I add a db.xml and declare an arbitrary table it lets me install the block. I don't even have a table name definition in the controller.
I'm trying to learn how to develop C5 blocks. Any help is appreciated.
The best thing to do is to go into your concrete folder from your webroot. That contains all the code that runs concrete5. Inside that is a blocks folder, that contains all the stock blocks for concrete5. If you look at the source code for those, it should give you a good idea of what your block is missing.
All blocks must have a db.xml file which defines at least one table, and that table must have both a "bID" integer field AND at least one other field, of any kind (if I build a block that doesn't actually need other fields, I call this other field "dummy" just so I know looking at it that it's useless and only exists to satisfy C5's bizarre requirement).
If you're learning to build blocks, you might find the "Designer Content" addon quite useful as it encompasses a lot of "best practices" I've discovered in my own C5 learnings -- just build some blocks with it and then look at its code:
http://www.concrete5.org/marketplace/addons/designer-content...
Hope that helps!
-Jordan
If you're learning to build blocks, you might find the "Designer Content" addon quite useful as it encompasses a lot of "best practices" I've discovered in my own C5 learnings -- just build some blocks with it and then look at its code:
http://www.concrete5.org/marketplace/addons/designer-content...
Hope that helps!
-Jordan
Hi all
Just discovered something useful with 5.5
If you can't find your block in Add Functionality in 5.5+ then you need to read this...
http://www.concrete5.org/community/forums/customizing_c5/custom-blo...
Just discovered something useful with 5.5
If you can't find your block in Add Functionality in 5.5+ then you need to read this...
http://www.concrete5.org/community/forums/customizing_c5/custom-blo...