Skip to content

Commit 5ead018

Browse files
committed
BREAKING. Type Tag: leaving page empty now refers to current page
Instead of assuming a page named after the field, an empty "page" configuration now always refers to the "current" page. Eg. the page on which the tag is rendered. A tag without a configured aggregation page will always link to the same page. When shown in the page data, such a tag can not be easily looked up anymore. OTOH it can be much easier be used in several aggregations.
1 parent dc2a4c3 commit 5ead018

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

types/Tag.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@ class Tag extends AbstractMultiBaseType
2626
*/
2727
public function renderValue($value, \Doku_Renderer $R, $mode)
2828
{
29+
global $INFO;
30+
2931
$context = $this->getContext();
3032
$filter = SearchConfigParameters::$PARAM_FILTER .
3133
'[' . $context->getTable() . '.' . $context->getLabel() . '*~]=' . $value;
3234

3335
$page = trim($this->config['page']);
34-
if (!$page) $page = cleanID($context->getLabel());
36+
if (!$page) $page = $INFO['id'];
3537

3638
$R->internallink($page . '?' . $filter, $value);
3739
return true;

0 commit comments

Comments
 (0)