You are here

function paragraphs_edit_preprocess_paragraph in Paragraphs Edit 8.2

Same name and namespace in other branches
  1. 8 paragraphs_edit.module \paragraphs_edit_preprocess_paragraph()

Implements hook_preprocess_HOOK() for paragraph.html.twig.

See also

contextual_preprocess()

template_preprocess_paragraph()

File

./paragraphs_edit.module, line 66
Allows users to edit, clone and delete paragraphs.

Code

function paragraphs_edit_preprocess_paragraph(&$variables) {

  // Paragraph templates don't normally print the title_suffix, so add the
  // contextual links to the content render array.
  if (isset($variables['title_suffix']['contextual_links'])) {
    $variables['content']['contextual_links'] = $variables['title_suffix']['contextual_links'];
    $variables['content']['contextual_links']['#weight'] = -100;
  }
}