Questions tagged [paragraphs]

Use it for questions relating to the Paragraphs module, not for text or body paragraphs.

Filter by
Sorted by
Tagged with
2
votes
1answer
648 views

Create any number of paragraph fields in a multiple value field on node create form

I have a paragraphs field that takes a term reference. I need to count how many terms there are for a specific vocabulary and then create that many instance of the paragraphs multiple value field for ...
1
vote
2answers
525 views

Pre fill multiple paragraphs while adding node

I want to prefill multiple paragraphs when user click on "add node" for specific content type. What would be a good way to do this ?
3
votes
1answer
3k views

Programmatically append multiple paragraphs to entity reference field on node

I have a paragraph type that contains a text field and a text format field. I also have a content type that takes an unlimited number of paragraphs of this type. The paragraph type is called '...
1
vote
1answer
237 views

Export Paragraph bundle with Drupal Console

I know there is a command to export a content type config:export:content:type But is there a way to do this for a Paragraph bundle? Something like this isn't working config:export:paragraph:type
1
vote
0answers
180 views

Relation through paragraph seems to be exclusive

I implemented the following scheme: Publication (node) - Mention (paragraphs) - Project (node) Project is referenced by Reference Entity from paragraphs type and Mention is a paragraphs field (...
1
vote
1answer
543 views

How to know when a field is a paragraph

I'd like to know when a field from a node it's a paragraph, I only get the type, that it's entity_reference_revisions, I use this method to get the information: \Drupal\field\Entity\...
0
votes
1answer
859 views

Theming custom block type have multiple paragraph field

I've created a custom block type includes a paragraph type field and make it multiple. I've configured this block to display it only on the front page. I have a page--front.html.twig template in my ...
17
votes
4answers
10k views

How do I alter the behavior of the form fields contained within the paragraph field?

Using the Paragraphs module in Drupal 8, I am attempting to alter the behavior of the form fields contained within the paragraph field. This is so I can add behavior like AJAX callbacks, hide show ...
12
votes
3answers
20k views

How to load paragraph entity on node object?

I'm using paragraphs in my content type. I've created a paragraph type and added content. Now I want to load the paragraphs in a foreach. But nothing's showing up. $paras is empty: $node = \Drupal\...
4
votes
1answer
2k views

How to show paragraph bundles of different types in a view of content containing paragraphs?

I am using the Paragraphs module and I want to show the paragraphs of one type at the beginning of the view and the paragraph of a different type at the end. How do I distinguish paragraphs of ...
2
votes
1answer
499 views

What is the difference between getValue() and referencedEntities() to fetch paragraphs?

What is the difference between using getValue() and referencedEntities() in order to get the paragraph on a node? See example below. Both examples are used in a node template such as node--page--full....
0
votes
3answers
4k views

How to set validation error for specific subfield of the paragraph type?

I've got paragraphs type with two fields which I've added as a field into my vocabulary. I've added validation function (#validate) into $form using hook_form_FORM_ID_alter where I'm validating ...
1
vote
2answers
330 views

How can I print subparagraphs?

I have a content type with a paragraph field. That paragraph field has two paragraph fields which I will refer to as subparagraphs. I want to print one of the two subparagraphs depending on the flag ...
1
vote
1answer
188 views

How to print the URL path of a referenced node using paragraphs?

I'm trying to print out the url path of a node from a referenced entity paragraph field in my twig template however have not had any success so far. I have tried various common twig functions but with ...
1
vote
2answers
1k views

How to get token of parent entity in paragraph?

I have a paragraph, which is referenced by a node. Now I am trying to pass field values of node to the paragraph using tokens. I'm only aware of [paragraph:parent_id] and [paragraph:parent_type] but ...
0
votes
1answer
690 views

How to retrieve value of hidden field in twig?

How to retrieve value of hidden field in twig? PFB screenshot: I am able to retrieve value of "Partition Count" field when not disabled. But not able to retrieve it's value when disabled. Exact ...
0
votes
2answers
343 views

D8: The same content type, but different url path aliases pattern based on paragraphs. Possible?

I have several paragraphs nested into one content type. Users can add only one type of paragraph. Is it possible to create a url alias pattern based on paragraphs? For instance, I have paragraphs "car"...
0
votes
1answer
349 views

content types vs. paragraphes types + taxonomy

I have quite a complex content structure and found the paragraphs module (in combination with taxonomies) can be very powerful for creating complex compound fields and dynamically reusing existing ...
0
votes
1answer
378 views

Adding content to Paragraph Date Field Drupal 8

I'm programmatically creating paragraphs using the following code, but I'm unable to get the date value to store correctly within the date field. It seems to store within the database, yet on the edit ...
-2
votes
0answers
58 views

Why, the references to the entities do not disappear?

I have a site with Drupal 8.8.4 I created a type of paragraph with an "Entity reference" field which refers to the products and a "Date range" field : I created a type of store with "Entity ...