Skip to content
Snippets Groups Projects

Add $options['number_path'] as AND condition to display numbers in headings

Open Sven Schüring requested to merge issue/toc_api-3511348:3511348-should-the-option into 2.0.x
1 file
+ 1
1
Compare changes
  • Side-by-side
  • Inline
+ 1
1
@@ -73,7 +73,7 @@ function template_preprocess_toc_header(&$variables) {
$options = $toc->getOptions();
$variables['options'] = $options;
$variables['header_options'] = $options['headers'][$item['tag']];
$variables['header_options']['display_number'] = in_array($variables['header_options']['number_type'], ['decimal', 'lower-alpha', 'upper-alpha', 'lower-roman', 'upper-roman']);
$variables['header_options']['display_number'] = $options['number_path'] && in_array($variables['header_options']['number_type'], ['decimal', 'lower-alpha', 'upper-alpha', 'lower-roman', 'upper-roman']);
$variables['attributes']['id'] = $variables['id'];
$variables['attributes'] = new Attribute($variables['attributes']);
Loading