You are here

function social_core_preprocess_field in Open Social 10.2.x

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_core/social_core.module \social_core_preprocess_field()
  2. 8 modules/social_features/social_core/social_core.module \social_core_preprocess_field()
  3. 8.2 modules/social_features/social_core/social_core.module \social_core_preprocess_field()
  4. 8.3 modules/social_features/social_core/social_core.module \social_core_preprocess_field()
  5. 8.4 modules/social_features/social_core/social_core.module \social_core_preprocess_field()
  6. 8.5 modules/social_features/social_core/social_core.module \social_core_preprocess_field()
  7. 8.6 modules/social_features/social_core/social_core.module \social_core_preprocess_field()
  8. 8.7 modules/social_features/social_core/social_core.module \social_core_preprocess_field()
  9. 8.8 modules/social_features/social_core/social_core.module \social_core_preprocess_field()
  10. 10.3.x modules/social_features/social_core/social_core.module \social_core_preprocess_field()
  11. 10.0.x modules/social_features/social_core/social_core.module \social_core_preprocess_field()
  12. 10.1.x modules/social_features/social_core/social_core.module \social_core_preprocess_field()

Prepares variables for comment field templates.

Default template: field--comment.html.twig.

Parameters

array $variables: An associative array containing:

  • element: An associative array containing render arrays for the list of comments, and the comment form. Array keys: comments, comment_form.

File

modules/social_features/social_core/social_core.module, line 308
The Social core module.

Code

function social_core_preprocess_field(array &$variables) {
  $element = $variables['element'];
  if ($element['#formatter'] == 'comment_node') {

    // Create separate variables for the more_link.
    $variables['more_link'] = $element[0]['more_link'];
  }
}