1

In Drupal 8

I understand that to create a block I create a file in this structure:

mymodule/src/Plugin/Block/MyModuleBlock.php

If I would like to create another block for this module, or even a dozen blocks in this module, where do I define them so that they render differently and contain different javascript/css?

1

Use the following folder structure to create multiple custom blocks in drupal 8

-mymodule
--src
---Plugin
----Block
-----block1.php
-----block2.php
-----block3.php

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.