Timeline for How do I programmatically place a block?
Current License: CC BY-SA 3.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Feb 13, 2017 at 12:45 | comment | added | googletorp | @kratos The answer Felix has provided isn't actually solving the question of how to place a block "programmatically", but instead uses config files. Config can only be imported via through drush, config synchronization interface or module installation. If it needs to happen, during runtime, fx post save of a section frontpage node type etc, it would be useless to use this strategy :) | |
Aug 16, 2016 at 3:39 | comment | added | kratos | Felix Eve has the best answer. It is not crazy complex. | |
Apr 6, 2016 at 8:43 | comment | added | googletorp | @Berdir Thanks for the link to the test trait, added it. Since Drupal 8 is still so young, a lot of people don't know a lot about the plugin system and the documentation could use more use cases etc, which can give a lot of devs a hard time working with it. | |
Apr 6, 2016 at 8:39 | history | edited | googletorp | CC BY-SA 3.0 |
added 46 characters in body
|
Apr 5, 2016 at 18:30 | comment | added | Berdir | Apart maybe from visibility conditions, I don't think it's that complicated. \Drupal\simpletest\BlockCreationTrait::placeBlock() is probably a better example to look at, you can also just import some exported configuration files. | |
Apr 5, 2016 at 14:33 | history | answered | googletorp | CC BY-SA 3.0 |