Keyword

Related items by tag on item view

  • Goble002
  • Goble002's Avatar Topic Author
  • Offline
  • Premium Member
More
3 years 6 months ago #178873 by Goble002
Related items by tag on item view was created by Goble002
Hello,

Example:
On item page: I show 5 related items. I have 40 items in all. 20 of them are tagged "hotel". 2 of them are tagged "hotel" + "pool".

In item view for one of these 2 items I would expect, the 2nd one (also tagged as "hotel" + "pool") would show up first since they are more related than the 18 others. But it seems that it's not how k2 behaves.

Among the 5 related items, it will show up those tagged "hotels". Is there any work around to display items which are more related first ?

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

More
3 years 6 months ago #178878 by JoomlaWorks
Replied by JoomlaWorks on topic Related items by tag on item view
K2 searches for related items based on the tags of the item you're viewing. Once the items are matched, we fetch their data and sort them by ID (descending). This means that newer items will show up first rather than items that match more tags. This makes sense especially on media sites where you wish to show the most recent "relevant" (by tag) items.

The code to explore is here: github.com/getk2/k2/blob/master/components/com_k2/models/itemlist.php#L599

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • Goble002
  • Goble002's Avatar Topic Author
  • Offline
  • Premium Member
More
3 years 6 months ago #178885 by Goble002
Replied by Goble002 on topic Related items by tag on item view
Hi Fotis,

thanks, I got your point.

For newer items, I could make use of "show items by same Author" and sort by latest IDs.

I'm making use of K2 import to mass import my 300+ items (about 100+ per month on continuous basis). 200+ of them have the tag "4K download" for example. Then I have a menu item which is named "4k downloads" which will show up these 200+ items.

So to get back to my item with "pool", "hotel" & "4K download" tags, the related items will be the latest among these 200+ and won't care about the 2nd item with also "pool", "hotel" & "4K download" tags.

This is driving me nuts since all my site structure is based on show items by tags so I rely on tags.

Any workaround to change the codes to look for at least 2 common tags before being output in 'related items by tags' ?

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

More
3 years 6 months ago #178906 by JoomlaWorks
Replied by JoomlaWorks on topic Related items by tag on item view
Everything is possible but it's really beyond the scope of this support forum.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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


Powered by Kunena Forum