|
ImageDropdown is an image-enhanced dropdown edit control. It displays an image next to each option and also shows the image in the selected value. Useful for teams, countries, users, products, categories, or any lookup table where a visual cue helps users make the right choice faster.
Sample settings: // ImageDropdown plugin default settings. // These can be adjusted per field in PHPRunner. $this->settings["lookup_table"] = "wc_teams"; $this->settings["key_field"] = "id"; $this->settings["label_field"] = "team_name"; $this->settings["image_field"] = "flag_url"; $this->settings["where_clause"] = ""; $this->settings["order_by"] = "team_name"; // Optional: use a custom query instead of lookup_table/key_field/label_field/image_field. // Query must return ip_key, ip_label, ip_image. // Example for top scorers with team flag: // $this->settings["lookup_sql"] = "SELECT s.id AS ip_key, CONCAT(s.player_name, ' (', t.team_name, ')') AS ip_label, t.flag_url AS ip_image FROM wc_top_scorers s INNER JOIN wc_teams t ON t.id = s.team_id ORDER BY s.player_name"; $this->settings["lookup_sql"] = "SELECT s.id AS ip_key, CONCAT(s.player_name, ' (', t.team_name, ')') AS ip_label, t.flag_url AS ip_image FROM wc_top_scorers s INNER JOIN wc_teams t ON t.id = s.team_id ORDER BY s.player_name"; $this->settings["placeholder_image"] = ""; $this->settings["placeholder_text"] = "Pick a player"; $this->settings["dropdown_height"] = "320px"; $this->settings["allow_clear"] = 1; // Optional group behavior, useful for Champion / Second place / Third place. $this->settings["picker_group"] = ""; $this->settings["prevent_duplicates"] = 0; No reviews yet |
|