Keyword

linking an item in one category within a second category

  • Josef Pospisil
  • Josef Pospisil's Avatar Topic Author
  • Offline
  • New Member
More
13 years 4 months ago #97078 by Josef Pospisil
Dear K2 Community,

 

i would like to have one item in two categories. But i know that this is not possible. So i thought i could create a normal item in one category and than i could create a second item in a second category. The second item in the second category would be completely empty and link to the first item in first category. But the problem is that i can't place a link within an item title to make a direct link. In my category listings there only the titles appears so i must place the link in the items title. Always when i try to add a link in the items title it ends up the link cut down just to words without all HTML Tags.

 

The main idea behind linking an item is to avoid double content because of Google. And to avoid the work of editing two items when they are in two categories.

 

I really need this to be possible because otherwise we can't use K2 and that would be a pitty because for me K2 is really the best CCK for Joomla. Is there any way to accomplish the above said? Even a hack would be nice.

 

thanks in advance

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

More
13 years 4 months ago #97079 by BBC
You can place a link and still have title name as you want.

Study a little bit how K2 category image works and change part that open Item (Clickable Title) to "Credits" or "Captions" of image. Then you can instead of that part that opens Item (clickable Title) put URL in images captions or credits field.

Doesn´t matter if you don´t show K2 images there you will have "empty" Items. It is still picked.

 

Other way i did it once was to use extra field "link", moved in code extra field to Title (disabled in settings Title completely), and used field link as Title and URL. With template override you can style field "Link" to look same as your other titles.

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

More
13 years 4 months ago #97080 by BBC
Yes, something else. Use a template override for categories. Otherways you distroy to much for whole K2.

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

More
13 years 4 months ago #97081 by BBC
<div class="catItemImageBlock"> <span class="catItemImage"> <a href="<?php if(!empty($this->item->image_caption)) echo $this->item->image_caption; else echo $this->item->link; ?>" target="_blank" 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>

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

More
13 years 4 months ago #97082 by BBC
This code works OK to pull URL (URL you paste) from Image´s "caption" filed, where you normally upload images.

Use something like this for your Titles. Same principle.

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

More
13 years 4 months ago #97083 by BBC
Just remove target="_blank". With it it opens in new window/tab.

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


Powered by Kunena Forum