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
37 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 ...
0
votes
1answer
58 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
21 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
38 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
0answers
30 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
68 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 ...
0
votes
1answer
28 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
59 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 &&...
3
votes
1answer
60 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
21 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
23 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 ...
0
votes
1answer
60 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 ...
1
vote
1answer
73 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
29 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 ...
0
votes
0answers
36 views

How do I programmatically add fields to Paragraph types?

I have one paragraph type of Product. and I have to add one field to paragraph product programmatically, how can I achive this. function my_module_field_widget_paragraphs_form_alter(&$element, ...
0
votes
0answers
42 views

How do I pull a value from a Paragraph field and put it in a template? [duplicate]

I would like to pull a value from a field I have in Paragraphs. I have a content type called "Landing Pages" (landing_pages) I have a paragraph type called "Landing Page" (landing_page) The field ...
0
votes
1answer
40 views

How to create paragraph of particular type using JSONAPI?

I am able to GET the data using endpoint "site_url/jsonapi/paragraph/text". But I am not able to create a new paragraph of type text. Its always giving me error "403 forbidden". I have tried all ...
2
votes
1answer
150 views

How do I get paragraph fields text data without the <p> tags?

I am trying to pass my paragraph field data from Drupal to a component that I have created in Twig. My component echos out data like so: <p class='my-custom-class'>{{ my_var }}</p> In my ...
0
votes
0answers
28 views

How to wrap Paragraph fieldgroup horizontally

I want to display a few fieldgroups inside of a Paragraph side-by-side horizontally when in node edit form. I gave each fieldgroup the class .popular in the GUI in manage form display. The fieldgroup ...
1
vote
0answers
80 views

Is there a way to add CSS classes to Paragraphs Add More submit buttons?

I'm using the buttons method to add more paragraphs and am styling the buttons via css in a custom module. I'm setting paragraph icons as background images for each button so an editor can visually ...
2
votes
1answer
79 views

is there a way to generate dummy content for paragraphs? [closed]

I am working in Drupal 8. Is there any way, with devel, to generate dummy content for paragraphs to visually get a feel for how things would look? Is there a module or script to accomplish that might ...
1
vote
0answers
21 views

Adding accessing getSummary within a paragraph

I'm using the Paragraph module as part of Drupal 8. I have the following method to load the individual paragraphs when i match on a certain type try { $query = \Drupal::service('entity.query')-&...
0
votes
0answers
81 views

Ajax call for autocomplete reference field

I do not succeed to fire the ajax when an autocomplete reference field widget is populated or changed inside a paragraph form. TO BE MORE CLEAR: I Succeed when using a simple select list but not when ...
0
votes
2answers
151 views

How to check if a referenced entity is being used in other places?

I have a paragraph component that has a single field (reference) that calls on other paragraph components. I'd like to remove one of the paragraph reference field options so that users do not ...
0
votes
0answers
28 views

Showing a View of a Paragraphs block in a node with contexual/relationship filters

I have a slightly complicated question. So i'm experimenting with nested paragraphs where the parent paragraph is a container for another paragraph. In this case, i'm making an Agenda/Event program ...
0
votes
1answer
53 views

Failed to import Bootstrap Paragraph sub module configuration

I tried to implement the Hero with Xeno Hero in the Bootstrap Paragraphs in Drupal 8. I encountered an error when I tried to import the config of the sub module. I am not sure if I do it the right ...
0
votes
0answers
61 views

Notice: unserialize(): Error at offset XX (removing Paragraphs)

I'm trying to remove Paragraphs and modules related to it manually (because I can't remove it completly from admin page). I'm using UTF8 without BOM in Notepad++ when editing key_value BLOB file that ...
0
votes
0answers
13 views

How to render two paragraph fields behind each other in a slick slider?

In my node content type I have two fields which containing different kinds of paragraph types. (How) is it possible to render the paragraphs of the two node fields in one slick slider behind each ...
0
votes
0answers
66 views

Sort by date in view with results from Solr Search API

I create release notes section for my website where I fetch a paragraph from the specific content type. I have configured one index with fields such as name or status. In addition to that, I added the ...
1
vote
1answer
39 views

How to update custom paragaph which is added to User Profile?

I have a requirement to create/update a paragraph which is added as a custom field in USER profile. After surfing here, i got how to update a paragraph which is connected to node. But I am not able ...
0
votes
1answer
145 views

Creating a Paragraph type programmatically

I have a custom module that is installed on a number of sites. In an hook_update_n function I would like to add a completely new Paragraph type (not actual instance of a Paragraph) to every site, ...
0
votes
0answers
58 views

Views paragraph fields in block Twig template

I understand that I can use content['#view'].field['field_name'].value(rowcount) to get a value of a field. But how can I refer to fields of a paragraph field, that is in a view block in a file like "...
0
votes
1answer
57 views

paragraphs_update_8018 takes very long time to finish

The paragraphs_update_8018 update takes very long to complete (we have over 1 mio. paragraphs), as of now it's already been over 1h40m and it's still running. EDIT: it finished after 1h47m My ...
0
votes
0answers
63 views

Programmatically creating paragraphs is extremely slow

I am adding paragraphs from xml file programmatically but it is extremely slow. for example I'm basically creating paragraphs like this: $row = ['field_title' => 'title', 'field_id' => 'id' .......
0
votes
0answers
36 views

Default Paragraph Config Per Content Type

We're using a paragraph for the hero/header of our site. Within the paragraph are a number of different toggles to define various options for the hero. I'd like to have it so that if the user is ...
0
votes
0answers
93 views

How can I programmatically get the image style of an image in a paragraph template?

I have an Twig extension that applies image style to an image and provides a URL for the processed image. The extension looks like this: protected function setImageStyleUrl($url_field_value, $...
0
votes
2answers
188 views

How can I add paragraphs to a translated node?

I have a problem with the Paragraphs module and translation. I'm using Drupal 8.7.7 and Paragraphs 8.x-1.9. When I add a translation to a node with a paragraphs field (unlimited), I can only ...
0
votes
0answers
58 views

How to use Paragraph components inside of Paragraph components

I have a component-based system using Paragraphs. I create the markup in Twig (Drupal 8), then pass the values of Paragraph fields to the component's properties. So for a super basic example: {# card....
-1
votes
1answer
132 views

Get array number of paragraph item in TWIG

I have a paragraph (Entity reference revisions) with multiple items. I would like to display the item list rendered. I only get the paragraph as element['#object'] (in a pseudo field). ...
-2
votes
1answer
100 views

How can I create a new Paragraph item programmatically in an Ajax form handler?

I need to add Paragraph fields programmatically to an entity in an AJAX handler. This is my AJAX callback and how it's added: function mymodule_form_alter(&$form, \Drupal\Core\Form\...
0
votes
0answers
126 views

JSON view (rest export)

I have a rest export view and this is my output: { title: "about", view: "[{"id":7,"field_history_json":7,"field_history_text":"sdfsfsdffd","field_history_year":3244}]" } My field "view" is a ...
1
vote
0answers
64 views

Programmatically add more 'paragraphs' in form alter ajax call [duplicate]

I have a content type called repair that has a multi paragraph field (field_products) called Products. In the create new repair form I have an ajax button that fetches N number of products and ...
0
votes
1answer
50 views

One field (entity reference - paragraph) with two display modes

I am having issue with displaying one field twice in my template having different display modes. I have a content type basic page with field field_gallery (which is entity reference on paragraph). In ...
0
votes
1answer
118 views

Custom formatter for paragraphs field

I want to build a custom formatter for a paragraphs field that renders some of the fields of the paragraph. However, I don't know how to access the single files of the paragraph field. So far I've ...
0
votes
0answers
26 views

Migrating without changing structure

I'm trying to to migrate Paragraphs content from my existing Drupal 7 site to a new Drupal 8 site. The content models are not changing. As one of the simplest examples, I'm migrating Paragraphs ...
0
votes
3answers
54 views

Attach different CSS classes to first and second link

I have a Paragraph type 'Call to action' with one link field field_link. I have another Paragraph type where I call the 'Call to action' paragraph as an Entity reference revisions field. With Allowed ...
1
vote
1answer
202 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
0
votes
1answer
284 views

Anchor links to paragraph content

I have some drupal 8 sites that make heavy use of the Paragraphs and Bootstrap Paragraphs modules. Some of my users want to be able to create anchor style links to specific paragraph items on pages. ...
-1
votes
1answer
45 views

I removed the module from my site and now I'm getting an entity type error

I have an issue where I removed the paragraphs and bootstrap_paragraphs modules from my site and now I am unable to access the admin or the site. It is saying that the paragraphs entity type doesn't ...
1
vote
1answer
32 views

How to delete paragraph when uninstalling the module?

I have been creating the custom module which have the paragraph configuration, when installing the custom module, the paragraph config will be stored in the database and then It will be available in ...

1 2 3 4 5 7