Anzeige von Displaynamen statt IDs eingefügt

This commit is contained in:
Matthias Grief
2024-11-17 19:01:14 +01:00
parent 8429bdec0f
commit b2119a2287
4 changed files with 17 additions and 7 deletions

View File

@@ -373,11 +373,16 @@ if(!isset($topicData)) {
<h3>Verwandte Themen</h3>
<div style="display: flex; flex-wrap: wrap; gap: 0.5rem;">
<?php
foreach ($topicData->relatedTopics as $relatedTopic) {
foreach ($topicData->relatedTopics as $relatedTopicName) {
$relatedTopic = $subjectData->topics[$relatedTopicName];
if(!isset($relatedTopic)) {
continue;
}
?>
<a href='<?php echo("topic.php?subject=$subjectData->id&topic=$relatedTopic") ?>'>
<span class="topic-tag"><?php echo($relatedTopic); ?></span>
<a href='<?php echo("topic.php?subject=$subjectData->id&topic=$relatedTopic->id") ?>'>
<span class="topic-tag"><?php echo($relatedTopic->displayName); ?></span>
</a>
<?php