From 993056189cc1734594949b3edd6bfcff15d2788e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Helmut=20Schottm=C3=BCller?= Date: Fri, 22 Jul 2022 11:32:34 +0200 Subject: [PATCH] Extended tags_used insert tag with a parameter that will be printed when tags are used --- classes/TagHelper.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/classes/TagHelper.php b/classes/TagHelper.php index c6d702b..0d57b01 100644 --- a/classes/TagHelper.php +++ b/classes/TagHelper.php @@ -252,6 +252,22 @@ public function replaceTagInsertTags($strTag) $target = (count($elements) > 4) ? $elements[4] : 0; switch ($elements[0]) { + case 'tags_used': + $headlinetags = array(); + $relatedlist = (strlen(\TagHelper::decode(\Input::get('related')))) ? preg_split("/,/", \TagHelper::decode(\Input::get('related'))) : array(); + if (strlen(\TagHelper::decode(\Input::get('tag')))) + { + $headlinetags = array_merge($headlinetags, array($this->Input->get('tag'))); + if (count($relatedlist)) + { + $headlinetags = array_merge($headlinetags, $relatedlist); + } + } + if (count($headlinetags)) + { + return $elements[1]; + } + break; case 'tags_news': return $this->getTagsForTableAndId('tl_news', $elements[1], false, $max_tags, $relevance, $target); break;