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

    (@xnau)

    You can eliminate the dropdown completely and replace it with a hidden field with the same name as the search field dropdown (search_field). Set the value of the hidden field to the name of the field you want them to search on. You should make your custom template using the pdb-list-detailed.php template as your starting point. Just take out the function that generates the dropdown and replace it with your hidden field.

    Thread Starter Hergott

    (@hergott)

    Thanks for your help so far.
    I guess I know what you mean. You want me to switch the dropdown menu out with an hidden field, which contains the value/name for the searchable column.
    Like this?
    <input type=”HIDDEN” name=”search_field” value=”column_name”>

    But I can’t work out what to replace in the pdb-list-detailed.php file. Which function in the php file build the dropdown menu?

    I’m new to “rewrite” plug-in’s – But I try my best to learn and learn. So thanks for giving your time ??

    Thread Starter Hergott

    (@hergott)

    I found a work around by editing the PDb_list_class.php file, which make me get my result…
    But I would like to learn more about the template metode – Also for making sure no mistake will happen in future updates of your plug-in.

    Plugin Author xnau webdesign

    (@xnau)

    It’s best to use the template. If you edit the core files, you will lose your changes when you upgrade.

    I didn’t go into too much detail about how to edit the template. Read this page about how to use custom templates. Then, find this in the template:

    $this->column_selector( false, true, false, 'column' );

    Replace that with your hidden field. You got that part right.

    Thread Starter Hergott

    (@hergott)

    Thanks so much for your help and time ?? ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Disable dropdown because of search in only one column’ is closed to new replies.