Keyword

[SOLVED] alphabetical ordered tags in item.php

More
10 years 9 months ago #122974 by Monia
hallo, i need a little help: is it possible in some automatic way to put in alphabetical ored the tags already inserted in k2?
and also, is it possible to put an embedded video in the top of a k2 item, instead at bottom?

Please Log in or Create an account to join the conversation.

  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Developer
More
10 years 9 months ago #122975 by Mohamed Abdelaziz
Replied by Mohamed Abdelaziz on topic Re: help!
Yes, it is possible by modifying the item.php file, it is recommended to override the template at first.

The find the item.php and edit it, to order the tags alphabetically, use this code:
<?php arsort($this->item->tags); ?>

This should be before this line:
<?php foreach ($this->item->tags as $tag): ?>


And for the video, this is the code which displays the video
<?php if($this->item->params->get('itemRelatedMedia')): ?>
				<?php if($item->videoType=='embedded'): ?>
				<div class="itemRelMediaEmbedded"><?php echo $item->video; ?></div>
				<?php else: ?>
				<div class="itemRelMedia"><?php echo $item->video; ?></div>
				<?php endif; ?>
				<?php endif; ?>

You can move it wherever you need in the item.php file

Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum