Last active
June 6, 2019 23:41
-
-
Save Yiannistaos/b5734e15e613eae4d0f2fe3102faeefb to your computer and use it in GitHub Desktop.
How to display the multiple categories at K2 User's page?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// BEGIN: Multiple Categories for K2, by Web357 | |
$w357_dispatcher = JDispatcher::getInstance(); | |
JPluginHelper::importPlugin('k2', 'k2multiplecategories'); | |
$k2multiplecategories = $w357_dispatcher->trigger('onK2AfterDisplayContentAdvanced', array($item)); | |
if (!empty($k2multiplecategories) && is_array($k2multiplecategories)): | |
?> | |
<!-- Item category name --> | |
<div class="userItemCategory"> | |
<span><?php echo JText::_('K2_PUBLISHED_IN'); ?></span> | |
<?php echo $k2multiplecategories[0]; ?> | |
</div> | |
<?php else: ?> | |
<!-- Item category name --> | |
<div class="userItemCategory"> | |
<span><?php echo JText::_('K2_PUBLISHED_IN'); ?></span> | |
<a href="/<?php echo $item->category->link; ?>"><?php echo $item->category->name; ?></a> | |
</div> | |
<?php endif; // END: Multiple Categories for K2, by Web357 ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://docs.web357.com/article/38-how-to-display-the-multiple-categories-at-k2-users-page