Keyword

Module K2 Content detect same item?

  • buntom
  • buntom's Avatar Topic Author
  • Offline
  • New Member
More
9 years 1 month ago #147650 by buntom
Module K2 Content detect same item? was created by buntom
Hello,

I'm using module k2 content for display content lists for category
but I've problem with listing

for example brwose (item id 2) and mod k2 content show other items from same category
and my problem here
the (item id 2) is also list with other items from category
how make if module list items from category did'nt display same item?

just like author latest items that didn't display current item

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 1 month ago #147655 by Krikor Boghossian
Replied by Krikor Boghossian on topic Module K2 Content detect same item?
Unfortunately this is not possible with the K2 Content module.
The x latest items (or the ones you set) will always be displayed, regardless of which item you are browsing.

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

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

  • buntom
  • buntom's Avatar Topic Author
  • Offline
  • New Member
More
9 years 1 month ago - 9 years 1 month ago #147660 by buntom
Replied by buntom on topic Module K2 Content detect same item?
author latest items didn't display current browsing item
how this works?
Last edit: 9 years 1 month ago by buntom.

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

  • buntom
  • buntom's Avatar Topic Author
  • Offline
  • New Member
More
9 years 1 month ago #147662 by buntom
Replied by buntom on topic Module K2 Content detect same item?
hello Krikor
I've just found some solutions

get current item id
$K2Itemid = JRequest::getInt('id');
$db = JFactory::getDBO();
$db->setQuery("SELECT title FROM #__k2_items WHERE id = ".$K2Itemid );
$K2Catid = $db->loadResult(); 

whether id's not equall print content
<?php if( $item->id != $K2Itemid ): ?>
... your customization here
 <?php endif ?>

but the problem if id equal then
escape the loop and didn't get next loop to replace of escaped loop

do you have any idea to make loop continues?

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 1 month ago #147664 by Krikor Boghossian
Replied by Krikor Boghossian on topic Module K2 Content detect same item?
Can you paste your entire code in a gist or sth similar?

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

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

  • buntom
  • buntom's Avatar Topic Author
  • Offline
  • New Member
More
9 years 1 month ago #147686 by buntom

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 1 month ago #147707 by Krikor Boghossian
Replied by Krikor Boghossian on topic Module K2 Content detect same item?
I played around with it a bit, let me know if that helps:
gist.github.com/kricore/1e7ecf5ffdad017e547c

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

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

  • buntom
  • buntom's Avatar Topic Author
  • Offline
  • New Member
More
9 years 1 month ago - 9 years 1 month ago #147761 by buntom
Replied by buntom on topic Module K2 Content detect same item?
Hello Krikor,

I'm just replaced your edited codes with my own, but same and show current item

for example we have BLOG category
and we have 5 items in blog cat

make module get items from blog category and limit Item count to 4 items, why?

because when you browse one of this 5 items module should have display rest 4 items
if 3 items mean didn't done yet.

thanks again.
Last edit: 9 years 1 month ago by buntom.

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


Powered by Kunena Forum