Skip to main content
added 2 characters in body
Source Link
mably
  • 11
  • 2

Here is our solution to add markup to the view title:

function my_module_views_post_render(ViewExecutable $view, array &$output, CachePluginBase $cache) {
  $output['#post_render'][] = function ($content, array &$element) {
    $element['#title']['#markup'] = 'test - <b>My<em>My new Title</b>';em>';
    return $content;
  };
}

Tested on Drupal 10.2.7.

Here is our solution to add markup to the view title:

function my_module_views_post_render(ViewExecutable $view, array &$output, CachePluginBase $cache) {
  $output['#post_render'][] = function ($content, array &$element) {
    $element['#title']['#markup'] = 'test - <b>My new Title</b>';
    return $content;
  };
}

Tested on Drupal 10.2.7.

Here is our solution to add markup to the view title:

function my_module_views_post_render(ViewExecutable $view, array &$output, CachePluginBase $cache) {
  $output['#post_render'][] = function ($content, array &$element) {
    $element['#title']['#markup'] = 'test - <em>My new Title</em>';
    return $content;
  };
}

Tested on Drupal 10.2.7.

added 28 characters in body
Source Link
mably
  • 11
  • 2

Here is our solution to add markup to the view title:

function my_module_views_post_render(ViewExecutable $view, array &$output, CachePluginBase $cache) {
  $output['#post_render'][] = function ($content, array &$element) {
    $element['#title']['#markup'] = 'test - <b>My new Title</b>';
    return $content;
  };
}

Tested on Drupal 10.2.7.

Here is our solution to add markup to the view title:

function my_module_views_post_render(ViewExecutable $view, array &$output, CachePluginBase $cache) {
  $output['#post_render'][] = function ($content, array &$element) {
    $element['#title']['#markup'] = 'test - <b>My new Title</b>';
    return $content;
  };
}

Here is our solution to add markup to the view title:

function my_module_views_post_render(ViewExecutable $view, array &$output, CachePluginBase $cache) {
  $output['#post_render'][] = function ($content, array &$element) {
    $element['#title']['#markup'] = 'test - <b>My new Title</b>';
    return $content;
  };
}

Tested on Drupal 10.2.7.

Source Link
mably
  • 11
  • 2

Here is our solution to add markup to the view title:

function my_module_views_post_render(ViewExecutable $view, array &$output, CachePluginBase $cache) {
  $output['#post_render'][] = function ($content, array &$element) {
    $element['#title']['#markup'] = 'test - <b>My new Title</b>';
    return $content;
  };
}