- Posts: 80
COMMUNITY FORUM
Item image link working on home, but not in category
- Chris Hogan
- Topic Author
- Offline
- Premium Member
Less
More
5 years 9 months ago #171271
by Chris Hogan
Item image link working on home, but not in category was created by Chris Hogan
Hi there,
I have a small issue with an 'Items Intro Image' not being clickable/linkable to the full story.
The images are clickable and link to the story on my Homepage, but it does not work in a separate category view??
In the past, I did ask about removing the linkability on images (so my Members content was locked) see post below:
www.joomlaworks.net/forum/k2-en/37670-solved-premium-content-items-invisible-if-not-logged-in?start=60
But it looks like my item.php in the >components/com_k2/templates/default folder has the standard code.
The question is there an option in the Joomla/K2 backend to enabled...or do I need to add/or remove some code from the item file?
Regards!
I have a small issue with an 'Items Intro Image' not being clickable/linkable to the full story.
The images are clickable and link to the story on my Homepage, but it does not work in a separate category view??
In the past, I did ask about removing the linkability on images (so my Members content was locked) see post below:
www.joomlaworks.net/forum/k2-en/37670-solved-premium-content-items-invisible-if-not-logged-in?start=60
But it looks like my item.php in the >components/com_k2/templates/default folder has the standard code.
The question is there an option in the Joomla/K2 backend to enabled...or do I need to add/or remove some code from the item file?
Regards!
Please Log in or Create an account to join the conversation.
- JoomlaWorks
- Offline
- Admin
Less
More
- Posts: 6218
5 years 9 months ago #171278
by JoomlaWorks
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by JoomlaWorks on topic Item image link working on home, but not in category
This means that your category_item.php is missing some code. Simply compare it to the source file in /components/com_k2/templates/default/.
The reason we may have locked your older post is because of spammers who get a kick out of commenting on old posts as if they thing we won't see them...
The reason we may have locked your older post is because of spammers who get a kick out of commenting on old posts as if they thing we won't see them...
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Chris Hogan
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 80
5 years 9 months ago - 5 years 9 months ago #171282
by Chris Hogan
Replied by Chris Hogan on topic Item image link working on home, but not in category
Hi there,
Just had a look at what I believe to be the correct bits of code...and the two different parts from each file are below:
I have tried to test different parts of the code from the item.php in the category_item.php, but I can't seem to get the same results on a categories page?
Item.php:
Category_item.php:
Any advise is welcome!
Just had a look at what I believe to be the correct bits of code...and the two different parts from each file are below:
I have tried to test different parts of the code from the item.php in the category_item.php, but I can't seem to get the same results on a categories page?
Item.php:
<!-- Item Image -->
<div class="itemImageBlock">
<span class="itemImage">
<a data-k2-modal="image" href="<?php echo $this->item->imageXLarge; ?>" title="<?php echo JText::_('K2_CLICK_TO_PREVIEW_IMAGE'); ?>">
<img src="<?php echo $this->item->image; ?>" alt="<?php if(!empty($this->item->image_caption)) echo K2HelperUtilities::cleanHtml($this->item->image_caption); else echo K2HelperUtilities::cleanHtml($this->item->title); ?>" style="width:<?php echo $this->item->imageWidth; ?>px; height:auto;" />
</a>
</span>
Category_item.php:
<!-- Item Image -->
<div class="catItemImageBlock">
<span class="catItemImage">
<a href="<?php echo $this->item->link; ?>" title="<?php if(!empty($this->item->image_caption)) echo K2HelperUtilities::cleanHtml($this->item->image_caption); else echo K2HelperUtilities::cleanHtml($this->item->title); ?>">
<img src="<?php echo $this->item->image; ?>" alt="<?php if(!empty($this->item->image_caption)) echo K2HelperUtilities::cleanHtml($this->item->image_caption); else echo K2HelperUtilities::cleanHtml($this->item->title); ?>" style="width:<?php echo $this->item->imageWidth; ?>px; height:auto;" />
</a>
</span>
Any advise is welcome!
Last edit: 5 years 9 months ago by Chris Hogan.
Please Log in or Create an account to join the conversation.
- JoomlaWorks
- Offline
- Admin
Less
More
- Posts: 6218
5 years 9 months ago #171283
by JoomlaWorks
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by JoomlaWorks on topic Item image link working on home, but not in category
The image HTML from item.php does not have the item link on it, rather a link to a larger version of the image.
The image HTML though in category_item.php does have the link to the item on it (<?php echo $this->item->link; ?>).
The file item.php is loaded in the item view while category_item.php is loaded as a subtemplate for each item rendered in the itemlist (category.php) view.
The image HTML though in category_item.php does have the link to the item on it (<?php echo $this->item->link; ?>).
The file item.php is loaded in the item view while category_item.php is loaded as a subtemplate for each item rendered in the itemlist (category.php) view.
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.