0

When creating a custom block, how can we add a message and have it configurable by the user? Is this possible?

1

This is a good example for a Drupal 8 custom block that is configurable by the user

| improve this answer | |
0

A trick could be creating a content type called blockMessage or whatever you want and then using Views you can build your desired output for block of this content type which only outputs the last entered one (including message body).

Then whenever a new content of type blockMessage is posted its body will shown in this block as a message.

| improve this answer | |
-2

Please check the example here. You'll need to create a hook_block_configure call.

https://api.drupal.org/api/examples/block_example!block_example.module/8

| improve this answer | |
  • The question seems to be about Drupal 8. You send a link to Drupal 7 documentation – batigolix Sep 17 '16 at 11:39
  • I've updated the link. – Japo Domingo Sep 28 '16 at 22:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy