Skip to Content Skip to Menu

2 levels of criteria in Search List

  • fg88
  • fg88
  • OFFLINE
  • Posts: 14
  • Thanks: 5
  • Karma: 1
6 months 1 week ago #338036 by fg88
Hi,

Today, when searching on a List, all criteria (configured for display) are displayed. When we configure 10 field, the search zone is quiet large.

It will be good to have 2 levels of search criteria, in order to have a reduced search area.

For instance :
- Main criterias : Firstname, Lastname, City
- Secondary criterias : Category, Gender, Year, Country...

In this case, the searching zone will only contain 3 criterias search which is small
We could then access the secondary criterias with a bouton "More criteria" that open the secondary criteria.

Thanks

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48495
  • Thanks: 8284
  • Karma: 1443
6 months 6 days ago #338049 by krileon
Replied by krileon on topic 2 levels of criteria in Search List
That should be doable mostly, if not entirely, by using CSS to restyle the search criteria to be more compact. There's no plans to add additional display parameters for that, but in CB 3.x we'll be providing and easier to use layout system so I suppose at that point you could possibly make a custom layout for search criteria. It is possible to override the userlist layout by using a custom CB template, but you'll need to know PHP to do so.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • fg88
  • fg88
  • OFFLINE
  • Posts: 14
  • Thanks: 5
  • Karma: 1
2 weeks 5 days ago - 2 weeks 5 days ago #339439 by fg88
Replied by fg88 on topic 2 levels of criteria in Search List
Hi,
Thank you for your response.

I managed to deal it with jquery, i share the solution.

I have added a CB Content Module, displayed on the searching page, with only this jquery code :

Code:
$(document).ready(function() {     // Hide all fields after the first 2 (displaying only the 2 first one), on page loading.     $('.cbUserListSearchFields .form-group:gt(1)').hide();     // Add a link "More criteria"     $('<a href="#" id="toggle-criteria">More criteria...</a>').insertAfter('.cbUserListSearchButtons');     $(document).on('click', '#toggle-criteria', function(e) {         e.preventDefault();         // Hide or display additionnal fields         $('.cbUserListSearchFields .form-group:gt(1)').slideToggle();         // Change the text link         if ($(this).text() === 'More criteria...') {             $(this).text('Less criteria...');         } else {             $(this).text('More criteria...');         }     }); });
Last edit: 2 weeks 5 days ago by fg88.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum