Commit 18cdb06e authored by Vasyl Yaremchuk's avatar Vasyl Yaremchuk
Browse files

classes field description in the forms, support of inline syles in classes field

parent 9d2c2141
Loading
Loading
Loading
Loading
+3 KiB (24 KiB)

File changed.

No diff preview for this file type.

+5 −2
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ function landingpage_preprocess_paragraph(&$variables) {
  $variables['base_url'] = $base_url;
  $paragraph = $variables['paragraph'];
  $skin_fields = \Drupal::entityManager()->getFieldMapByFieldType('paragraph_skin_field_type');

  $inline_styles = '';
  if (!empty($skin_fields)) {
    $variables['attributes'] = new Attribute();
    foreach ($skin_fields as $field_wrapper) {
@@ -68,12 +68,15 @@ function landingpage_preprocess_paragraph(&$variables) {
                $variables['attributes']->addClass($result[1][0]);
              }
            }
            if (strpos($class['value'], ':') !== false && strpos($class['value'], ';') !== false) {
              $inline_styles .= $class['value'];
            }
          }
        }
      }
    }
  
  } 
  $variables['inline_styles'] = $inline_styles;
}

function _landingpage_is_admin() {
+3 KiB (42 KiB)

File changed.

No diff preview for this file type.

Loading