Skip to content

Commit

Permalink
Merge pull request #19 from Sioweb/master
Browse files Browse the repository at this point in the history
Hook for other addons
  • Loading branch information
hschottm authored Jul 27, 2017
2 parents a2f6606 + ad7f797 commit 8390751
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
10 changes: 10 additions & 0 deletions modules/ModuleTagListByCategory.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,16 @@ protected function compile()
$this->Template->articles = $this->getArticlesForArticleTags($tagid_cats[$sourcetable]);
$pages = array_merge($pages, $this->getPagesForArticleTags($tagid_cats[$sourcetable]));
break;
default:
if (isset($GLOBALS['TL_HOOKS']['tagSourceTable']) && is_array($GLOBALS['TL_HOOKS']['tagSourceTable'])) {
$arrTagTemplates = array();
foreach ($GLOBALS['TL_HOOKS']['tagSourceTable'] as $type => $callback) {
$this->import($callback[0]);
$arrTagTemplates = array_merge($arrTagTemplates,$this->$callback[0]->$callback[1]($sourcetable,$tagid_cats[$sourcetable]));
}
$this->Template->other_pages = $arrTagTemplates;
}
break;
}
}
$uniquepages = array();
Expand Down
16 changes: 13 additions & 3 deletions templates/modules/mod_tag_listbycategory.html5
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,19 @@
<h3><?php echo $this->lngPages; ?></h3>
<ul>
<?php foreach ($this->pages as $page): ?>
<li>
{{link::<?php echo $page['alias']; ?>}}
</li>
<li>
{{link::<?php echo $page['alias']; ?>}}
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<?php if (count($this->other_pages)): ?>
<h3><?php echo $this->lngOtherPages; ?></h3>
<ul>
<?php foreach ($this->other_pages as $url): ?>
<li>
<?php echo $url; ?>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
Expand Down
10 changes: 10 additions & 0 deletions templates/modules/mod_tag_listbycategory.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,14 @@
<?php endforeach; ?>
</ul>
<?php endif; ?>
<?php if (count($this->other_pages)): ?>
<h3><?php echo $this->lngOtherPages; ?></h3>
<ul>
<?php foreach ($this->other_pages as $url): ?>
<li>
<?php echo $url; ?>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</div>

0 comments on commit 8390751

Please sign in to comment.