Main Menu
Contact
Popular Plugins
Sign In

In order to run these CLI commands, open a terminal console and make the concrete5 webroot folder the current directory (eg. the one that contains the index.php file); making that folder the current directory is not mandatory, but it's useful for people that read this document only partially.

Read more about CLI commands here: https://documentation.concrete5.org/developers/appendix/cli-commands

Now, let’s start with a very simple command:

concrete/bin/concrete5 c5:block-developer -b hello_block_developer

This will call the “block-developer” command and pass a Block Type Handle (-b) of “hello_block_developer”. If your environment allows interactive mode, you’ll be asked the following question:

Do you want to place this Block Type within an already installed Package [y/N]

You can answer that with yes if you’d want, but for this example we will choose no (just type “n”) and hit enter. After hitting enter, you will get another question:

Enter your desired Block Name [Hello Block Developer]

So you can see, the handle you passed will be translated to a name at the end between []. In case you do not like that name, enter a name you’d like for this Block Type. If you’re OK with it, just don’t enter anything and press enter. Upon doing so, you will get a bunch of messages saying what is being done for you. It would look something like this:

Writing files to new Block Type directory... done.
Setting correct namespace for the Block Type controller.php file... done.
Setting name for the Block Type... done.
Building database file (db.xml)... done.
Refreshing the Block Type... done.
Building view template for the Block Type in progress... done.
Building additional template(s) for the Block Type in progress... done.
Checking if needs to be installed... done.
Installing the Block Type... done.
Please edit the /var/www/blockdeveloper/application/blocks/hello_block_developer/config.php file to include fields and perhaps change other values to your likings. Run this same command again after changing this file, to apply the changes you made.
task(s) completed.

As you can see, the terminal lets you know all tasks are completed. A Block Type has been created and installed, so you can already add it somewhere on a page if you'd like to. Congratulations! Easy, right?

Use, by you or one client, in a single end product. The total price includes the item price and a buyer fee.

  • Quality checked by Concrete5
  • Future updates
  • 30 Day Support
  • Concrete5 buyer fee: $32.70
Add to Concrete5 Cart

Use, by you or a client, in 5 single end products. The total price includes the item price and a buyer fee.

  • Quality checked by Concrete5
  • Future updates
  • 30 Day Support
  • Concrete5 buyer fee: $130.80
  • Save an extra: $109.00
Add to Concrete5 Cart

Use, by you or a client, in x/xx single end products.

Upon request, quote will be made and sent to you via email.

  • Quality checked by Concrete5
  • Future updates
  • 30 Day Support
  • Saves extra $$
Request Quote
Released 4 years ago
Updated 3 years ago
Requires concrete5 5.7.5.3
Current version 0.9.7
Skill level Bleeding Edge

Buyer Rating:

5 average based on 2 ratings More information

Got something to say? Need help?

View support forum