Conditional Fields inside Paragraphs not working

Am able to get the configured conditional fields in hook_field_widget_WIDGET_TYPE_form_alter() and trying to apply them for Paragraph fields but not working, below is the code(most of it copied from Conditional Fields module file):

$ dependencies = conditional_fields_load_dependencies(‘paragraph’, ‘paragraph_machine_name’);

if (!empty($ dependencies)) {

    foreach ($  element['subform'] as $  field_name => $  field_details) {       if (isset($  dependencies['dependents'][$  field_name])) {          foreach ($  dependencies['dependents'][$  field_name] as $  id => $  dependency) {           if (!isset($  element['subform']['#conditional_fields'][$  field_name]['dependees'][$  id])) {             conditional_fields_attach_dependency($  element['subform'], ['#field_name' => $  dependency['dependee']], $  field_details, $  dependency['options'], $  id);           }         }       }        if (isset($  dependencies['dependees'][$  field_name])) {         foreach ($  dependencies['dependees'][$  field_name] as $  id => $  dependency) {           if (!isset($  element['subform']['#conditional_fields'][$  field_name]['dependents'][$  id])) {             conditional_fields_attach_dependency($  element['subform'], $  field_details, ['#field_name' => $  dependency['dependent']], $  dependency['options'], $  id);           }         }       }     }   } 

Can someone please help me in it?

How to create fields to a existing content type in Drupal8 using .yml installer

I need to add 2 fields to an existing content type in drupal8 website, one is text another is file type, I have a multisite setup so I need to add for every locale site, Now I have created a module and created installer file, right now I am able to create the fields but I am unable to add the file extension to the file type field. can anyone please help with this?

I have followed this below documentation to create the filed.

How to set up address fields in magento 2?

I need only the first name, last name, telephone number, city, email, and one custom field in address form. But some of the fields are required for backend validation. I tried to make a plugin for LayoutProcessor, and use $ jsLayout, but it does not help. There is also a customer address. My shipping/billing and customer addresses form should look like this: email, Firstname, Lastname, phonenumber, city (autocomplite), customfield (autocomplite).

Help with an UI for credentials with restrict of 2 dependent fields

I am trying to change credentials UI where a user should insert username & password . The change will include another field called PEM which can be either an upload button or a dropzone. The requirement is that the user need to provide a username and a PEM File OR a Password.

The UI currently looks like so:

enter image description here

Where should I add the dropzone OR upload button?

Is there a better way to style fields?

I’m learning twig and using it to format and style my fields. The problem I am running into is that I need to create a new twig template for each individual field.

In the example picture, I have field--parent-task.html.twigwhich allows me to edit 1 field (or the first field), but I will need to create 6 more templates with identical code structure, just to style and move the fields around.

enter image description here

Is there a more efficient way to do this? In the end, I will have 7 templates just to target different fields, but yet they are all on the same page. I know I can target classes, say field__label, but that is not what I need, since I will be moving these fields around, giving them unique positions on the page.

If it cannot be done and this is how it is in D8, that is fine, I will deal with it. But if not, is there a better approach? So I don’t end up having a endless list of field templates just to add/tweak a few css styles?

get fields from a view into twig from a custom display style

So I created a custom display style following a tutorial and enabled fields to be used. I can’t, however, figure out what the variables on the twig file should be to display the fields I want.

MY PHP looks like this

class Slider extends StylePluginBase {     /**      * {@inheritdoc}      */     protected function defineOptions() {       $  options = parent::defineOptions();       $  options['path'] = array('default' => 'slider');       return $  options;     }      /**      * Does the style plugin for itself support to add fields to its output.    *    * @var bool    */   protected $  usesFields = TRUE;     /**    * {@inheritdoc}    */   public function buildOptionsForm(&$  form, FormStateInterface $  form_state) {     parent::buildOptionsForm($  form, $  form_state);      // Path prefix for SLIDER links.      $  form['chooseImage'] = [       '#title' => $  this->t('Choose Image'),       '#type' => 'select',       '#description' => t('Choose where to position the title and text in the slider'),       '#options' => ['cc' => $  this->t('Center'), 'tl' => $  this->t('Top Left')],     ];  } 

I create a theme function for the view.

function slider_theme($  existing, $  type, $  theme, $  path) {   return array(      'slider' => array(       'file' => '',      ),   ); } 

The extended display styles file allows me to add options but I don’t know how to add the view variables.

 function template_preprocess_views_view_slider(&$  variables) {   // View options set by user.     $  options = $  variables['view']->style_plugin->options;    // Build a two-dimension array with years and months.   $  time_pool = array();   $  frameArrayManual = array('a','b','c');   //$  options['manual'] = $  variables['view']->style_plugin->manual;    foreach ($  variables['view']->result as $  id => $  result) {     $  created = $  result->node_field_data_created;     $  created_year = date('Y', $  created);     // Month date format.     $  month_date_format = (isset($  options['month_date_format'])) ? $  options['month_date_format'] : 'm';     $  created_month_digits = date('m', $  created);     $  created_month = date($  month_date_format, $  created);     $  time_pool[$  created_year][$  created_month_digits] = "$  created_month";   }    $  options['time_pool'] = $  time_pool;   $  options['frameArrayManual'] = array('a','b','c');    // Update options for twig.   $  variables['options'] = $  options; } 

I can’t find any resources to figure this out.

Weird custom fields data lost

Hello guys,

I'm experiencing a weird issue with my wordpress. I'm around this for almost two months. Can someone please help me? Please be my life savior…

The issue:

When I publish a post with data in all fields (original and custom) everything seems ok. But after a few days (3-7 days on average), the data from my custom fields (only) disappear and I don't understand why. I already did the test of disabling all my plugins and I still have the same problem. So probably the issue is in my…

Weird custom fields data lost