Timeline for Create a custom block programmatically and specify region and pages on which created block must shown on
Current License: CC BY-SA 3.0
9 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 7, 2017 at 11:49 | vote | accept | Czaa | ||
Dec 7, 2017 at 11:49 | |||||
Nov 29, 2017 at 20:44 | comment | added | 4uk4 | You can use any machine name, as long as you use the allowed characters, which is alphanumeric + underscores. (For debugging it might be helpful if you place a block in UI, export the config and compare the result, what is different to the block you placed programmatically.) | |
Nov 29, 2017 at 18:02 | comment | added | Czaa | I was trying it but something went wrong. My block was created but it didn't attached to region. What I need to place at 'id' field instead of 'block_machine_name' ? I was trying to put there name of my block but seems it improperly. | |
Nov 29, 2017 at 13:04 | history | edited | 4uk4 | CC BY-SA 3.0 |
add visibility
|
Nov 29, 2017 at 13:02 | comment | added | 4uk4 | I add an example for a path visibility condition. | |
Nov 29, 2017 at 13:01 | comment | added | Czaa | You wrote "put this in the now empty visibility array" what do you mean by word "this"? You missed smth? | |
Nov 29, 2017 at 12:51 | comment | added | 4uk4 | Yes, put this in the now empty visibility array. Each visibility plugin has different parameters. Configure one in UI and look in the exported config. | |
Nov 29, 2017 at 12:40 | comment | added | Czaa | Oh! Many thanks!!! I'll try it for sure but what about pages on which block must shown on? Is it possible to set it in code above? | |
Nov 29, 2017 at 9:20 | history | answered | 4uk4 | CC BY-SA 3.0 |