Keyword

Item image link working on home, but not in category

  • Chris Hogan
  • Chris Hogan's Avatar Topic Author
  • Offline
  • Senior Member
More
3 months 2 days ago #171271 by Chris Hogan
Chris Hogan created the topic: Item image link working on home, but not in category
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!

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

  • Fotis
  • Fotis's Avatar
  • Away
  • Administrator
  • JoomlaWorks Support Team
More
3 months 2 days ago #171278 by Fotis
Fotis replied the 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...


If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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

  • Chris Hogan
  • Chris Hogan's Avatar Topic Author
  • Offline
  • Senior Member
More
3 months 2 days ago - 3 months 2 days ago #171282 by Chris Hogan
Chris Hogan replied the 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:
<!-- 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: 3 months 2 days ago by Chris Hogan.

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

  • Fotis
  • Fotis's Avatar
  • Away
  • Administrator
  • JoomlaWorks Support Team
More
3 months 2 days ago #171283 by Fotis
Fotis replied the 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.


If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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

Moderators: william white

Powered by Kunena Forum