• Resolved bhavens

    (@bhavens)


    I am specifying which fields I want to see on a particular list.

    [pdb_list fields="ld_graphic,ld_name,perf_troupe,ld_city,ld_style" filter="submission_type=sub-performer&admin_approved=yes&admin_active=yes" search=true sort=true display_count=true orderby="ld_name" order="asc"]

    The search drop-down only allows you to search the fields being displayed.

    The *sort* drop-down, however, apparently lists all fields in the database that have something other than 0 in the column list, so sort options are showing up for fields not on the screen.

    I tried specify group (groups=”…”) in the pdb_list shortcode but with no change in the result (still had sort options for fields not in the groups specified).

    Any way to limit the sort option to just fields on the screen?

    Another oddity… my “Image” field (Image Upload field) is in the Search drop-down. Any way to remove that?

    https://wordpress.org/plugins/participants-database/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter bhavens

    (@bhavens)

    Correction: Sort drop-down displays all fields in the database that have a number other than 0 in the Display Column list *and* are marked as sortable.

    Plugin Author xnau webdesign

    (@xnau)

    Yes, so you can easily control which fields are present in the sort dropdown with the “sortable” flag. The search dropdown defaults to the visible columns.

    If you want to specify which fields are present in the search dropdown, you need to use a custom template. The “pdb-list-detailed.php” template should be used as your starting point, it has notes explaining how to customize the search dropdown.

    How to Create Custom Templates

    Thread Starter bhavens

    (@bhavens)

    Hmm…

    List Page: Performer
    Fields: ld_name, ld_city (both marked as sortable)

    List Page: Venue
    Fields: ld_name, ld_city, venue_capacity, venue_restrictions (all marked as sortable)

    On my example above (the list page for performers) the Search drop-down just has the fields displayed on the screen (Name, City) – great. However the *sort* drop-down has Name, City, Capacity, and Age Restriction (those last two don’t pertain to this list)

    Maybe this is a feature request that the sort drop-down be limited to fields actually being displayed on the screen.

    Thread Starter bhavens

    (@bhavens)

    In the custom template for searching and sorting what is the format to supply an array of field names? (vs. the default answer of false)

    Thread Starter bhavens

    (@bhavens)

    found the syntax:
    $this->column_selector( false, true, array(field1, field2, field3), 'column' );

    However, I did see on your website where you talk about searching and sorting the list and you say “For sorting, the fields offered for sorting must be checked as “sortable” and also be present in the list display.”

    That is not the behavior I am experiencing. I am getting all fields checked as “sortable” even if they aren’t present in the list display. Bug?

    Plugin Author xnau webdesign

    (@xnau)

    Yes, the documentation is out of date there.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Sort not limited to fields in list’ is closed to new replies.