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.
Thanks.
Thanks for the info. I thought bt had some meaning, but block type didn't come to mind.
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...
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...
Thanks, I'll go check out Designer Content.
MagicDust - Please tell me that's the real name for the addon you're developing. Please.
Yeah, that would almost be as cool as "Background Image Haterz"
Haterz Everywhere. lol
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?
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