Keyword

Moving the

  • Robbie Forsyth
  • Robbie Forsyth's Avatar Topic Author
  • Offline
  • New Member
More
11 years 1 month ago #117573 by Robbie Forsyth
Moving the was created by Robbie Forsyth
Hi guys,

I'm new to K2 and someone else installed it - so am just trying to become self sufficient. So apologies if this is very basic.

Here's an example of an article on our site: www.youthfootballscotland.co.uk/component/k2/item/7501-scotland-s-youngsters-cool-ahead-of-iceland-test

What I want to do is move the photo of the author (which will be accompanied by a short bio) to the top of the page. Just underneath the headline.

Any idea how I can do this?

Thanks a lot.

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

  • olsen
  • olsen's Avatar
  • Offline
  • Elite Member
  • Joomla and K2 Freelancer
More
11 years 1 month ago #117574 by olsen
Replied by olsen on topic Re: Moving the
Hi,
the file you should edit is components/com_k2/templates/default/item.php
Search this code:
  <?php if($this->item->params->get('itemAuthorBlock') && empty($this->item->created_by_alias)): ?>
  <!-- Author Block -->
  <div class="itemAuthorBlock">

  	<?php if($this->item->params->get('itemAuthorImage') && !empty($this->item->author->avatar)): ?>
  	<img class="itemAuthorAvatar" src="<?php echo $this->item->author->avatar; ?>" alt="<?php echo K2HelperUtilities::cleanHtml($this->item->author->name); ?>" />
  	<?php endif; ?>

    <div class="itemAuthorDetails">
      <h3 class="itemAuthorName">
      	<a rel="author" href="<?php echo $this->item->author->link; ?>"><?php echo $this->item->author->name; ?></a>
      </h3>

      <?php if($this->item->params->get('itemAuthorDescription') && !empty($this->item->author->profile->description)): ?>
      <p><?php echo $this->item->author->profile->description; ?></p>
      <?php endif; ?>

      <?php if($this->item->params->get('itemAuthorURL') && !empty($this->item->author->profile->url)): ?>
      <span class="itemAuthorUrl"><?php echo JText::_('K2_WEBSITE'); ?> <a rel="me" href="<?php echo $this->item->author->profile->url; ?>" target="_blank"><?php echo str_replace('http://','',$this->item->author->profile->url); ?></a></span>
      <?php endif; ?>

      <?php if($this->item->params->get('itemAuthorEmail')): ?>
      <span class="itemAuthorEmail"><?php echo JText::_('K2_EMAIL'); ?> <?php echo JHTML::_('Email.cloak', $this->item->author->email); ?></span>
      <?php endif; ?>

			<div class="clr"></div>

			<!-- K2 Plugins: K2UserDisplay -->
			<?php echo $this->item->event->K2UserDisplay; ?>

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

and place it on top just after the headline block:
	<div class="itemHeader">

		<?php if($this->item->params->get('itemDateCreated')): ?>
		<!-- Date created -->
		<span class="itemDateCreated">
			<?php echo JHTML::_('date', $this->item->created , JText::_('K2_DATE_FORMAT_LC2')); ?>
		</span>
		<?php endif; ?>

	  <?php if($this->item->params->get('itemTitle')): ?>
	  <!-- Item title -->
	  <h2 class="itemTitle">
			<?php if(isset($this->item->editLink)): ?>
			<!-- Item edit link -->
			<span class="itemEditLink">
				<a class="modal" rel="{handler:'iframe',size:{x:990,y:550}}" href="<?php echo $this->item->editLink; ?>">
					<?php echo JText::_('K2_EDIT_ITEM'); ?>
				</a>
			</span>
			<?php endif; ?>
			
	  	<?php echo $this->item->title; ?>

	  	<?php if($this->item->params->get('itemFeaturedNotice') && $this->item->featured): ?>
	  	<!-- Featured flag -->
	  	<span>
		  	<sup>
		  		<?php echo JText::_('K2_FEATURED'); ?>
		  	</sup>
	  	</span>
	  	<?php endif; ?>

	  </h2>
	  <?php endif; ?>

		<?php if($this->item->params->get('itemAuthor')): ?>
		<!-- Item Author -->
		<span class="itemAuthor">
			<?php echo K2HelperUtilities::writtenBy($this->item->author->profile->gender); ?>&nbsp;
			<?php if(empty($this->item->created_by_alias)): ?>
			<a rel="author" href="<?php echo $this->item->author->link; ?>"><?php echo $this->item->author->name; ?></a>
			<?php else: ?>
			<?php echo $this->item->author->name; ?>
			<?php endif; ?>
		</span>
		<?php endif; ?>

  </div>

Before do it make a template override. There is enough information about it at the documentation menu on this site.

Didn't solve your issues?? Why dont you consider hire me? Email me or contact me www.xevedigital.com for details

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

  • Robbie Forsyth
  • Robbie Forsyth's Avatar Topic Author
  • Offline
  • New Member
More
11 years 1 month ago #117575 by Robbie Forsyth
Replied by Robbie Forsyth on topic Re: Moving the
I tried looking at the template override documentation and was a little confused, so tried it without and it worked fine...

www.youthfootballscotland.co.uk/component/k2/item/7501-scotland-s-youngsters-cool-ahead-of-iceland-test

Any dangers I'm not seeing?

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
11 years 1 month ago #117576 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Moving the
Yes if you are editing core files withou overriding them (files in /components/com_k2/templates/ folders) you will lose all changes next time you update K2.

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

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

  • Robbie Forsyth
  • Robbie Forsyth's Avatar Topic Author
  • Offline
  • New Member
More
11 years 1 month ago #117577 by Robbie Forsyth
Replied by Robbie Forsyth on topic Re: Moving the
Oh OK - that's not a big deal, I've only changed one small bit of CSS so can easily do again. Thanks a lot.

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


Powered by Kunena Forum