test
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • ekhymosis06 Friend
    #198323

    Hi
    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.html

    But when I search “restaurantes”, that item not display in the list.
    http://www.icomercial.co/resultados.html?isc=1&searchword=restaurantes&st=all&ordering=hits

    Please, is very important for my site achieve that.

    Thanks

    Thanh Nguyen Viet Friend
    #537355

    Hello,

    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/

    ekhymosis06 Friend
    #537623

    Hi, 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 Friend
    #537675

    Hello,

    <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.

    ekhymosis06 Friend
    #537755

    Thanks.

    Is there any hack? :-[

    Sorry for my insistence…. this is very very important for my site.

    Thanh Nguyen Viet Friend
    #537826

    Hello,

    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]

    ekhymosis06 Friend
    #537878

    THANKS!!!!!!!!

    now detect keyword search as tag.

    really, thank you very very very much.. you are the boss!

    andrea74 Friend
    #567210

    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.

    Thanh Nguyen Viet Friend
    #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.

Viewing 9 posts - 1 through 9 (of 9 total)

This topic contains 9 replies, has 3 voices, and was last updated by  Thanh Nguyen Viet 9 years, 8 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum