How to disable link on image for K2 items ?

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Sun Dec 08, 2013 8:37 pm
Reply with quote
Report this post
Hello,

I know, probably this is out of scope of your support, but this should be quite easy to do, how can i disable the link to the item on K2 item image ?

Please check here http://projects.lexart.me/mocha/order I would like those items to be non clickable, now when you click on the image it goes to details view, I don't want this.

Please help.
Thanks!
User avatar
Senior Boarder

GK User
Sun Dec 08, 2013 10:31 pm
Reply with quote
Report this post
Hi.
Yes it's out of support - but it's quite easy.

File to edit: gk_creativity\html\com_k2\templates\default\category_item.php

Code: Select all
<div class="itemImageBlock"> <a class="itemImage" 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> </div>


There you will find <a class.... href=.... --- for images. For example replace "<?php echo $this->item->link; ?>" with "#" or ""
User avatar
Platinum Boarder

GK User
Mon Dec 09, 2013 9:58 am
Reply with quote
Report this post
Pawel F wrote:Hi.
Yes it's out of support - but it's quite easy.

File to edit: gk_creativity\html\com_k2\templates\default\category_item.php

Code: Select all
<div class="itemImageBlock"> <a class="itemImage" 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> </div>


There you will find <a class.... href=.... --- for images. For example replace "<?php echo $this->item->link; ?>" with "#" or ""

Great! Thank you very much.
User avatar
Senior Boarder

GK User
Thu Jul 03, 2014 5:43 pm
Reply with quote
Report this post
Useful post. I was trying to figure out the same thing and I thought its probably a setting for K2 item in back-end. Now I know I need to edit the template directly for it. Thanks for confirming that @Pawel F .

Cheers!
User avatar
Senior Boarder


cron