Filtered by Category Auotpopulate View

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Filtered by Category Auotpopulate View

This topic contains 7 replies, has 2 voices, and was last updated by Mike Nielsen Mike Nielsen 6 years, 2 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #16275
    Mike Nielsen
    Mike Nielsen
    Participant

    We have a main program listing of all our academic offerings. We have a separate search that shows everything. We want a targeted search for each of the different schools, so a subset of the entire listing. Each program is listing by a post entry. We were able to create a filtered search, but it only limits by school after someone searches, or selects one of the drop down filters. We need the initial display, before any end user interaction, to also only be limited by the specific school. We are using categories right now to accomplish this, but unsuccessfully. I was able to force the initial display to the targeted sub set school by adding a custom field entry, then adding that as an item on the Frontend Search Settings > Custom Fields, but to implement that solution, I would have to manually edit many posts. Would prefer something using categories

    Basically, need the autopopulate to also filter by a designated category.

    #16282
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    A simple filter by categories should do the trick here.

    I would suggest the following configuration (or similar):
    – Choose to display all categories in the filter (or some of them), anc change their display mode to drop-down: https://i.imgur.com/uVhAOTV.png
    – Also, turning off this option may help as well: https://i.imgur.com/Za3q9L9.png

    That should filter the results by category, and only display those that have that category registered, no missing results either.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #16330
    Mike Nielsen
    Mike Nielsen
    Participant

    I had that set as such, but at the onset, what is auto-displayed included everything. Only when I select a different option on the drop down menu, does it force the category filter. The only way I’ve been able to do a work around is by including the target category in the drop down menu, then changing from “Chose Any/one option” to As Defined and including the target category. With this, it now shows the target category in the drop down, which feels redundant and not desirable to display to the end user.

    I set it that way for you to see on our Arts & Sciences page:
    http://tst.lasalle.edu/programs/arts-and-sciences/

    We have three different schools. Our main program list page includes all majors, programs, etc from all three schools (there are different categories based on program type). On the Arts & Sciences program listing page above, we just want those programs associated with that school. I’m only able to do that if I use the As Defined option, but that means the default drop down option is “Arts & Sciences” which feels very redundant and doesn’t allow us to prompt the end user to select an option (ie displaying “Select One” by default).

    #16335
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    I’m not sure if I understand correctly yet:
    – Do you want to display a filter, but restricted to a specific category of the current page?
    – ..or you don’t need the filter, just restrict the results to the category of the current page?
    – ..or the filter should be visible and set to the category of the current page?

    Let me know, and I may be able to suggest a solution, although it may require a bit of custom code as well.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #16345
    Mike Nielsen
    Mike Nielsen
    Participant

    Thanks. The first. Need restricted to a specific category and provide a filter for additional/other categories.

    The reason is that we will have other pages with filters, but unrestricted initial views.

    Could an option/feature request be to add an option under Layout Options > Search Box Layout > Auto Populate to be Enabled – Results for a specific category (akin to Enabled – Results for a search phrase)? Then have a field to designate the category?

    I guess the issues is that we have two sets of categories in play. One set, used for filters across the board and apply to all three schools (ie online, adult, undergraduate, graduate, etc). The second set is the three school categories (Arts & Sciences, Business, Nursing). I guess we could separate using tags instead of categories, but not sure if that would accomplish the same, or not.

    #16402
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    I think I get it now, and I believe it may still be doable.

    May I ask, is this page: http://tst.lasalle.edu/programs/arts-and-sciences/
    just a regular page, or some sort of category archive or something else? I’m asking, because there is an extensive plugin API, which allows executing code during the search process, and modifying the query arguments. If somehow there was a way to get the desired category based on that page ID, then it should be very likely easily solveable.

    There is actually an option on the back-end under the Advanced Options -> Exclude results panel, that allows including results only from specific categories. In this case however it would only work, if the category filter on the front-end did not have the ‘Choose one option’ selected as default – because that automatically means that inclusions should be ignored.
    I’m thinking, if this option had the first set of categories choosen (or the only one you want), and the actual front-end filter only had the second set, without the ‘Choose one’ option. Then the plugin would automatically restrict to the first set defined on the back-end, and to the one that is selected from the drop-down as well.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #16643
    Mike Nielsen
    Mike Nielsen
    Participant

    Sorry for the delay in response. Got pulled into other projects. The page in question is just a regular page withe the search shortcode on it. I’ll try playing with your suggestions and report back.

    #16647
    Mike Nielsen
    Mike Nielsen
    Participant

    I sort of got it to work as outlined above. Just unchecking “Display the “Choose one/Any option?” box fixed the issue of showing everything, but I had to include the main target category as the first category term for the drop down boxes, or it wen to the first item.

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

You must be logged in to reply to this topic.