-
AuthorPosts
-
ekhymosis06 Friend
ekhymosis06
- Join date:
- March 2014
- Posts:
- 42
- Downloads:
- 0
- Uploads:
- 8
- Thanks:
- 21
- Thanked:
- 1 times in 1 posts
May 30, 2014 at 3:00 pm #198323Hi
In this thread http://www.joomlart.com/forums/topic/show-results-by-keywords-only/ I managed maked the module search only by keywords… but I need add tags in the search too.¿is possible?
The system, in this moment, not detect the tags of items in k2…
Example:
This item have “restaurantes” tag… you can see the tag in the bottom of article..
http://www.icomercial.co/restaurantes/muestra-tipi-restaurante.htmlBut when I search “restaurantes”, that item not display in the list.
http://www.icomercial.co/resultados.html?isc=1&searchword=restaurantes&st=all&ordering=hitsPlease, is very important for my site achieve that.
Thanks
Thanh Nguyen Viet FriendThanh Nguyen Viet
- Join date:
- September 2014
- Posts:
- 1461
- Downloads:
- 0
- Uploads:
- 44
- Thanked:
- 258 times in 217 posts
June 2, 2014 at 4:35 am #537355Hello,
As you can see in setting form of JA K2 Filter module, it has an option to enable “Filter by tags” field on search form, if you want to filter item by tag, you need to enable that field for search form.
Please have a look at our demo site here
http://joomla-extensions.demo.joomlart.com/1 user says Thank You to Thanh Nguyen Viet for this useful post
ekhymosis06 Friendekhymosis06
- Join date:
- March 2014
- Posts:
- 42
- Downloads:
- 0
- Uploads:
- 8
- Thanks:
- 21
- Thanked:
- 1 times in 1 posts
June 3, 2014 at 4:01 pm #537623Hi, thanks for reply.
My question is if the text box can detect the tags when the people type the tag and click the search button…
Thanh Nguyen Viet FriendThanh Nguyen Viet
- Join date:
- September 2014
- Posts:
- 1461
- Downloads:
- 0
- Uploads:
- 44
- Thanked:
- 258 times in 217 posts
June 4, 2014 at 2:16 am #537675Hello,
<blockquote>My question is if the text box can detect the tags when the people type the tag and click the search button…</blockquote>
Nope, the keyword search field will search in title, intro text, full text, and meta data fields only, to filter by tag, you must select a tag from Tags field.1 user says Thank You to Thanh Nguyen Viet for this useful post
ekhymosis06 Friendekhymosis06
- Join date:
- March 2014
- Posts:
- 42
- Downloads:
- 0
- Uploads:
- 8
- Thanks:
- 21
- Thanked:
- 1 times in 1 posts
June 4, 2014 at 11:53 am #537755Thanks.
Is there any hack? :-[
Sorry for my insistence…. this is very very important for my site.
Thanh Nguyen Viet FriendThanh Nguyen Viet
- Join date:
- September 2014
- Posts:
- 1461
- Downloads:
- 0
- Uploads:
- 44
- Thanked:
- 258 times in 217 posts
June 5, 2014 at 3:45 am #537826Hello,
To detect keyword search as tag, please try solution below:
– Open the file:
components/com_jak2filter/models/itemlist.php– Find the code line (it has some instances in the file, but find the first one in the function getData, ~ line 31)
[PHP]$tags_id = JRequest::getVar(‘tags_id’);[/PHP]– And replace it with:
[PHP]$tags_id = JRequest::getVar(‘tags_id’);
if(!$tags_id) {
$badchars = array(‘#’, ‘>’, ‘<‘, ‘\’);
$search = JString::trim(JString::str_ireplace($badchars, ”, JRequest::getString(‘searchword’, null)));
if(!empty($search) && strpos($search, ‘tag:’) === 0) {
$search = str_replace(‘tag:’, ”, $search);
$sqlTag = “SELECT id FROM #__k2_tags WHERE `name` = “.$db->quote($search);
$db->setQuery($sqlTag);
$tagid = $db->loadResult();
if($tagid) {
//convert keyword to tag
$tags_id = array($tagid);
JRequest::setVar(‘tags_id’, $tags_id);
JRequest::setVar(‘searchword’, ”);
}
}
}[/PHP]1 user says Thank You to Thanh Nguyen Viet for this useful post
ekhymosis06 Friendekhymosis06
- Join date:
- March 2014
- Posts:
- 42
- Downloads:
- 0
- Uploads:
- 8
- Thanks:
- 21
- Thanked:
- 1 times in 1 posts
June 5, 2014 at 11:42 am #537878THANKS!!!!!!!!
now detect keyword search as tag.
really, thank you very very very much.. you are the boss!
April 16, 2015 at 8:42 am #567210Hello, I have the same request but in my case the trick you suggested doesn’t work.
The versione I use is JAK2 Extra fields Filter and Search 1.1.8
Could you help me? Thank you.Thanh Nguyen Viet FriendThanh Nguyen Viet
- Join date:
- September 2014
- Posts:
- 1461
- Downloads:
- 0
- Uploads:
- 44
- Thanked:
- 258 times in 217 posts
April 17, 2015 at 2:56 am #567328<em>@andrea74 468888 wrote:</em><blockquote>Hello, I have the same request but in my case the trick you suggested doesn’t work.
The versione I use is JAK2 Extra fields Filter and Search 1.1.8
Could you help me? Thank you.</blockquote>Hi Andrea,
You can send me a PM with your site URL and FTP account, I need check what you modified so that I can give you further help to resolve this issue.
-
AuthorPosts
This topic contains 9 replies, has 3 voices, and was last updated by Thanh Nguyen Viet 9 years, 7 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum