WordPress.org

Forums

Participants Database
Having only certain fields in search list (8 posts)

  1. hardikgandhi
    Member
    Posted 3 years ago #

    Is there a way by which I can have only certain fields in the search list. The problem I have chosen only few fields to be displayed in the table for a particular page. But the field listed in search list is complete. Due to this if I select a field that is not displayed in the table right now it shows me 0 records matched.

    Is there a way to have only certain fields in search list? I have gone through the old posts but could not find the answers in them.

    Please help

    http://wordpress.org/extend/plugins/participants-database/

  2. xnau
    Member
    Plugin Author

    Posted 3 years ago #

    Hardik,

    The search dropdown only includes columns that are visible in the list, so I'm not sure what you're seeing there. Can you be more specific?

  3. hardikgandhi
    Member
    Posted 3 years ago #

    let me explain this with an example,
    I have 5 fields in by db Table1
    1. name
    2. email address
    3. tel no.
    4. cell no.
    5. address

    And I have a page where i have inserted this code.
    [pdb_list fields="name, email_address" search="true" sort="true" display_count="true" filter='approved=yes']

    Even after this on the page the search list still shows all the options (name, email address, tel no, cell no, address) though the table has only two of them. So, is there a way by which i can show the option i want in the search list?

  4. xnau
    Member
    Plugin Author

    Posted 3 years ago #

    Hardik,

    You need to define the fields you want to show in the "manage database fields" page, under the "display" column. The "fields" parameter of the shortcode only defines what get shown in the list, not what's available in the search dropdown. You won't need the "fields" parameter at all.

  5. hardikgandhi
    Member
    Posted 3 years ago #

    may be i was not clear with the earlier question...
    I added the fields parameters in the shortcode in order to show those fields in the table at that particular page.
    I have a scenario where I have to show the tables at three different pages with different fields at each place.

    Let me explain the scenario,
    I have a field Father/Spouse in the db and have set the display column non zero in manage database fields. I can see the field in the table as expected. I have added a short code in some other page where the father/spouse name is not added, as I just wanted to show the first name, last name and cell no.
    I would like my users to be able to search by first name, last name, cell no. But not by Father/spouse, because that field is not a part of that table and it won't work anyway. But unfortunately the Father/Spouse is listed in the search list drop down.

    One way to get rid of that would be to set 0 in the display column in manage database fields but then it would lead to Father/Spouse fields missing in the search and sort drop down list for some other table in a different page.
    Is there a work around for this?

    Hope I am clear this time. :)

    Thanks

  6. xnau
    Member
    Plugin Author

    Posted 3 years ago #

    You can use the fields parameter if you need to. Just give all the fields you want to use in all the pages a number in the "display" column, then in each shortcode, define which ones will show in that particular spot.

  7. hardikgandhi
    Member
    Posted 3 years ago #

    Correct this is what i have been doing till now. But in this case the search drop down list shows all the fields that have been assigned a number is "display" column even though those fields are not shown in the table at that particular page. If i have 10 fields with numbers in the "display" column the "Search" drop down shows all the 10 fields even though only 3 fields are shown in the table at that page.

  8. xnau
    Member
    Plugin Author

    Posted 3 years ago #

    Ah, I see. Yes, unfortunately, that is how it is going to work. No easy way to change that.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Participants Database
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic