-
AuthorPosts
-
April 8, 2014 at 8:42 pm #196576
I’m curently developping a website with k2 item geolocalisation. I’m using sw k2 maps as plugin.
This plugin works well with category and tags views but is not present on search made with JA K2 SEARCH
I’ve activated the k2 plugins into the JA K2 Search options; but without any result.
Does anybody have an idea ??
Thanks a lot !
joe
Thanh Nguyen Viet FriendThanh Nguyen Viet
- Join date:
- September 2014
- Posts:
- 1461
- Downloads:
- 0
- Uploads:
- 44
- Thanked:
- 258 times in 217 posts
April 10, 2014 at 3:20 am #530230Hi Joe,
This issue occured because K2 does not check the setting when turning on/off K2 plugins on search view. To fix this, please open the /components/com_k2/models/item.php file:
Replace this code snippet:
[PHP]if (($view == ‘item’ && $item->params->get(‘itemK2Plugins’)) || ($view == ‘itemlist’ && ($task == ” || $task == ‘category’) && $item->params->get(‘catItemK2Plugins’)) || ($view == ‘itemlist’ && $task == ‘user’ && $item->params->get(‘userItemK2Plugins’)) || ($view == ‘itemlist’ && ($task == ‘search’ || $task == ‘tag’ || $task == ‘date’)))[/PHP]With:
[PHP]if (($view == ‘item’ && $item->params->get(‘itemK2Plugins’)) || ($view == ‘itemlist’ && ($task == ” || $task == ‘category’) && $item->params->get(‘catItemK2Plugins’)) || ($view == ‘itemlist’ && $task == ‘user’ && $item->params->get(‘userItemK2Plugins’)) || ($view == ‘itemlist’ && $item->params->get(‘catItemK2Plugins’) && ($task == ‘search’ || $task == ‘tag’ || $task == ‘date’)))[/PHP]April 13, 2014 at 8:09 pm #530726thanks for your reply, but this trick does not seems to resolve the issue.
I’ve set a “print” into the “/components/com_k2/models/item.php” file to check if the process enter in the “if” and It enters well now with the code modification you give, but the map is not displayed as attended.
I works well with category view and tag view. but not in search view.
after some other research I get this post : http://styleware.eu/forum/Google-maps-Extensions/5513-Plugin-not-loading-on-category-view
I seems that the sw k2 maps is not compatible with ja filter..
It seems you don’t use the k2 itemlist model but another one.in fact in they code, they use this :
[PHP] $model = new K2ModelItemList();
$count = $model->getTotal();
[/PHP]The result when using a search with ja filter is always 0 !
may be do you have a trick to make your plugin compatible ?
thanks
Thanh Nguyen Viet FriendThanh Nguyen Viet
- Join date:
- September 2014
- Posts:
- 1461
- Downloads:
- 0
- Uploads:
- 44
- Thanked:
- 258 times in 217 posts
April 14, 2014 at 2:17 am #530740Please PM me your Administrator and FTP credentials, I will help to debug and give you suggestion then.
April 15, 2014 at 8:22 pm #531022thank you !
I’ve contacted the developpers of sw k2 maps and they modify their plugin to be compatible with yours ! So all is fine for me !
if anybody encount the same problem, try to change this line in the swmap.php file
[PHP]$model = new K2ModelItemList();[/PHP]
with
[PHP]if(class_exists(“JAK2FilterModelItemlist”)){
$model = new JAK2FilterModelItemlist();
}else{
$model = new K2ModelItemList();
}[/PHP]joe
-
AuthorPosts
This topic contains 5 replies, has 2 voices, and was last updated by labbyjoel 10 years, 7 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum