Naming a custom block?

Permalink
In the example I found about how to create a custom block, the naming used is like btBasicTest. I wanted to know if the bt part was required. for example, say I was making a block called MagicDust. Would I need to use btMagicDust or mdMagicDust, or can I use just magicdust?

Thanks.

 
Mainio replied on at Permalink Reply
Mainio
For the block name you can use "magicdust". But your block name should be consistent with the controller's class name so if your controller's class name contains "MagicDust" you need to add an underscore to your block handle (directory name) so it would become "magic_dust".

What btBasicTest is referring to is for the block type database table. So the prefix there stands for
bt = Block Type

Therefore, naming your block types' database tables you'd probably want to go naming them with the bt-prefix.

Hope this helps!

Antti / Mainio
nakins replied on at Permalink Reply
Thanks for the info. I thought bt had some meaning, but block type didn't come to mind.
jordanlev replied on at Permalink Reply
jordanlev
To expand on what @Mainio said -- the "bt" is not required, but it is a standard Concrete5 convention. I highly recommend sticking with that, especially if this block is going to be shared with other people (if you will have other developers come and work on your sites in the future or if you plan to put this up on the marketplace), because that's what developers who need to debug or maintain things would expect.
And you might want to check out the free Designer Content addon, which creates blocks for you -- even if you want to create your own blocks (which I think is a great thing to learn), it contains many "best practices" I've discovered over the past year or two of C5 development, and in my opinion creates much cleaner and easy-to-understand code than the various tutorials out there (many of which are several years old).

http://concrete5.org/marketplace/addons/designer-content...
nakins replied on at Permalink Reply
Thanks, I'll go check out Designer Content.
mkly replied on at Permalink Reply
mkly
MagicDust - Please tell me that's the real name for the addon you're developing. Please.
jordanlev replied on at Permalink Reply
jordanlev
Yeah, that would almost be as cool as "Background Image Haterz"
mkly replied on at Permalink Reply
mkly
Haterz Everywhere. lol
nakins replied on at Permalink Reply
Sorry to disappoint, but I was just looking for a two word phrase to use as an example. But, I reserve the right to call any contribution to the market place Magic Dust. Maybe I do a series like Magic Dust, Magic Rust, Magic Bus/t. Was Magic Dust some kind of inside joke?