Questions tagged [paragraphs]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
17 views

When the view has no result, there is an error

I created a view to display a block on my store page, but the page displays an error when the view has no result. If the view has a result, it works. What's the problem? When I go to my store ...
1
vote
1answer
548 views

Hide fields in Paragraphs conditionally using Form API #states

Because the Conditional Fields module doesn't work with paragraphs for Drupal 8, I've followed the instructions in Conditional Fields in Paragraphs Using the Javascript States API for Drupal 8 to hide ...
0
votes
1answer
35 views

is there any possible conflict for fields with the same machine name?

i am trying to debug a paragraph not displaying fields and i am having /admin/reports/fields a same machine name for a field in 3 different paragraphs field_call_to_action_ref paragraph ...
-1
votes
1answer
556 views

Add paragraph element programmatically

When change format field through ajax I want to add paragraph element programmatically and display it on current form, just do the same like if I would click the add question answer, any ideas ?
0
votes
0answers
13 views

Group paragraph fields in Views

I've added the paragraphs field as a relationship and managed to add my fields to the view but I can't seem to group them together. As a result the node entity is being spit out twice. Is it possible ...
1
vote
1answer
620 views

How to pass variable of paragraphs type to another preprocess function

I want to override the fontawesomeicons.html.twig (Fontawesome Module). But I only want to do this for "my-very-special-paragraphs-type" and not in general. I think it is a good idea to declare a ...
-1
votes
0answers
14 views

Get counter or loop index value in paragraph.html.twig

I have a paragraph types called key benefits(key_benefits) and I want {% if paragraph.index==3 %}</div><div class="row">{% endif %} in my paragraph--key-benefits.html.twig but does not ...
0
votes
1answer
30 views

Control Visibility of Paragraph Without Fields

I'm preprocessing a paragraph to add a custom form but I'm having trouble with the visibility. I don't need any fields on this paragraph. If I just add the form to the paragraph the whole paragraph ...
0
votes
0answers
36 views

How can I limit access to the text format drop down in a paragraph? [duplicate]

I'm trying to limit the access for users to change the value of text format dropdown but I can't seem to find the correct dropdown to alter. Here's what I have so far but it seems to disable access to ...
0
votes
1answer
603 views

Migration of CSV into paragraphs fails with unexpected error

I try to import CSV files into a Drupal 8 installation but I can't manage to make the relationship to paragraphs appear. I followed the steps of this tutorial but can't figure out how to make it work. ...
0
votes
0answers
29 views

Paragraph type default value for old content

I created a new paragraph type called Ad and I want to set a default value for already existing articles. At the moment, I am obliged to go to edit each already existing article and to save it ...
-2
votes
0answers
62 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 ...
4
votes
2answers
785 views

Cannot import Paragraph based Feature into new site

Perhaps someone with a bit more Features expertise can help me here. I have a Drupal site with 25 or so Paragraph types that I would like to export (one by one) to its own contained Feature. I ...
1
vote
2answers
472 views

Controlling a dependent field in a multi-instance paragraph

The fields below are part of the node/add node/edit forms of my custom node type. The paragraph field_para_city contain one field_city. (I later need to add other fields in the paragraph). The user ...
0
votes
0answers
21 views

How do you create paragraphs along with node creation in JSON API?

I have 2 types of paragraphs named as involved people and witnesses attached to my content type incident reporting. I want to create a node for incident reporting along with the creation of paragraphs ...
-1
votes
1answer
25 views

Get all the paragraphs of the current node programmatically in form_views_exposed_form_alter

I have a content type with multiple field paragraph. I would like to get all the paragraphs from the current node in form_views_exposed_form_alter. I tried $node = menu_get_object(); $storage = ...
0
votes
1answer
33 views

How to set a new value in a paragraph field on submit?

In an edit form for a content with paragraphs, I set errors on the paragraph specific field with this particular syntax: $form_state->setErrorByName('field_paragraphs][' . $key . '][subform][...
0
votes
0answers
18 views

How do I create a View to use Bootstrap Paragraph fields and group by the title?

I have a View for FAQ's, and an exposed combined fields filter. I created an FAQ content type, and added a paragraph field that contains "Question" and "Answer" fields. I cant use Search API, and want ...
0
votes
2answers
437 views

Migrate Paragraphs from CSV

I am migrating Paragraphs from CSV file. I have Paragraph called Text with two fields -> title and body. The problem is that I would like to also migrate translations for them, which currently don't ...
2
votes
1answer
487 views

How to convert an image field to an entity reference field

We have Drupal Paragraphs using image fields that are media entities. When the media entity is updated with a new image the old images still show unless we manually edit each page, remove the image ...
0
votes
2answers
418 views

How can I programmatically populate a drop-down list field's options?

I have a paragraph bundle with several fields, on of them being drop-down list. How would I go about populating this dropdown list via code, programmaticaly? I don't really know where to begin with ...
0
votes
1answer
1k views

How to access weight of a paragraph in twig?

I use paragraphs with my content type. I need to show weight (order) value of each paragraph in my twig template. I can change weight with select box when I edit the node, but I can't figure out how ...
0
votes
0answers
21 views

Use dropdown in views exposed filter on paragraph text field in paragraph view?

I have it working for nodes but i tried for paragraph view and it is not working Here is the code: function hook_form_views_exposed_form_alter(&$form, FormStateInterface $form_state, $form_id) { ...
2
votes
0answers
37 views

Use dropdown in views exposed filter on paragraph text field in node view?

I have seen Use dropdown in views exposed filter on text fields with node->title? but I need to use there a field from a paragraph field of the node. Let's say the paragraph field in the node is ...
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 ...
1
vote
1answer
781 views

Convert Field Collections into Paragraphs during Migration

I have a content type that uses Field Collections in Drupal 7. I am migrating to Drupal 8. Is there a way to convert the Field Collection Entity into Paragraph during migration?
0
votes
2answers
775 views

How to render inside a paragraph template a specific view mode for that paragragh

You may say that I should just change the display settings but in my use case I need to include 2 view modes inside one template as the mobile and desktop version of the output require very different ...
0
votes
0answers
41 views

How to filter a view from within a paragraph ideally using url?

I have a basic page that contains a paragraph which has the following field: Label = News View Field Type = Views Reference (reference method = default) This references a view that has a contextual ...
4
votes
2answers
731 views

Get paragraph delta/weight in template

I have defined a paragraph type that has a text field and an image field. At the moment the twig template is something like this <div class='paragraph_wrapper'> <div class='text-container'&...
0
votes
1answer
820 views

Creating paragraph entities and adding to a node

I am using the Paragraph module in and I need to programmatically create paragraph entities and attach them to nodes. Using the following code in a for-loop: $paragraph = new ParagraphsItemEntity(...
0
votes
1answer
80 views

Why is the programmatically removed paragraph item still showing after adding a new paragraph to the node?

I have a paragraph field in a node with unlimited add paragraph. I am removing these paragraph programatically. Its removing but when I am adding a new paragraph its adding blank paragraph along with. ...
0
votes
1answer
674 views

Unable to fetch paragraph's multi field values inside node twig

I have a content type as "worker". I have a Paragraph "test" and I am referencing "test" paragraph inside my content type "worker". This allows multiple values to be saved. How can I get the multiple ...
1
vote
2answers
730 views

Render sub-paragraph in parent template

I have a paragraph that has a field of type paragraph reference to sub-paragraphs. Within my template, I need to access these sub-paragraphs and render the entity element. I have a loop that loops ...
0
votes
1answer
25 views

Library item field doesn't show up the remove button

I am using paragraphs and paragraphs library module in my drupal project. The paragraph (Paragraph A) has a text field (unlimited). I don't see a remove button on the field. I only need one item for ...
1
vote
2answers
46 views

How to show a block between the body and a paragraphs field?

For a larger article content type on a Drupal 8 page, I want to have the following structure: Title Image/Video Body (the normal node body with the title and some text) A contanct block Paragraphs ...
0
votes
1answer
863 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 ...
0
votes
0answers
33 views

Migrate into paragraphs without parent import

If I have a data source with some values, can I process those into a paragraph attached to a node in Drupal 8 without having to run a prior migration to create the paragraphs first (and then relying ...
0
votes
1answer
76 views

Render paragraph reference field in page.html.twig

In page.html.twig I want to show a paragraph reference field which contains a left and right text_field. The name of the reference field in the node is: field_intro. That field is linked to a ...
3
votes
1answer
67 views

How do you access other submitted values from ConstraintValidator?

May well be missing the obvious here. So in Drupal 8 I have a content type. That has a date range field and then using paragraphs, a paragraph with several fields including a date field. So I need to ...
0
votes
1answer
36 views

How to add class to field--item element generated by paragraphs

I have a paragraph type called "Grid Item". I've created a file called "paragraph--grid-item--default.html.twig" where I print all my required fields. It all works as expected, but I need to add ...
1
vote
1answer
63 views

Error while set a paragraph field to NULL during cron run

I am using Drupal 8 and I have implemented a hook_cron to set a node field to NULL. Here is my code: if ($lesson->field_lesson_ended_at->value < $current_time && $session_id &&...
0
votes
1answer
64 views

Using the built in summary feature when using ONLY paragraphs module for text

I want to have more flexibility in creating content as usual. Therefore, I use the Paragraphs module, and I also disabled the standard body text. So now, a user can now freely decide how he wants to ...
0
votes
1answer
493 views

How to identify a paragraph? [closed]

Is there a way to identify a paragraph in Drupal 8. Like is there a function to get the type as paragraph in code level? I need to get it from a form alter function. My requirement is to get all the ...
0
votes
0answers
484 views

Migrate node with paragraph

I'm trying to figure out how migrating content from a Drupal 7 site to a Drupal 8 site works. I managed to understand how to create a custom module to migrate nodes with regular fields to my new D8 ...
0
votes
1answer
22 views

How can you identify all nodes that use a certain paragraph type or template?

In Drupal 7, given a custom paragraph bundle and an associated template file, is there a way to list all the nodes using that bundle? Or, if it's any easier, a way to do the same for a specific module ...
0
votes
1answer
26 views

How do you reorder an entity reference revisions field during hook_node_presave?

I am trying to reorder some paragraphs based on a text field within them on node save so the author does not need to maintain the alphabetical order manually, but when I save the node all values are ...
1
vote
1answer
947 views

How to print paragraph field values in paragraph template?

I'm trying to output paragraph field values in a sample paragraph template, but it does not work. I created a twig template in paragraph/paragraph--article--default.html.twig I have a field called ...
3
votes
1answer
460 views

How do I prefill a paragraph field in a node form?

I have a content type with a paragraph entity reference field and every time a user is going to add a node of this type I want to have the paragraph field already open and prefilled. I've tried with ...
1
vote
1answer
80 views

How to add library to Paragraph bundle using hook_preprocess_theme?

I wanted to add a library to a specific paragraph bundle. I know I can do {{ attach_library('my_theme/my-library-name') }} using twig, but that means I have to create a file for each bundle. The goal ...
0
votes
1answer
32 views

Conditional fields on content type with paragraphs [closed]

I saw this question repeat in a few places without an adequate answer. I have a D8 site that has a certain contain type ('deals') which contains an array of 'deal' paragraphs. Each 'deal' contains a ...

1
2 3 4 5
7