This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Change default options

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #17906
    letsbastelletsbastel
    Participant

    Hi, I want to add own search content to ajax Search Pro. This is working very well.

    So if I want to group all my result, I have to add new Grouping “Content Types”. They are defined as default in default_options.php. So how can I add new groupby_content_type vars? DId you have a filter function, where I can add some new one?

    Thanks
    Bjoern Fischer

    #17942
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi Bjoern,

    This is a really tough question. The content type is defined during the query, however you can actually change that before the results are processed.

    You will need two functions, one to add the additional groups, and another to modify the results group variable to assign them to the new groups as you want to.

    Add this custom codes to the functions.php in your theme/child theme directory (copy from line 3 only!). Before editing, please make sure to have a full site back-up just in case!

    Adding the new groups code

    Change the $new_groups variable to create new groups.

    Appending the results to these groups
    The g_content_type property on each result defines which group is it assigned to. This custom code will assign all the results to group_key1 group. You can use this as a template, use conditional logic there, or whatever you like.

    I hope this helps!

    #17967
    letsbastelletsbastel
    Participant

    YEAH, works very well. The code Section for the asp_instance_options filter is the one, that I have searched 🙂

    #17968
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Change default options’ is closed to new replies.