Problem installing test block

Permalink
I want to build some custom blocks, and trying to play with the test block from the docs section. I'm doing this with 5.5; I was able to do this with earlier versions, but the instructions for installing it don't seem to work any more. I tried clearing the cache - no change. Any other suggestions?


Thanks!

landollweb
 
landollweb replied on at Permalink Reply
landollweb
Just for giggles, I tried taking one of the blocks out of the /concrete/blocks directory and uploaded it to the /blocks directory, and that one doesn't show up in the dashboard as ready to install, either.

Either the system checks to see if it's already installed first, or they have to go someplace else to be installed now?

Still searching docs, and so far ruled out all the usual suspects - incorrect class name, directory name, etc.
jasteele12 replied on at Permalink Reply
jasteele12
You're not installing a new block, you're overriding the existing one.

If you changed the view.php or controller.php you would see that reflected when you use that block.

You could copy the block to a new directory (copy concrete/block/someblock/ to block/somenewblock/), rename the block controller properly and then you would be able to install your *new* block.
landollweb replied on at Permalink Reply
landollweb
Has anyone successfully installed this test block to 5.5 according to this procedure?
http://www.concrete5.org/documentation/developers/blocks/understand...
jasteele12 replied on at Permalink Reply
jasteele12
Since that is from 2008, I'd shy away from it. You are much better off using a current 5.5 block.

You might also want to look into jordanlev's Designer Content in the marketplace - it's a great way to see how all the "widgets" work.

You do need to make your blocks/ directory writeable by the webserver to save your new blocks (not that way by default).
andrew replied on at Permalink Best Answer Reply
andrew
Are you trying to do this from "Add Functionality" ? That method no longer works. You have to go directly to "Stacks & Blocks > Block Types." It should be listed at the top of that page.
jasteele12 replied on at Permalink Reply
jasteele12
Hi Andrew,

I just copied concrete/blocks/html to blocks/html, modified the view.php and there is no html block listed to install under Block Types.

The modified view is being used of course.

I believe my answer above is still the correct one :)

John
landollweb replied on at Permalink Reply
landollweb
Found it - that works - thank you!
landollweb replied on at Permalink Reply
landollweb
That may be because you also need to rename the directory, and the ...BlockController class name in controller.php.
jasteele12 replied on at Permalink Reply
jasteele12
Hehe, I covered that above, my question is to Andrew, as I believe both my replies above are correct :)
landollweb replied on at Permalink Reply
landollweb
Ah - so you did. I had forgotten that you could override a core block that way, but that wasn't the reason my test block couldn't install.

My real problem was that I was using the wrong Dashboard function to install standalone blocks. Once I went there, there was my test block ready to install, and it installed just fine.

Also note: it was not necessary to change the permissions on the blocks folder for this to work.
jasteele12 replied on at Permalink Reply
jasteele12
Actually my first reply was to your "Just for giggles" where you stated you didn't see the install after copying a block from concrete/blocks to blocks.

Changing the block folder to writeable was only if you want to save blocks created with the Designer Content addon.

Glad you got it working :)
landollweb replied on at Permalink Reply
landollweb
Thanks for the clarification. I like the Designer Content add-on, and will be using it for some things, so that will be handy to know.