WordPress.org

Ready to get started?Download WordPress

Forums

Query Multiple Taxonomies
[Plugin: Taxonomy Drill-Down] When using drop down box, put text in the empty box (7 posts)

  1. lucydog
    Member
    Posted 3 years ago #

    I have been experimenting with the drop-down version of the widget.
    The drop down defaults to a blank selection. I would like to put some text in there like "any" or "all" to indicate that if you skip it and select criteria below it, you will include everything at that level (at least that's how I think it works).

    Thank you!

  2. lucydog
    Member
    Posted 3 years ago #

  3. lucydog
    Member
    Posted 3 years ago #

    Well, actually the above post solves a different problem.
    Putting text in the first option drop-down such as "all available" -and- having the drill-down *ignore* that text is something else. Any ideas?

  4. scribu
    Member
    Plugin Author

    Posted 3 years ago #

    It does ignore that text: you are sent to an url with a blank selection, which is ignored, meaning you see all posts.

  5. lucydog
    Member
    Posted 3 years ago #

    Thanks for your response. It looks like the code has changed since the aforementioned post.

    What I tried to do was take
    html( 'select', array( 'name' => $name ),
    '<option></option>',

    I changed it to
    html( 'select', array( 'name' => $name ),
    '<option>-select all-</option>',

    It's trying to find something called "-select all-" rather than ignoring it, /?glass=-select+all-&hardware=brushed-nickel&testh=-select+all-
    So it goes to the 404 page.

    If the first drop down is simply blank, it does ignore the first field but I think it's confusing for the user because they don't know what a blank field means, so I was trying to put text in there to indicate what it means.
    .../hardware/brushed-nickel/?glass&testh

    "Glass" is blank, "Brushed Nickel" is selected, "Testh" is blank. It picks everything with Brushed Nickel regardless of the other criteria.

    Thanks again for your help.

  6. Thomas Jaggi
    Member
    Posted 3 years ago #

    Try <option value="">-select all-</option> instead.
    Worked in my case, but could be browser dependant (only tested in Chrome).

  7. iamdangavin
    Member
    Posted 3 years ago #

    This works, except if the user for some reason leaves all of the options on -select all- and hits submit it redirects to your front page...

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic