Skip to main content

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
2 answers
55 views

How can I get a "Date range" field to display the correct time?

I have a "Date range" field in my paragraph type. I'm displaying the time in the node template like so: {% for item in node.field_agenda_dates %} {% if item.entity.field_date.value is ...
arnoldbird's user avatar
  • 1,257
0 votes
0 answers
44 views

hook_field_widget_form_alter() not retaining form field value when "Add another item" button is clicked

My hook_field_widget_form_alter() implementation looks as follows, function mymodule_field_widget_form_alter() { $field_definition = $context['items']->getFieldDefinition(); if ($...
Sivaji's user avatar
  • 2,478
0 votes
0 answers
53 views

Free/loose mode content translation with paragraphs

The content_translation module available since Drupal 8 allows me to translate content pages (entities/nodes) in a very strict mode: Each paragraph on the source language page has a translated ...
cweiske's user avatar
  • 154
1 vote
1 answer
62 views

How to modify a paragraph behavior setting programmatically?

I would like to alter/change a certain paragraph behavior plugin setting. If I debug the paragraph entity, I can find the behavior_settings value, but it's json encoded and I don't think the best ...
Alejandro's user avatar
0 votes
0 answers
49 views

How can I programatically add a paragraph type field to custom block?

Currently, I already built a custom block programmatically, now I want to add a paragraph-type field programmatically to this block but don't know how to do it. The reason is that I want to add/remove ...
huyleuit's user avatar
-1 votes
2 answers
97 views

What is the syntax for "if the image style does not exist and if no image style is selected"?

I'm encountering an issue when calling a preprocess function to load a styled image URL. This issue is based on the question here. The following Preprocess Paragraph function sets the style based on ...
CocoSkin's user avatar
  • 891
1 vote
1 answer
274 views

How to query the parent entity of a paragraph

I would like to use the entityQuery for querying paragraphs of type my_paragraph_type With the field field_boolean_test set to TRUE And a condition on the parent of the paragraph: field_parent must ...
Baud's user avatar
  • 542
0 votes
2 answers
128 views

How do I get the image URL with the same style setting in Manage Display?

I'm creating a paragraph template. It renders images and other fields to create a layout design. While I can successfully render all fields, the challenge is to render the style applied in the Manage ...
CocoSkin's user avatar
  • 891
1 vote
1 answer
99 views

Why is this paragraphs form broken with a tabledrag error?

I've spent many hours on this and am out of ideas. All node edit forms on our site with Paragrpahs are showing the weight/delta fields and drag and drop does not work. There is no button to toggle &...
quantumized's user avatar
  • 1,239
0 votes
0 answers
147 views

Error in Programmatically Creating Paragraphs with Layout Paragraphs

I am trying to programmatically create paragraphs using the Layout Paragraphs module. However, I'm encountering this error when saving the main entity that contains these paragraphs. I'm looking for ...
yorchperaza's user avatar
0 votes
1 answer
128 views

How can I render a Paragraph field in the views unformatted template?

I'm simply trying to render a Paragraph field from my content type in a view template. It's insanely difficult! I have the field setup to display the rendered entity, but how do I set it up in my ...
Robert's user avatar
  • 1
0 votes
1 answer
151 views

Add paragraph fields to a view

I have a content type "view" that has a paragraph attached to it, giving the ability to add a body, image, file, block, etc. I need to create a view for the blog listing that will show the ...
Jenni Simonis's user avatar
0 votes
1 answer
260 views

Passing variable from parent paragraph to children without using getParentEntity

I have a paragraph called Boxes which is a parent paragraph referencing to many paragraphs of type Box. I have written the preprocess function of paragraph Boxes which contains some logic that can't ...
Mira chalak's user avatar
0 votes
1 answer
209 views

Create tabs with paragraphs and Bootstrap tabs

I'm working on a project that consists of transferring a laravel website to drupal. One of the features that I'm having difficulty recreating is separating content information into tabs. This content ...
LordCaosWInc's user avatar
0 votes
1 answer
101 views

How to use node context in custom block plugin to get correct revision for node and its fields?

Background information for this question can be found here: How to have a different hero image per node? I have written a custom block that takes the data from this "hero" paragraph and ...
Jordan's user avatar
  • 49
0 votes
1 answer
171 views

How to have a different hero image per node?

What we want: Users should be able to choose an image, add call to action links, and a few other options when setting up a hero for the specific page they are creating. We have three different content ...
Jordan's user avatar
  • 49
-1 votes
1 answer
263 views

Displaying parent field value in field.html.twig template from nested paragraphs

See attached please. Using field.html.twig and paragraph.html.twig, Paragraphs 8.x-1.16 Stable release and Drupal 9.5.10 field.html.twig (specifically: field--paragraph--sidebar-button-repeater.html....
rachel_001's user avatar
0 votes
1 answer
457 views

Display paragraph field value in field.html.twig - Paragraphs module

I need to display a field value available to paragraph.html.twig in field.html.twig. I have a paragraph type called buttoncontainer with a field name called field_background_color. I have a paragraph ...
user avatar
2 votes
1 answer
99 views

How can I get the untranslated field value from a translated paragraph?

Normally you can't have different paragraph items per language so I simply want to hide selected paragraphs depending on a field value in the paragraph. I added an untranslatable list field listing ...
leymannx's user avatar
  • 18.3k
1 vote
1 answer
176 views

Opening a nested paragraph in a modal window

I have a paragraph (image with some fields) inside a parent paragraph. Inside the template of the parent paragraph I'd like to open the nested paragraph via link () in a modal window. How can I access ...
deelite's user avatar
  • 479
1 vote
0 answers
13 views

How can I add the hero section image in the View to REST_API?

Hello im using Drupal 9.5.9 version. How can I add the hero section image in the View to REST_API? I have created an api with Rest_API to fetch data from Views I have created. I have no problem ...
devr4n's user avatar
  • 11
0 votes
2 answers
140 views

How can I add a custom field?

I am using layout paragraph module. I have a "section" paragraph with the layout paragraph behaviour. I want to add a field Background color to the section. Should I add it inside the layout ...
Mira chalak's user avatar
2 votes
1 answer
139 views

Paragraph Entity Query returns too many results

I'm trying to find a paragraph that have a certain taxonomy term value and on a matching parent node. I tried the code below, but it always returns over 30 values, when really only one paragraph ...
Rene's user avatar
  • 111
-1 votes
1 answer
238 views

Content type with 3 paragraphs fields: How can I output to different parts of page.html.twig? [closed]

I have a content type called (My Page) with 3 paragraph types, for a slider to display images, for text to display text, and for sidebar content. (The sidebar is a <div>, not a Drupal region/...
user avatar
0 votes
0 answers
91 views

Paragraph field in view relationship

Created a paragraph type with field named "related literature paragraph" as entity reference and inserted this paragraph type to a content type called landing page for a field named body ...
Suba sekar's user avatar
0 votes
2 answers
90 views

Twig: display linkfield with optional title

I created a linkfield within a paragraph with an optional title. The textlink should only be displayed, when the title is not empty. I need the URL from the linkfield for another field (an image where ...
ase's user avatar
  • 1
1 vote
1 answer
157 views

Set new paragraphs to unpublished by Default

Is there a way, to set new Paragraphs to unpublished per Default? For Content Types, I can set that new Nodes are not published per Default (Structure -> Content types -> Tab 'Edit' -> Widget ...
mullzk's user avatar
  • 65
1 vote
1 answer
89 views

can a module introduce paragraph types and templates?

I'm building a very complicated paragraph layout with multiple levels of interconnecting paragraph types. At the moment, configuration and template files are all over the place. So, I was wondering if ...
Alimba's user avatar
  • 117
-2 votes
1 answer
70 views

How do I remove duplicate taxonomy field values in the paragraph display mode template?

How to remove duplicate values in this code, if they are in "{{ post.entity.name.value }}"? {% block paragraph %}{% block content %} {% for post in paragraph.field_post %} {% if ...
Владимир Помелов's user avatar
1 vote
1 answer
139 views

How do I stop Fields being rendered twice for a node with Paragraph Types using UI Patterns?

I'm using UI Patterns within Paragraph Types which is resulting in the Fields being rendered twice in the theme. I'm using a sub theme of the bootsrap5 contrib theme. I have a custom layout twig:- {# /...
Darren's user avatar
  • 293
0 votes
2 answers
256 views

Can't get real field value from paragraph

I need to get value from exact paragraph type in paragraph reference field in node, so I can use it in Twig. Here's my current code: function my_theme_preprocess_field(array &$variables, $hook) { ...
mixerowsky's user avatar
  • 1,581
2 votes
3 answers
475 views

Append new paragraph item to existing node

I want to append a new paragraph item to a existing node, which has previously a paragraph item. I just want to add another paragraph item with the previous one. But my script only updates the ...
Souvik Das's user avatar
0 votes
1 answer
225 views

Paragraphs field preprocess hook not called

To simplify this issue, I just have 2 hooks: 1. customtheme_preprocess_paragraph__registration_button() 2. customtheme_preprocess_paragraph__registration_button__default() When I access a node with a ...
Ivan Ginovski's user avatar
0 votes
1 answer
251 views

How do I create a paragraph using a bundle class defined in another module?

I have a controller in one module that generates paragraphs that are using unique bundle classes that I want to be able to use in other modules. In my controller I have this $bundle_class = \Drupal::...
Amy's user avatar
  • 5,738
1 vote
1 answer
782 views

Removing orphaned paragraph references from the user

Setup Drupal 9 site has Users and each user has a Paragraph that contains "Phone" data. User => Phone Paragraph connection is made via field $user->field_phone_para. Issue Somehow ...
Raido's user avatar
  • 11
1 vote
2 answers
504 views

How to pass paragraph id from layout builder to view?

I have asked this question before but in a different, more convoluted context. This is a simpler example. I have a paragraph type which I use Layout Builder to define it's layout. In that layout I ...
liquidcms's user avatar
  • 1,288
1 vote
2 answers
340 views

How to loop through and build an array from each referenced entity [closed]

I’m trying to create a card grid component using paragraphs. I have a reference entity which references different card types with unlimited cardinality. I’m able to pull the values from the ...
Shawn W's user avatar
  • 111
0 votes
0 answers
128 views

How to target buttons to add a new paragraph field

In a form_alter hook I'm trying to target the buttons to add a new paragraph but can't seem to target the specific buttons. The buttons are multiple entity references with unlimited cardinality, but ...
Shawn W's user avatar
  • 111
1 vote
0 answers
100 views

TMGMT translations are not accepted when there is a pending revision in the default translation

Can someone please help with TMGMT (8.x-1.14) and Paragraphs (8.x-1.15) modules working together in Drupal 9.4.8 setup. There is a content type having a Paragraph entity reference revision field. ...
HarshB's user avatar
  • 13
2 votes
2 answers
2k views

How to display Media image with alt attribute in paragraph twig template

I'm trying to access alt attribute as in given example Get Media Image URL in Paragraphs Twig Template - Drupal 8 But there is an example how to access alt and title... That's easy, too. You should ...
Vitaliy K's user avatar
  • 129
0 votes
0 answers
69 views

How to determine entity where image field is housed?

I need to check if an image media field is housed in a paragraph to remove the alt attribute of that attribute. The same image field could be referenced anywhere. I could remove the alt field it ...
Binny's user avatar
  • 900
0 votes
1 answer
87 views

How can I attach a newly added paragraph to existing records? [closed]

While editing a form, I needed to delete some fields and add a new paragraph. The issue here is, the newly added paragraph is not initialized in the edit form and that makes sense because the old data ...
Mourad Tlili's user avatar
0 votes
0 answers
194 views

how to get field image of a referenced entity in paragraph template

I made a paragraph with a referenced entity field to a content type called "tools" Actually I can get the title and body text like that : <h3>{{ content.field_tools_and_services.0['#...
johndoe555's user avatar
1 vote
0 answers
758 views

Correct way to migrate multiple paragraphs from custom source

Drupal 9.4.5. Looking to migrate Drupal 7 books into Drupal 9 paragraphs. Will need to migrate multiple paragraphs into D9 multi paragraph reference fields. Below is outline of desired paragraph ...
SomebodySysop's user avatar
0 votes
1 answer
443 views

Is it possible to Migrate data directly into the paragraph entity?

Posted this in Drupal Paragraphs issue queue, but no response. Trying here. Drupal core 9.4.5. Paragraphs 8.x-1.2 Every tutorial on Drupal 8/9 paragraphs migration uses the destination plugin: ...
SomebodySysop's user avatar
0 votes
1 answer
274 views

Contextual filter from Taxonomy inside a paragraph

I have content-type (Destination) with a paragraph added as a component. This paragraph has a referenced taxonomy vocabulary (location). I want to display a list of nodes from another content-type (...
Tabestan's user avatar
0 votes
1 answer
299 views

Deleting the original content doesn't delete translated one [closed]

When I delete original content, the translated one isn't delete and I just can't delete it ("remove" button doesn't appears). These are the steps to reproduce the issue. Install the ...
Dharmesh Sojitra's user avatar
0 votes
0 answers
76 views

Fields only from the first paragraph

I have a node type with paragraphs. In a view I need to get fields from these paragraphs. But only from the first paragraph of every node. In the view I have a relationship to the field which ...
deelite's user avatar
  • 479
0 votes
0 answers
434 views

Media Library and paragraphs not working

I have a paragraph with multiple fields, one of them is a media field (document type). If I add a new paragraph and then add media I got "ajax error". If I add new paragraph and save content ...
Pedro's user avatar
  • 144
0 votes
0 answers
206 views

Show field when the other one is empty on Drupal 9 editing content

I'm pretty new on Drupal I probably only have one month using it. I have two fields on a paragraph type, "field_text1" is a Text(plain,long) and the other one, "field_text2" is a ...
tryingMyBest1's user avatar

1
2 3 4 5
10