Keyword

How to disable linking illustration in K2

  • Jarosław Stadnik
  • Jarosław Stadnik's Avatar Topic Author
  • Offline
  • New Member
More
10 years 7 months ago #124845 by Jarosław Stadnik
How to disable linking illustration in K2 was created by Jarosław Stadnik
Hi, Please write me how to turn off Linked illustration of review articles in kompnencie K2? I would like to not be able to by clicking on the images given eg in the review article go to this article. I wish this feature was disabled for all articles in the review.

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

  • Yiota
  • Yiota's Avatar
  • Visitor
10 years 7 months ago #124846 by Yiota
K2 doesn't have by default any review link mechanism. Do you use an addon for this or extra fields?

A link to your item page would be helpful.

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

  • Jarosław Stadnik
  • Jarosław Stadnik's Avatar Topic Author
  • Offline
  • New Member
More
10 years 7 months ago #124847 by Jarosław Stadnik
Replied by Jarosław Stadnik on topic Re: How to disable linking illustration in K2
The case relates to this page homa.vdl.pl/en/agnihotra-en
I marked with a red frame in the screenshot keranowym I would like to turn off images on the page linking. I wish that each illustration from the article was globally disabled its automatic linking to the article. How to do it in code component?

Link do screanshot: www.florida.js-studio.pl/1.jpg

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

  • Yiota
  • Yiota's Avatar
  • Visitor
10 years 7 months ago #124848 by Yiota
So you don't want your category's listing item image to link to the item itself, right?

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

  • Jarosław Stadnik
  • Jarosław Stadnik's Avatar Topic Author
  • Offline
  • New Member
More
10 years 7 months ago #124849 by Jarosław Stadnik
Replied by Jarosław Stadnik on topic Re: How to disable linking illustration in K2
Yes

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

  • Yiota
  • Yiota's Avatar
  • Visitor
10 years 7 months ago #124850 by Yiota
OK.
First you need to check if you have K2 template overrides. Check in templates/your_template/html/ folder path if you have a folder named com_k2. If you do just ignore the Step1 below.

Step1. Create K2 template overrides. Read here: getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates how to do so.
Step2. Open category_item.php file and locate the following block of code
<?php if($this->item->params->get('catItemImage') && !empty($this->item->image)): ?>
    <!-- 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>
      <div class="clr"></div>
    </div>
    <?php endif; ?>

You just need to replace it with this one:
<?php if($this->item->params->get('catItemImage') && !empty($this->item->image)): ?>
    <!-- Item Image -->
    <div class="catItemImageBlock">
      <span class="catItemImage">        
          <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;" />       
      </span>
      <div class="clr"></div>
    </div>
    <?php endif; ?>

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

  • Jarosław Stadnik
  • Jarosław Stadnik's Avatar Topic Author
  • Offline
  • New Member
More
10 years 7 months ago #124851 by Jarosław Stadnik
Replied by Jarosław Stadnik on topic Re: How to disable linking illustration in K2
That's it. Thank you very much.

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

  • Yiota
  • Yiota's Avatar
  • Visitor
10 years 7 months ago #124852 by Yiota
You are welcome.

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


Powered by Kunena Forum