Questions tagged [paragraphs]

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

Filter by
Sorted by
Tagged with
-1 votes
1 answer
27 views

Add paragraph value to referenced node [duplicate]

I have a paragraph with two field: Paragraph title [text field] Node [entity reference field] The node is displaying its title and an image. By default the Node title is a H2 heading. But I want it ...
user avatar
  • 892
0 votes
1 answer
33 views

How to add class to paragraph fields through preprocess hook?

I created a paragraph named flight-search-info-block with two fields: field_svg_icon and field_teaser_text. Then I created a custom block, where that paragraph was added as an entity reference field. ...
user avatar
  • 1
0 votes
0 answers
54 views

How to load the previous revision of a paragraph?

I can load paragraphes of a nodes field using $paragraphs = $node->get('my_field')->referencedEntities() In hook_node_update I could load the previous paragraphes using $paragraphs = $node->...
user avatar
  • 636
0 votes
0 answers
21 views

display paragraph field in a view

I am trying to display my paragraph bundle fields in a view. is that possible? I have a bundle that contains 2 fields with no input limit. I want to display one of the fields in a view. I added a ...
user avatar
0 votes
0 answers
47 views

I lose template suggestions when an ajax event is called

I'm generating theme suggestions based on the formdazzle module, I made my own variant because I needed another level of granularity of theme names and it works fine. Well, in the alter hook I have ...
user avatar
  • 341
0 votes
0 answers
65 views

How to render fields in nested paragraphs?

I'm trying to create a paragraph that will allow me to display several children's paragraph fields. I added the children-paragraph to the parent paragraph via Entity reference revisions. I created 3 ...
user avatar
  • 101
1 vote
1 answer
134 views

Can paragraph fields in a node be sorted?

I have a node content type with a paragraph field with multiple values. The paragraph has a date and a text field. When I display the node, I'd like to sort the paragraph values by date. I've tried ...
user avatar
  • 399
0 votes
1 answer
31 views

How to pass Block ID to a view?

I have a Custom Block type called HomeBlocks. This bundle has a paragraphs field which allows multiple paragraphs. I then place (using Layout Builder) an instance of this block type on my home page (a ...
user avatar
  • 907
0 votes
1 answer
61 views

How to custom access for entity paragraphs_type?

I have a problem with entity paragraphs_type, when I add a paragraphs_type in a node, with paragraph items inside, and I set it unpublish status, anonymous users can still see it. I try to custom ...
user avatar
1 vote
1 answer
56 views

Migrate CSV to content type with paragraphs

I'm trying to import a CSV File into Content Types and Paragraphs, using Migrate module (and mainly this tutorial : https://mtech-llc.com/blog/charlotte-leon/migration-csv-data-paragraphs). For this I ...
user avatar
0 votes
1 answer
42 views

Programmatically add value to multi-valued/repeater field at weight/index

In Drupal 8, I have a content type and more than a few nodes that have a Paragraph field with unlimited number of values, and so I need to programmatically add a paragraph at an index to the existing ...
user avatar
  • 13
-2 votes
1 answer
48 views

Display paragraphs field as a table? [closed]

Is there a way to display the output of a multiple value paragraphs field in a node as a table? The paragraphs has three fields in it, and I would like to display with labels in the header row, and ...
user avatar
  • 399
1 vote
0 answers
24 views

JSON:API FieldEnhancers - removing a resource object from a JSON:API response

I need to remove a resource object (in this case a paragraph) from a JSON:API response when it matches a specific condition. I do not want to delete it, I just want to exclude the object from the ...
user avatar
  • 11
0 votes
0 answers
44 views

State API doesn't work on new paragraph fields

I have programmatically added #states into fields in a paragraph works fine for existing fields in a form. But on clicking add more button on paragraph to add more fields the hidden fields show up. I ...
user avatar
  • 15
0 votes
1 answer
47 views

How to change the label of an image's title field in a paragraph

In a paragraph I have an image field for which the title field is enabled and required. I need to alter the label of this title field to replace "Title" by "Caption" I tried to use ...
user avatar
  • 692
0 votes
1 answer
44 views

Open a paragraph programmatically

I have a paragraph contact nested inside another paragraph occurrence. In the widget settings the paragraph contact is defined to be collapsed by default (edit_mode = closed). I want the contact ...
user avatar
  • 49
0 votes
0 answers
25 views

Nested entity reference revisions field breaks paragraph's add bundle drop down

TL;DR - Is there anyway to have nested Paragraphs entity reference revisions fields where the child Paragraphs entity reference revisions field has >1 bundle included and keep a functional node ...
user avatar
  • 43
0 votes
0 answers
14 views

Printing paragraphs of a specific type in node template

I use a template for a node type for the search api index. For this node type I have 4 paragraph types. For the search I only need 2 of these types to index. My idea now was to print only these ...
user avatar
  • 459
0 votes
0 answers
43 views

Migrate paragraph field

I have events on my Drupal 7 websites and after the upgrade, I want to migrate those events to the Drupal 9 website. Event CT has a paragraph reference revision field to the 'event_date' paragraph on ...
user avatar
0 votes
1 answer
83 views

Accessing a Paragraphs field's from inside the parent paragraph

I have a paragraph twig file that I'm adding to my subtheme. Inside of it I have another paragraph that is being used. And there could be more than 1 of the child paragraph. I have this code: {% for ...
user avatar
0 votes
0 answers
18 views

Error while deleting a comment related to a paragraph

I'm having a problem while deleting a comment linked to a paragraph. Has anyone encountered problems of this kind and would be able to help me with the solution? The error code is attached. Thank you ...
user avatar
1 vote
1 answer
35 views

Cannot change layout of translated paragraph nodes

I make use of Paragraphs to build content nodes along with Drupal's translations to translate a node to a different language. Although the node can be translated, I am unable to move / reshuffle ...
user avatar
  • 163
0 votes
1 answer
30 views

Applying trim to paragraph value

I have the following Paragraph template which displays a heading with a trailing orange dot. The field itself is a normal text field in Drupal. For some reason, there is a trailing space after the ...
user avatar
  • 163
0 votes
1 answer
116 views

Check if a field is empty inside a twig paragraph template

I know how to check if a field is empty in a twig template (example node--lorem.html.twig): {% if node.field_lorem.value is not empty %} <p>not empty</p> {% else %} <p>...
user avatar
0 votes
1 answer
32 views

How to list content that references another content type through paragraphs

I have two content types: "Author" and "Document." The Document content type uses a Paragraph "Author_citation" to connect the two and display all the authors (plus other ...
user avatar
0 votes
1 answer
74 views

How do I get the edited paragraph in hook_field_widget_WIDGET_TYPE_form_alter()

I use hook_field_widget_WIDGET_TYPE_form_alter() to alter the form for a single paragraph. What I do not understand is how I know which paragraph currently is edited when this hook is called. The ...
user avatar
0 votes
1 answer
334 views

How to programmatically append a Paragraph to another Paragraph?

I have a node (e.g. a business "company") with a paragraph referenced field (suppose business "sector", with multiple fields). This paragraph has in its fields a reference to ...
user avatar
  • 11
0 votes
0 answers
28 views

Workspace: paragraphs created in stage are unpublished on live

On Drupal 9.3.5. I appreciate workspaces is currently experimental. I am not sure if the behaviour I am seeing is intended or if there is a way to change it. Paragraph refers to the module: https://...
user avatar
  • 69
0 votes
0 answers
20 views

How do I update existing paragraphs?

I'm writing migrations to import source data as paragraphs. This is the main migration (which is working). id: resource_chapter_section_text label: Import content from the resource.body column in the ...
user avatar
3 votes
1 answer
238 views

Status page shows "Mismatched Entity.." for a Paragraph field but Drush entup give error "..storage cannot change the schema for an existing field"

I'm stuck in a loop. The Drupal 9.3 status page shows the following error: Mismatched entity and/or field definitions The following changes were detected in the entity type and field definitions. ...
user avatar
0 votes
0 answers
49 views

How can I conditionally display fields based on the same paragraph radio field value?

I have added a paragraph where I want to use a radio button to conditionally display text fields from that same paragraph. My radio values are: Select discount in amount -> if checked, then ...
user avatar
0 votes
0 answers
36 views

How to correctly add a slideshow to Content type using a module paragraphs?

I created a Content type - News. Then using modules View, Slick Carousel, Slick View I displayed my news in a block as a slideshow But now I need to add a slideshow to a paragraph and display it on ...
user avatar
0 votes
0 answers
38 views

How do I add the news that I created earlier to the slideshow using the Paragraphs module?

I created Content type - News. And added ten news. Using the View module, I displayed them on the /news page. I need to make a slideshow with 3 selected news on the frontpage of the site using the ...
user avatar
  • 9
1 vote
0 answers
155 views

Delete millions of unused Paragraphs and their data?

We have a site that after a few years has built up 10 million records in the paragraphs_item table. This is a result of lots of data migrations (where paragraphs are involved) and there are many ...
user avatar
  • 26.5k
1 vote
1 answer
190 views

How to hook on paragraph deletion?

I'm on D9 and I've a paragraph inside a content type node. I need to hook when the paragraph is deleted to do some custom logic and set up a queue. I've tried hook_entity_delete, hook_entity_predelete ...
user avatar
  • 490
1 vote
1 answer
69 views

How to validate a paragraph field?

I have a paragraph type with 2 fields: year and quarter I have a content type with a paragraph field (field_year_and_quarter) targeting ONLY this paragraph type I am trying to create a constraint to ...
user avatar
  • 554
0 votes
0 answers
28 views

How to make pagination for php data inside preprocess_paragraph_HOOK

I have data coming from External Entity (MongoDB) and I need to make pagination inside hook theme suggestion of a paragraph : Is there a way to use built-in pagination of Drupal in this scenario? ...
user avatar
0 votes
1 answer
67 views

Extending block, a block with a paragraph field, and 3 paragraph fields... how to loop through the paragraphs from the block extension

This is what I have: I have three twig files: block--paragraph-images.html.twig (which extends block.html.twig) field--field-paragraph-image-block.html.twig (the paragraph field which is located in ...
user avatar
0 votes
0 answers
30 views

Deleting a Paragraph Item results in AJAX POST error "Missing bundle property on entity of type node."

Working with an older D7 site. On it, we have added the latest version of Paragraphs to add some content items to a page. This all works fine. However, when trying to remove a Paragraph Item from the ...
user avatar
  • 26.5k
0 votes
1 answer
42 views

How to pass Paragraph ID from Layout Builder to Views?

This is a bit convoluted; so hopefully it makes sense: I have a parent entity: Event. Event has a Paragraph field on it: Sessions (paragraph type: Session). I use Layout Builder to format the Full ...
user avatar
  • 907
0 votes
1 answer
60 views

Trying to access a "count" variable inside a block field from paragraphs template

I'm trying to get the number of paragraphs an authenticated user inputs by counting them in the parent block template and trying to access that number in the paragraphs template. I have two templates ...
user avatar
0 votes
1 answer
31 views

Custom validation constraints multi value paragraphs : how to get weight value

I am validating a multi value paragraph field using constraints. /** * Implements hook_entity_bundle_field_info_alter(). */ function cnfpt_internet_entity_bundle_field_info_alter(&$fields, \...
user avatar
  • 49
0 votes
1 answer
47 views

Custom constraints validation of multi value paragraphs: highlighting missing field

I am using constraint for the validation my multi value paragraph field. I can correctly implement the different validation rules but I haven't found out how to highlight only the erroneous field(s). ...
user avatar
  • 49
1 vote
1 answer
43 views

How can I access the parent entity values inside a custom paragraph formElement?

I created a select custom field that must be inserted inside a paragraph and the options values are dynamically inserted based on another reference field present in the paragraph itself. How can I ...
user avatar
0 votes
0 answers
25 views

Last item missing for multiple fields when editing a node

I'm using a multiple paragraphs field on a node. I noticed that each time I saved the node and then edited it again, the last item (delta n-1 with delta starting at 0) would disappear. If I clicked on ...
user avatar
  • 423
0 votes
0 answers
39 views

Using Tac Lite in combination with Paragraphs

For our new Drupal 9 (or 8 if necc.) website we require a very fine controllable access structure where we can give and restrict access on a user by user basis. Not only for a content type but also ...
user avatar
  • 1
1 vote
2 answers
2k views

Accessing node value in paragraph twig template

I'm writing a twig template for a paragraph. I'd like to access a text field value from the page/node where this type of paragraph will be added. Specifically, I'd like to access the value of a text ...
user avatar
0 votes
0 answers
27 views

Is there a way to make a single type Paragraphs field not required?

My Content Type has a Paragraphs field that is Not required. The Paragraph type has a required field for when it is added, but until it is added, this shouldn't trigger "required" for my ...
user avatar
  • 204
1 vote
1 answer
35 views

How can I assign custom field layouts using paragraphs?

For reference: -modules --contrib ---ds --custom ---ds I'm looking to add paragraph layouts using flexbox. I don't see a module specifically for this, so I realize I'm going to have to adapt an ...
user avatar
  • 57
0 votes
1 answer
136 views

How to access paragraph fields from a webform's form?

I have a webform (contact_info) which is attached to a paragraph's field (field_contact_info). The paragraph has other fields as well. I implemented hook_form_alter() to change some attributes inside ...
user avatar

1
2 3 4 5
9