Keyword

Change order K2 additional field and video

  • Wolfje
  • Wolfje's Avatar Topic Author
  • Offline
  • New Member
More
10 years 11 months ago #119968 by Wolfje
Hello,

Is there a solution to change the order of K2 "fields".

Now its:
- article,
- additional fields,
- mare articles made by,
- similar as,
- media.

But I want media right under the article and followed by additional fields.

I hope you understand what I am saying. Thank you.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 11 months ago #119969 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Change order K2 additional field and video
You need to edit the item.php file of your template.

the code for the video should look like this
<?php if($this->item->params->get('itemVideo') && !empty($this->item->video)): ?>
  <!-- Item video -->
  <a name="itemVideoAnchor" id="itemVideoAnchor"></a>

  <div class="itemVideoBlock">
  	<h3><?php echo JText::_('K2_MEDIA'); ?></h3>

		<?php if($this->item->videoType=='embedded'): ?>
		<div class="itemVideoEmbedded">
			<?php echo $this->item->video; ?>
		</div>
		<?php else: ?>
		<span class="itemVideo"><?php echo $this->item->video; ?></span>
		<?php endif; ?>

	  <?php if($this->item->params->get('itemVideoCaption') && !empty($this->item->video_caption)): ?>
	  <span class="itemVideoCaption"><?php echo $this->item->video_caption; ?></span>
	  <?php endif; ?>

	  <?php if($this->item->params->get('itemVideoCredits') && !empty($this->item->video_credits)): ?>
	  <span class="itemVideoCredits"><?php echo $this->item->video_credits; ?></span>
	  <?php endif; ?>

	  <div class="clr"></div>
  </div>
  <?php endif; ?>

Simply cut and paste this block where you want it to appear. In your case bellow the introtext.

Hint: The comments will help you.

And finally a nice tutorial on overriding you should read before starting:
getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • Wolfje
  • Wolfje's Avatar Topic Author
  • Offline
  • New Member
More
10 years 11 months ago #119970 by Wolfje
Thank you, but what do you mean with:

You need to edit the item.php file of your template?

And when there is a update for K2 it will not affect item.php?

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 11 months ago #119971 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Change order K2 additional field and video
That's why you should override instead of edit core files.
The link I posted on my first post will help you.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • Wolfje
  • Wolfje's Avatar Topic Author
  • Offline
  • New Member
More
10 years 11 months ago #119972 by Wolfje
Weird,

Only if i put default from K2 into the templates section it already messing up my website...

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 11 months ago #119973 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Change order K2 additional field and video
Make sure that you are properly clearing (using a <div class="clr"></div>) your sections and you don't have any CSS conflicts.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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


Powered by Kunena Forum