Keyword

Image Caption/Credits in all views, (Tag &Catergory)

  • Daily Deals UK
  • Daily Deals UK's Avatar Topic Author
  • Offline
  • Junior Member
More
7 years 11 months ago #158446 by Daily Deals UK
Me again, apologies for the barrage of questions!

The image item credits and captions only show in the item view. I need them to show in all views.

Thanks again.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 11 months ago #158485 by Krikor Boghossian
Replied by Krikor Boghossian on topic Image Caption/Credits in all views, (Tag &Catergory)
Hello,

This code will generate the caption and credits in the category_item.php file
  <?php if(!empty($this->item->image_caption)) echo K2HelperUtilities::cleanHtml($this->item->image_caption); ?>
	  <?php if(!empty($this->item->image_credits)) echo $this->item->image_credits; ?></span>

This should be used for the tag.php and user.php files.
You can use span elements in order to apply styling.
<?php if(!empty($item->image_caption)) echo K2HelperUtilities::cleanHtml($item->image_caption); ?>
<?php if(!empty($item->image_credits)) echo $item->image_credits; ?></span>

PS. Do not forget to use overrides.
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.

  • Daily Deals UK
  • Daily Deals UK's Avatar Topic Author
  • Offline
  • Junior Member
More
7 years 11 months ago #158488 by Daily Deals UK
Replied by Daily Deals UK on topic Image Caption/Credits in all views, (Tag &Catergory)
Hi thanks for the help

Firstly it works in tag.php but not in category-item.php

in tag.php I put this in:

<span class="itemImageCaption"><?php echo $this->item->image_caption; ?>
<?php if(!empty($item->image_caption)) echo K2HelperUtilities::cleanHtml($item->image_caption); ?>
<?php if(!empty($item->image_credits)) echo $item->image_credits; ?></span>

To apply the styles but that wouldn't work have I done it wrong?

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 11 months ago #158499 by Krikor Boghossian
Replied by Krikor Boghossian on topic Image Caption/Credits in all views, (Tag &Catergory)
<?php echo $this->item->image_caption; ?>
This will cause an issue since $item is being used in that view.

The code I sent you does not have any styling whatsoever, you need to add the classes manually.

<span class="itemImageCaption">
and

<span class="itemImageCredits"> most likely will do the trick.

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

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

  • Daily Deals UK
  • Daily Deals UK's Avatar Topic Author
  • Offline
  • Junior Member
More
7 years 11 months ago - 7 years 11 months ago #158501 by Daily Deals UK
Replied by Daily Deals UK on topic Image Caption/Credits in all views, (Tag &Catergory)
I got it

Thank you so much
Last edit: 7 years 11 months ago by Daily Deals UK.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 11 months ago #158509 by Krikor Boghossian
Replied by Krikor Boghossian on topic Image Caption/Credits in all views, (Tag &Catergory)
You 're welcome :)

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