Skip to content

Commit c2839eb

Browse files
committed
Inline rendering of aggregarion value
Fixes #674
1 parent 7a256bc commit c2839eb

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

meta/Aggregation.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ abstract class Aggregation
3030
/** @var int number of all results */
3131
protected $resultCount;
3232

33+
/** @var string usually a div, but AggregationValue needs to be wrapped in a span */
34+
protected $tagName = 'div';
35+
3336
/**
3437
* @todo we might be able to get rid of this helper and move this to SearchConfig
3538
* @var \helper_plugin_struct_config
@@ -123,7 +126,7 @@ public function startScope()
123126
$hash = $this->renderer->info['struct_table_hash'] ?? '';
124127
$id = $hash ? " id=\"$hash\" " : '';
125128

126-
$this->renderer->doc .= '<div ' . $id . 'class="' . implode(' ', $classes) . '">';
129+
$this->renderer->doc .= '<' . $this->tagName . $id . ' class="' . implode(' ', $classes) . '">';
127130
}
128131
}
129132

@@ -137,7 +140,7 @@ public function startScope()
137140
public function finishScope()
138141
{
139142
if ($this->mode == 'xhtml') {
140-
$this->renderer->doc .= '</div>';
143+
$this->renderer->doc .= '</' . $this->tagName . '>';
141144
}
142145
}
143146
}

meta/AggregationValue.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ public function __construct($id, $mode, \Doku_Renderer $renderer, SearchConfig $
2424
$searchConfig->setOffset(0);
2525

2626
parent::__construct($id, $mode, $renderer, $searchConfig);
27+
28+
$this->tagName = 'span';
2729
}
2830

2931
/**

0 commit comments

Comments
 (0)