test
Viewing 15 posts - 1 through 15 (of 35 total)
  • Author
    Posts
  • drimwerk Friend
    #162689

    Hi Thuan,

    Is is possible to show extra fields in the search result page. Default parameters is enabled, but it doesn’t show. Also I would like to have one field instead of all the extra fields.

    Ninja Lead Moderator
    #386158

    You can show extra fields in the search result page. Please follow my suggestion bellow:

    Change SQL query of onSearch function to get fields what you need to display on result page

    <blockquote>plugins/search/jak2_filter/tmpl/jak2_filter.php</blockquote>

    drimwerk Friend
    #386938

    Hi Tamlm,

    Thanks for your replay.
    Can you give me a hint how to do.
    The extra field is named “Number”.

    drimwerk Friend
    #387105

    There is no onSearch in this file. I need more instructions.
    Please could you have a look into this.

    drimwerk Friend
    #389805

    I really can not figure this one out.
    Please help me on this.

    suziesuzy961 Friend
    #390405

    Hello, you can choose a position (for exemple content1) and modify your template so as to load it.

    drimwerk Friend
    #390969

    Thanks for your replay but I don’t know what you mean.
    So still no solution that will work for me. I need more directions.

    thangnn1510 Friend
    #391527

    K2 extra fields are set in back-end and will be displayed in front end within JA K2 filter modules. It only displays in module, we can’t customize it to display in result pages.

    xiondesigns Friend
    #398120

    <em>@thangnn1510 240815 wrote:</em><blockquote>K2 extra fields are set in back-end and will be displayed in front end within JA K2 filter modules. It only displays in module, we can’t customize it to display in result pages.</blockquote>

    I think what we need (and want) is a guide on how to show some extra fields (specific ones) on the results page.

    The same way we can customize to show the k2 image on the results page modifyng default_results.php, i would love some guidance on how to get some extra fields.

    In k2 for example i can do this (in a template)
    <?php $custom = $this->item->extra_fields; ?>
    <?php echo $custom[2]->name; ?>
    <?php echo $custom[2]->value; ?>

    And i can add style to all this. But i cant figure out how to do the same with Ja K2 Search module results on the Joomla search component.

    Bye

    xiondesigns Friend
    #398240

    Please i need help with this.

    thangnn1510 Friend
    #398310

    <blockquote>K2 extra fields are set in back-end and will be displayed in front end within JA K2 filter modules. It only displays in module, we can’t customize it to display in result pages.</blockquote>

    Please read my earlier response. Thanks.

    xiondesigns Friend
    #398753

    There should be some way to show extra fields the same way i can add the image… come on!

    Its not right if we try to create complex filtering without being able to show some of that specific data con the search result.

    There has to be some way, and i beg for some developer to help on this.

    There has to be a way

    P L E A S E

    thangnn1510 Friend
    #399049

    OK Then, This is your custom code. Please put it to templates/your_template/html/com_search/search/default_result.php about line 33


    <?php
    $db = &JFactory::getDBO();
    $query = "SELECT * FROM #__k2_items WHERE id=".$result->id;
    $db->setQuery($query);
    $items = $db->loadObjectList();
    if(count($items)>0){
    foreach($items as $item){
    $item = json_decode($item->extra_fields);
    echo $item[0]->value;
    }
    }
    ?>

    change echo $item[0]->value; with yours. Thanks.

    drimwerk Friend
    #399305

    Hi Thang,

    This works great.
    Thanks for you help, you’re a hero!

    Regards, Perry

    xiondesigns Friend
    #399989

    When adding

    <?php
    $db = &JFactory::getDBO();
    $query = “SELECT * FROM #__k2_items WHERE id=”.$result->id;
    $db->setQuery($query);
    $items = $db->loadObjectList();
    if(count($items)>0){
    foreach($items as $item){
    $item = json_decode($item->extra_fields);
    echo $item[9]->value;
    }
    }
    ?>

    It works. But it it is a “multipleSelect” it gives an “array” result, instead of the actual value.

    Bye

Viewing 15 posts - 1 through 15 (of 35 total)

This topic contains 35 replies, has 8 voices, and was last updated by  espertoseo 13 years, 1 month ago.

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