Keyword

Show Author, related items and tags on the right

  • webloesung
  • webloesung's Avatar Topic Author
  • Offline
  • Junior Member
More
10 years 11 months ago #120116 by webloesung
Hello!
does anyone has an experience how to restructure the K2 item page. For example to show the K2 article AUTHOR, ADDITIONAL Fields, set Tags in the another module on the page (for example on the right side in model "right"?
Thank you for any experience (also negative experience with such similar "rebuilt" :)

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 #120117 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Show Author, related items and tags on the right
You need to read this tutorial on how to override the K2 template files.
getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates

The elements you are looking for are located in the item.php file. You can align them to the right using CSS but since this is a component view you cannot place them inside modules.

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

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

  • webloesung
  • webloesung's Avatar Topic Author
  • Offline
  • Junior Member
More
10 years 11 months ago #120118 by webloesung
I was thinking if this is somehow possible to create a module with own code, place it to the position right and to be shown on specific K2 category only. The code within the module to be smth like:
<?php if($this->item->author->name;): ?>
<?php if($this->item->params->get('itemAuthorLatest') && empty($this->item->created_by_alias) && isset($this->authorLatestItems)): ?>
  <!-- Latest items from author -->
	<div class="itemAuthorLatest">
		<h3><?php echo JText::_('K2_LATEST_FROM'); ?> <?php echo $this->item->author->name; ?></h3>
		<ul>
			<?php foreach($this->authorLatestItems as $key=>$item): ?>
			<li class="<?php echo ($key%2) ? "odd" : "even"; ?>">
				<a href="<?php echo $item->link ?>"><?php echo $item->title; ?></a>
			</li>
			<?php endforeach; ?>
		</ul>
		<div class="clr"></div>
	</div>
	<?php endif; ?>
<?php endif; ?>

?

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 #120119 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Show Author, related items and tags on the right
Unfortunately this is not possible,
This code can only run within the item.php file

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

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

More
10 years 11 months ago #120120 by informaticien51
Replied by informaticien51 on topic Re: Show Author, related items and tags on the right
create a k2 content module instance to the right.
In the K2 content settings set the infos that should appear.
And hide them in the catégory that is shown on the main content.

Or try to create a subtemplate with your code inside the K2 content module if it doesnt work.

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


Powered by Kunena Forum