1

How to specify bundle for the blocks you build programmatically since you need block bundles to entity reference the block?

5
  • What are you trying to achieve?
    – Eyal
    Commented Jun 15, 2016 at 21:27
  • I want to reference the block in a paragraph type...reference is done based on block types...
    – Zuhair
    Commented Jun 17, 2016 at 19:44
  • Can you try to be a bit more specific. It is very hard to give a good answer when the question is as vague as it is right now. For example: what do you mean be reference? Do you want to create a link to the block? do you want to display the block? do you want to get metadata information about the block? How did you define the block_type (code snippet)?
    – Eyal
    Commented Jun 19, 2016 at 18:52
  • P.S. you don't need the block_type for an entity_reference field to the block entity. It is a configuration entity and you only need the id of the block instance.
    – Eyal
    Commented Jun 19, 2016 at 18:53
  • I have added a picture in question where it asks for bundles to reference a block. I have a custom form in a block, therefore i wrote it programmatically. I want to display that block in a node using paragraphs module . I couldn't find anywhere how to specify the bundle for the block? This is my annotation for the custom block. /** * Provides Custom Block. * * @Block( * id = "connected_block", * admin_label = @Translation("Connected Block with Form"), * category = @Translation("Blocks") * ) */
    – Zuhair
    Commented Jun 22, 2016 at 6:00

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.