-
AuthorPosts
-
November 22, 2012 at 11:56 am #182483
Hi,
Could someone tell me please how to exclude a K2 category from search results?
I have 2 categories (‘Vacancies’ and ‘Candidates’ ).
When using the dropboxes to perform the search all works correctly – only ‘Vacancy’ results appear – but when using a keyword all results appear – I only need to see ‘Vacancies’.
thanks in advance
rsystems Friendrsystems
- Join date:
- July 2012
- Posts:
- 118
- Downloads:
- 0
- Uploads:
- 7
- Thanks:
- 41
- Thanked:
- 7 times in 1 posts
November 23, 2012 at 8:43 am #474008Same issue here.
November 28, 2012 at 10:58 am #474527Can anyone assist? I had hoped there would be some level of support since this was a paid plugin.
rsystems Friendrsystems
- Join date:
- July 2012
- Posts:
- 118
- Downloads:
- 0
- Uploads:
- 7
- Thanks:
- 41
- Thanked:
- 7 times in 1 posts
November 28, 2012 at 11:31 am #474530Totally agree, I’m getting angry.
MoonSailor FriendMoonSailor
- Join date:
- November 2011
- Posts:
- 1106
- Downloads:
- 0
- Uploads:
- 245
- Thanks:
- 89
- Thanked:
- 248 times in 223 posts
November 29, 2012 at 8:56 am #474690Hi tjckelly, rsystems
For now, module can’t exclude a K2 category from all categories. It will show all categories of k2 component.
Regards
Arvind Chauhan ModeratorArvind Chauhan
- Join date:
- September 2014
- Posts:
- 3835
- Downloads:
- 74
- Uploads:
- 92
- Thanks:
- 1240
- Thanked:
- 1334 times in 848 posts
November 29, 2012 at 9:12 am #474694I have discussed with the devs and we will explore the possibility to add the option to select / multi-select categories to show in the frontend drop down.
I will get back to you with confirmation on this pretty soon.
Arvind
November 30, 2012 at 11:11 am #474827Appreciate the response, thank you.
I have been looking around some of the forums for other K2 searches and there are some examples of altering the php code as a workaround, for example:
”
if ($this->site) {
$where[] = ‘a.published = 1’;
$where[] = ‘a.trash = 0’;Now add this code immediately below:
$where[] = ‘NOT a.catid = 12’;
”I was wondering if I could do something similar in the meantime with the JAK2 search – but don’t know where to look to place the code – I’m not a programmer!
regards
Arvind Chauhan ModeratorArvind Chauhan
- Join date:
- September 2014
- Posts:
- 3835
- Downloads:
- 74
- Uploads:
- 92
- Thanks:
- 1240
- Thanked:
- 1334 times in 848 posts
Arvind Chauhan ModeratorArvind Chauhan
- Join date:
- September 2014
- Posts:
- 3835
- Downloads:
- 74
- Uploads:
- 92
- Thanks:
- 1240
- Thanked:
- 1334 times in 848 posts
December 4, 2012 at 9:10 am #475142The select / multiselect k2 categories feature will be part of the next version.
http://easycaptures.com/fs/uploaded/739/0073913373.png
hope to release soon. There are 2-3 more features in this version.
Regards
Arvind
rsystems Friendrsystems
- Join date:
- July 2012
- Posts:
- 118
- Downloads:
- 0
- Uploads:
- 7
- Thanks:
- 41
- Thanked:
- 7 times in 1 posts
December 6, 2012 at 9:30 am #475352Super, looking forward to update! 🙂
MoonSailor FriendMoonSailor
- Join date:
- November 2011
- Posts:
- 1106
- Downloads:
- 0
- Uploads:
- 245
- Thanks:
- 89
- Thanked:
- 248 times in 223 posts
December 8, 2012 at 2:20 pm #475553JA K2Filter version 1.0.2 has been released. There are changes in name of this component in this new version so, currently, it cannot be updated via JAEM, we shall try to fix this soon.
Please try to download and re-install this component again. More details of userguide for this component can be seen here: http://www.joomlart.com/forums/topic/userguide-ja-k2-filter-package-for-joomla-2-5-3-0/
Let me know if I can be of futher assistance.
Regards,
Luffy T.
2 users say Thank You to MoonSailor for this useful post
December 8, 2012 at 3:01 pm #475559Hi darvinDC,
I was serching something similar… and it comes perfectly in time. Good work.
I just reinstalled this brand new release: it works fine, but I’m confused about the expected working.
When I select the category search option in the frontend I correctly get the dropdown menu with my choosen categories, so I can search in my specific categories.
The unexpected is that for a blank search (all items) the module displays results for all categories and not only for the selected ones.
I think the categories you select in the backend should also restrict the default search…
Is there anything wrong in my installation?
How can I restrict my default search to specific categories?
Thank you very much.MoonSailor FriendMoonSailor
- Join date:
- November 2011
- Posts:
- 1106
- Downloads:
- 0
- Uploads:
- 245
- Thanks:
- 89
- Thanked:
- 248 times in 223 posts
December 10, 2012 at 2:04 am #475636Hi iway2011,
Please download and re-install new version of k2 filter here :
http://www.joomlart.com/forums/downloads.php?do=cat&id=20372
and follow the userguide: http://www.joomlart.com/forums/topic/userguide-ja-k2-filter-package-for-joomla-2-5-3-0/
Try it again and if problem still persists, PM me login credentials of site you’re working on (URL – Admin – FTP account), I shall check for you.
Arvind Chauhan ModeratorArvind Chauhan
- Join date:
- September 2014
- Posts:
- 3835
- Downloads:
- 74
- Uploads:
- 92
- Thanks:
- 1240
- Thanked:
- 1334 times in 848 posts
December 10, 2012 at 2:48 am #475646Hi iway,
Can you share your site url? where we can check this issue?
Arvind
MoonSailor FriendMoonSailor
- Join date:
- November 2011
- Posts:
- 1106
- Downloads:
- 0
- Uploads:
- 245
- Thanks:
- 89
- Thanked:
- 248 times in 223 posts
December 10, 2012 at 3:47 am #475656Hi @iway2011,
– Pls open file: /components/com_jak2filter/models/itemlist.php, find this function:
[PHP]
function prepareSearch($search) {
[/PHP]go to line 816 change
[PHP]
if(JRequest::getInt(‘category_id’)){$ja_cid = JRequest::getInt(‘category_id’);
$category = JTable::getInstance(‘K2Category’, ‘Table’);
$category->load($ja_cid);
$cparams = class_exists(‘JParameter’) ? new JParameter($category->params) : new JRegistry($category->params);if ($cparams->get(‘inheritFrom’))
{$parent = JTable::getInstance(‘K2Category’, ‘Table’);
$parent->load($cparams->get(‘inheritFrom’));
$cparams = class_exists(‘JParameter’) ? new JParameter($parent->params) : new JRegistry($parent->params);
}if ($cparams->get(‘catCatalogMode’))
{
$where[] = “i.catid = “.$db->quote($ja_cid).” “;
}
else
{
$categories = $this->getCategoryTree($ja_cid);
$where[] = “i.catid IN (“.@implode(‘,’, $categories).”) “;
}
//$sql.= ” AND i.catid = “.$db->quote(JRequest::getVar(‘category_id’)).” “;
}
[/PHP]to
[PHP]
//Search by Category
if(JRequest::getVar(‘category_id’)){
$ja_cid = JRequest::getVar(‘category_id’);
$ja_cids = explode(“,”,$ja_cid);
$category = JTable::getInstance(‘K2Category’, ‘Table’);
foreach($ja_cids AS $cid){
$category->load($cid);
$cparams = class_exists(‘JParameter’) ? new JParameter($category->params) : new JRegistry($category->params);if ($cparams->get(‘inheritFrom’))
{$parent = JTable::getInstance(‘K2Category’, ‘Table’);
$parent->load($cparams->get(‘inheritFrom’));
$cparams = class_exists(‘JParameter’) ? new JParameter($parent->params) : new JRegistry($parent->params);
}if ($cparams->get(‘catCatalogMode’))
{
$where[] = “i.catid = “.$db->quote($cid).” “;
}
else
{
$categories = $this->getCategoryTree($cid);
$where[] = “i.catid IN (“.@implode(‘,’, $categories).”) “;
}
}
//$sql.= ” AND i.catid = “.$db->quote(JRequest::getVar(‘category_id’)).” “;
}
[/PHP]– Open file: modules/mod_jak2filter/helper.php, find and replace this snippet of code:
[PHP]
public function getCategories($groupcategories){$cat_id = JRequest::getInt(‘category_id’,0);
$categories_option[]=JHTML::_(‘select.option’, 0, JText::_(‘SELECT_CATEGORY_FRONT’));
$categories = $this->categoriesTree($groupcategories,NULL, true, true);
$categories_options=@array_merge($categories_option, $categories);
$attribs = array(‘option.attr’ => ‘rel’, ‘option.key’ => ‘value’, ‘option.text’ => ‘text’,
‘list.attr’ => array(‘class’ => ‘inputbox’, ‘onchange’=>’jak2DisplayExtraFields(this);’),
‘list.select’ => $cat_id);//Important Note: do not add more parametter after $attribs, add them into $attribs
$categories_html = JHTML::_(‘select.genericlist’, $categories_options, ‘category_id’, $attribs);return $categories_html;
}
[/PHP]With
[PHP]
public function getCategories($groupcategories){$cat_id = JRequest::getVar(‘category_id’,0);
if(is_array($groupcategories)){
if(($key = array_search(0, $groupcategories)) !== false) {
unset($groupcategories[$key]);
}
$categories_option[]=JHTML::_(‘select.option’, implode(“,”,$groupcategories), JText::_(‘SELECT_CATEGORY_FRONT’));
}else{
$categories_option[]=JHTML::_(‘select.option’, 0, JText::_(‘SELECT_CATEGORY_FRONT’));
}
$categories = $this->categoriesTree($groupcategories,NULL, true, true);$categories_options=@array_merge($categories_option, $categories);
$attribs = array(‘option.attr’ => ‘rel’, ‘option.key’ => ‘value’, ‘option.text’ => ‘text’,
‘list.attr’ => array(‘class’ => ‘inputbox’, ‘onchange’=>’jak2DisplayExtraFields(this);’),
‘list.select’ => $cat_id);//Important Note: do not add more parametter after $attribs, add them into $attribs
$categories_html = JHTML::_(‘select.genericlist’, $categories_options, ‘category_id’, $attribs);return $categories_html;
}
[/PHP] -
AuthorPosts
This topic contains 21 replies, has 5 voices, and was last updated by MoonSailor 11 years, 10 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum