COMMUNITY FORUM
Image Caption/Credits in all views, (Tag &Catergory)
- Daily Deals UK
- Topic Author
- Offline
- Junior Member
Less
More
7 years 11 months ago #158446
by Daily Deals UK
Image Caption/Credits in all views, (Tag &Catergory) was created 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.
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
- Offline
- Platinum Member
Less
More
- Posts: 15920
7 years 11 months ago #158485
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
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
This should be used for the tag.php and user.php files.
You can use span elements in order to apply styling.
PS. Do not forget to use overrides.
getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates
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
- Topic Author
- Offline
- Junior Member
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?
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
- Offline
- Platinum Member
Less
More
- Posts: 15920
7 years 11 months ago #158499
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
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.
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
- Topic Author
- Offline
- Junior Member
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
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
- Offline
- Platinum Member
Less
More
- Posts: 15920
7 years 11 months ago #158509
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
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.