Keyword

Category item view: linkable anywhere

  • Saulius
  • Saulius's Avatar Topic Author
  • Offline
  • Junior Member
More
13 years 4 months ago #96668 by Saulius
Category item view: linkable anywhere was created by Saulius
Hey, everyone @ K2 community!

 

Here's the deal: I'm almost finished building a vehicle rent site using the amazing K2 content management system. Almost everything is done, however when in category item view (right HERE) where photo and extra fields a shown, if I want to go inside an item I have to click either on item name or a photo. What about clicking anywhere? I mean, I would like to be able to get inside an item when clicked not only on item name or photo, but on extra fields or on any white space there. I hope you get the point :) How can that be done?

 

Thanks in advance!

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

  • Yiota
  • Yiota's Avatar
  • Visitor
13 years 4 months ago #96669 by Yiota
Replied by Yiota on topic Category item view: linkable anywhere
You can try modifying the category_item.php and change this <div class="catItemView groupLeading"> with an <a> element, keeping the same classes and using the item link. You will probably have to change some CSS rules as well.

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

  • Saulius
  • Saulius's Avatar Topic Author
  • Offline
  • Junior Member
More
13 years 4 months ago #96670 by Saulius
Replied by Saulius on topic Category item view: linkable anywhere
Hmm.....Yiota, could you be more specific with this? As I don't seem to understand this code thing as good as you do. Let's take for example the image which is linkable. In category_item.php I have 

<span class="catItemImage">    <a href="<?php echo $this->item->link; ?>" title="<?php if(!empty($this->item->image_caption)) echo $this->item->image_caption; else echo $this->item->title; ?>">     <img src="<?php echo $this->item->image; ?>" alt="<?php if(!empty($this->item->image_caption)) echo $this->item->image_caption; else echo $this->item->title; ?>" style="width:<?php echo $this->item->imageWidth; ?>px; height:auto;" />    </a>  </span>  <div class="clr"></div>  </div>

The code starting with <a href=....> and ending with (what?) seems to be the one linking to and item view, right?

While you suggest modifying "catItemView groupLeading" I can only find "<div class="catItemView group" without "Leading"  (?) in category_item.php. 

Yiota, what exactly should I modify and how to get the result? I'm adding my category_item.php file here in case you would like to check that out.

 

Thanks in advance ;)

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

  • Yiota
  • Yiota's Avatar
  • Visitor
13 years 4 months ago #96671 by Yiota
Replied by Yiota on topic Category item view: linkable anywhere
First of all I removed a couple of <a> elements as they just opened and never closed. Try this file. (I'm not sure it will work though, I've never tried it myself).

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

  • Saulius
  • Saulius's Avatar Topic Author
  • Offline
  • Junior Member
More
13 years 4 months ago #96672 by Saulius
Replied by Saulius on topic Category item view: linkable anywhere
Well, Yiota, I'm sorry but this doesn't seem to work :( I also tried following the code you modified letter by letter comparing to the old one trying to find what could have gone wrong, but it appears I lack knowledge. It's a shame...

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

  • Yiota
  • Yiota's Avatar
  • Visitor
13 years 4 months ago #96673 by Yiota
Replied by Yiota on topic Category item view: linkable anywhere
Too bad. Well it was worth a try :) If I have the time I might try it and let you know if it could be done somehow.

It seems that for now the link to the title and the image will have to suffice.

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

  • Saulius
  • Saulius's Avatar Topic Author
  • Offline
  • Junior Member
More
13 years 4 months ago #96674 by Saulius
Replied by Saulius on topic Category item view: linkable anywhere
Thanks, Yiota, for your time! It was worth a try for sure ;)

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


Powered by Kunena Forum