Cannot Install Blocks

Permalink
Placing blocks in the blocks folder does not make them appear in the Block Types, this gives me no way of installing a custom block as there isn't even an install button available?

I have tried clearing my cache and have been trying to fix this for about 5 hours now, just wondering if anybody here had come across the same problem?

Thanks in advance,

Daniel.

 
jero replied on at Permalink Best Answer Reply
jero
Is this a custom block you've built yourself?

If so, check that your block folder name relates to the class name in the block controller, e.g. if you block is in blocks/myblock, then your blocks/myblock/controller.php should have a class definition of

class MyblockBlockController extends BlockController {


If it doesn't, then it won't show in the list of blocks to install.
Verlix replied on at Permalink Reply
Thank you sooo much!

Didn't know the naming convention had an affect on it, although now I think about it, it does need to!

All working now, thanks alot, saved me alot of trouble now :)

Cheers,

Daniel.
jero replied on at Permalink Reply
jero
You're welcome :)
quantum503 replied on at Permalink Reply
quantum503
Hi
I'm having the same problem. I've put all the files in a new folder inside the blocks folder and checked the naming of the class in controller.php, but the block still doesn't show up as available.
Any more ideas? I'm pretty new to this.
Thanks
Eric
quantum503 replied on at Permalink Reply
quantum503
OK
I've managed to get the block to show up as a custom block type available for installation. When I click 'Install' the screen refreshes and the bar at the top says 'block installed'. But the block has not been installed, no database table has been created and the block is still showing as available for installation.
All help/comments appreciated.
Eric
jordanlev replied on at Permalink Reply
jordanlev
Does your block have a db.xml file? If so, does it have at least 2 fields defined in it (one bID and then anything else for the other one)?
quantum503 replied on at Permalink Reply
quantum503
Hi
Yes it does. In fact it has three and the code that I am using is from the book 'concrete5 beginners guide' which I'm using to become more familiar with how it all works.
Thanks
Eric
jordanlev replied on at Permalink Reply
jordanlev
Can you ZIP up your block and post it here?

Also, in addition to the book, you might find the free Designer Content addon useful for learning (http://concrete5.org/marketplace/addons/designer-content... ). It will create block types for you via a dashboard interface so you can look at the files and code it makes to see how things are done (I've spent a lot of time making the generated code files as simple and clean as possible, so it is a lot easier to understand than the blocks included in Concrete5 core -- at least in my opinion).
jordanlev replied on at Permalink Reply
jordanlev
Also, what version of Concrete5 are you running?
quantum503 replied on at Permalink Reply 1 Attachment
quantum503
Hi
Thanks for the info - I'll check it out.
I've attached a zip file containing the block files which were located in a folder called product_information in the blocks directory. I can't count; there are actually 4 fields in the db.xml file!
I've only just got started with this so I'm running version 5.5.1
Thanks for your help.
Eric
jero replied on at Permalink Reply
jero
You db.xml is slightly broken:

You've got
<schema version ="0.3">


You need to loose the space between version and =

i.e.

<schema version="0.3">


You ought to be setting btName and btDescription as protected variables too, and not overriding the methods.
quantum503 replied on at Permalink Reply
quantum503
Wow, thanks I never realised that the code was so sensitive to spaces. I'll be more careful in future. The commented out bits in controller.php were just my attempts at fault finding, but the rest of the code was straight out of the book.
Thanks again
Eric
russellfeeed replied on at Permalink Reply
russellfeeed
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...