We’re utilizing paragraphs on a Drupal 8.8.5 with paragraphs 8.x-1.11.
To assist relieve some information entry, I’ve created a module that auto-populate a customized content material sort,
Pupil Web page. This content material sort has a paragraphs discipline, and for this auto-generated content material, we need to connect a customized paragraph sort,
Pupil Gallery, which has a views entity reference. The contextual argument to filter the view show is the scholar’s electronic mail handle, so I need to populate that discipline mechanically in my module.
I can get the node to generate appropriately with the entire fields, besides I am unsure learn how to populate the argument discipline of the view.
$paragraph = Paragraph::create([ 'type' => 'gallery_student', 'field_gallery_title' => $student . ''s work', ]); $paragraph->save(); $node = Node::create([ 'type' => 'student_page', 'field_paragraphs' => $paragraph, ]); $node->save();
The sphere on the paragraph is known as
field_gallery2_view_ref and its sort is “Views Reference”. The “View show plugins to permit” is simply set to permit “Embed”.
How do I programmatically set this argument?