• Resolved alFrame

    (@alframe)


    I am listing a group with the short-code: [pdb_list groups=”licensed_software”] on a page.

    It shows all the records, also the ones that don’t have a value in these fields. Is it possible to hide the empty fields by shortcode, or would I have to create a template page in this case?

    I tried it through css: .blank-field {display:none} but somehow this doesn’t work with my theme.

    Thanks!

    https://www.ads-software.com/plugins/participants-database/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author xnau webdesign

    (@xnau)

    Well, first, the “groups” attribute doesn’t do anything in the list shortcode, so you can take it out, also the “blank-field” class is only used in the pdb_single and pdb_record displays, so that won’t help you.

    Your best bet is to use a filter in the shortcode that only shows records that have a value in a specific field…for instance if you wanted to show all records that had a value for the field “city” do this:

    [pdb_list filter="city!" ]

    That means “show all records where the ‘city’ field is not empty.”

    Thread Starter alFrame

    (@alframe)

    Thanks for the pointer Xanu. Unfortunately it doesn’t quiet do what I try to achieve. Using your suggestion gives me a list of only those records, but it gives me a full list with all the entries for the records that have something in the field “city” (in my case “software”). The output is showing the fields in the order that are defined in the admin panel of the plugin.

    I am basically trying to do this: https://xnau.com/multiple-databases-with-participants-database/ But instead of showing the signup page, I am trying to get a list of only some fields, which are in a group, and only those records that have a value in the “software” field.

    The closest I got using this: [pdb_list fields=”software,url,license”]
    But then it shows all records and I can’t hide blank ones.

    Plugin Author xnau webdesign

    (@xnau)

    You can use any and all of the attributes in your shortcode:

    [pdb_list filter="city!" fields="software,url,license" ]

    As far as which records you want it to show, you have to figure that out…I just showed you an example, but many things are possible. Read this section on using the list filters:

    Filtering the List

    Thread Starter alFrame

    (@alframe)

    WOW! Thank you. Works perfectly!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Hide emtpy records’ is closed to new replies.