Skip to main content
edited tags
Link
avpaderno
  • 97.9k
  • 15
  • 164
  • 284
added 11 characters in body; edited tags
Source Link
Pierre.Vriens
  • 36k
  • 40
  • 50
  • 182

I foundThe Paragraphs module and very excited. But this module seems great, but it does not provide any API (i lookI looked at the source), so i. So I think that will be enough to use Drupal API and/or Entity API.

Short intro. Module provideAbout this module: it provides a new entity type 'Paragraph' and field with same name. User can create via UI 'Paragraph types' (bundles) with fields and view display settings like node entity.

So myMy question is. Whats: What's the right way to define bundle type for this entity type with custom fields in a custom module?

I think iI must create fields first, using field_create_field() and field_create_instance() in hook_enable() but whats. But what's next? 

I must create bundle for paragraphs entity and attach created field, but iI don't know how and googleany searches always sendssend me onto documentation about how programmatically create entity itself.

I found Paragraphs module and very excited. But this module not provide any API (i look at source), so i think that will be enough to use Drupal API and/or Entity API.

Short intro. Module provide new entity type 'Paragraph' and field with same name. User can create via UI 'Paragraph types' (bundles) with fields and view display settings like node entity.

So my question is. Whats the right way to define bundle type for this entity type with custom fields in custom module?

I think i must create fields first, using field_create_field() and field_create_instance() in hook_enable() but whats next? I must create bundle for paragraphs entity and attach created field, but i don't know how and google always sends me on documentation how programmatically create entity itself.

The Paragraphs module seems great, but it does not provide any API (I looked at the source). So I think that will be enough to use Drupal API and/or Entity API.

About this module: it provides a new entity type 'Paragraph' and field with same name. User can create via UI 'Paragraph types' (bundles) with fields and view display settings like node entity.

My question: What's the right way to define bundle type for this entity type with custom fields in a custom module?

I think I must create fields first, using field_create_field() and field_create_instance() in hook_enable(). But what's next? 

I must create bundle for paragraphs entity and attach created field, but I don't know how and any searches always send me to documentation about how programmatically create entity itself.

I think it's more complex than paragraphs module.
Link
Niklan
  • 476
  • 4
  • 16

Create ParagraphEntity bundles in custom moduleprogrammatically

Source Link
Niklan
  • 476
  • 4
  • 16
Loading