WordPress.org

Ready to get started?Download WordPress

Forums

Custom Tables
[Plugin: custom tables] Multiple Filter Dropdowns using [set] or SALT? isn't caching? (14 posts)

  1. aprietoartwork
    Member
    Posted 2 years ago #

    Stefan,
    How would you use multiple filter drop downs together without resetting every a filter is selected? CSS="SALT"? [set]?
    For instance

    [wctselect id="1" field="city" limit="20" maintext="Choose Your City"]
    [wctselect id="1" field="cat" limit="20" maintext="Category"]
    [wctselect id="1" field="subcat" limit="20" maintext="Sub-Category"]

    Choosing multiple drop down filters resets the previous filter, how would you show the results after all are selected?

    Sample
    http://www.neighborpro.com/test/sample-page/

    Also, upgrading broke the following code:

    [wctsearch felder="zip"]<?php if ($_GET['wcts'] != '') {
    echo do_shortcode("[wctable id=\"1\"]");
    }
    ?>

    Did $_GET get deprecated?

    Also the Smarttag Generator isn't working with the "Show Dropdown field from a field"

    thanks!

    http://wordpress.org/extend/plugins/custom-tables/

  2. Stefan M.
    Member
    Plugin Author

    Posted 2 years ago #

    SALT is for the CSS code.

    The wctselect topic will be fixed with grouping in version 3.0 which is coming soon.

    Hm... php should work but try insted the php tag:

    [wctsearch felder="zip"][wctphp]if ($_GET['wcts'] != '') {
    echo do_shortcode('[wctable id="1"]');
    }
    [/wctphp]

    or:

    [wctsearch felder="zip"][wctphp]if ($_GET['wcts'] != '') {
    echo '[wctable id="1"]';
    }
    [/wctphp]

    Try what works. Otherwise I will add it in the new version this feature.

    Regards

  3. aprietoartwork
    Member
    Posted 2 years ago #

    Neither worked :/
    Tested and worked up until 2.6. so 2.5 is still good with

    [wctsearch felder="zip"]<?php if ($_GET['wcts'] != '') {
    echo do_shortcode("[wctable id=\"1\"]");
    }
    ?>
  4. Stefan M.
    Member
    Plugin Author

    Posted 2 years ago #

    will add feature to v3.0.

  5. aprietoartwork
    Member
    Posted 2 years ago #

    Stefan how does the new [wctmultiselect] function work?

  6. Stefan M.
    Member
    Plugin Author

    Posted 2 years ago #

    Hi.

    Salt is working now with salt=""

    Multiselect is nearly function same as normal select.

    Please have a look on the smarttag generator!

    As example for the 2nd field in the demotable:
    [wctmultiselect id="1" field="Kategory" maintext="Category"]

    Regards
    Stefan

  7. aprietoartwork
    Member
    Posted 2 years ago #

    Stefan, multiselect is only a premium feature correct?

  8. Stefan M.
    Member
    Plugin Author

    Posted 2 years ago #

    that is correct.

  9. aprietoartwork
    Member
    Posted 2 years ago #

    Ok I now have the premium edition, for the majority the smart tag generator works but it doesn't work for the multiselect option... I'm able to select my table but "Fields" doesn't generate anything, clicking generate also does nothing.

    Ok so now that I have multiselect I can use the following:

    [wctselect id="1" field="main" limit="20" maintext="Choose Main"]
    [wctmultiselect id="1" field="cat" limit="20" maintext="Choose Cat"]
    [wctmultiselect id="1" field="subcat" limit="20" maintext="Choose subcat"]

    How do I make the multiselects generate fields based on the previous selection? and then show results based on the selections?

    thanks!

  10. Stefan M.
    Member
    Plugin Author

    Posted 2 years ago #

    Hi

    Is this working:
    [wctselect id="1" field="main" limit="20" maintext="Choose Main"]

    try then:
    [wctmultiselect id="1" field="main" limit="20" maintext="Choose Main"]

    The same should work as single and multi select.

    If multiselect is not working, annother plugin has modified jquery from wordpress which can make problems. My plugin uses the jquery version which is delivered with wordpress from standard!

  11. aprietoartwork
    Member
    Posted 2 years ago #

    wctselect and wctmultiselect work great, that's not the issue though.

    Here's an example of what I'm trying to do:

    [wctselect id="1" field="State" limit="20" salt="1" maintext="Choose State"]
    [wctselect id="1" field="City" limit="20" salt="2" maintext="Choose City"]
    [wctselect id="1" field="Business" limit="20" salt="3" maintext="Choose Business"]

    When you select the "State" field the "City" field will generate the cities within that state.

    Then when you select the "City" field the "Business" field will only show Business' in that city.

    A search wouldn't be needed as it only needs to show the results... I hope this makes sense :)

    Can this plugin do this? I thought Multiselect was the ability to select multiple different dropdowns to generate a single refined search. Salt was able to allow the fields to hold their values as more dropdown selections were made.

    thanks!

  12. Stefan M.
    Member
    Plugin Author

    Posted 2 years ago #

    ok, I know what you mean.

    To be honest: not possible.

    single select means you can define in which state you want to search. only one state can be selected -> wctselect

    multi select means, you can select multiple states where you want to look. -> wctmultiselect

    You can define a SALT that you can say on on dropdown State and on the other Cities, yes.

    What you CANNOT do is link the cities and states. That would need 1 to n relation within the database, that the db would now which states have which cities in it.

    That feature is planned to be a premium feature in the future and will come, but this will take some time to realize.

    But you could do it as a workaround with PHP.

    Generate for each "State" an own Set() field like:

    state_ariziona (city1,city2)
    state_newjersey (city1)
    ...

    then add php tag:

    [wctphp]if ('{state}' == "Arizona") { echo "[wctmultiselect field=\"statearizona\" id=\"1\" salt="1"]"; }
    elseif ('{state}' == "New Jersey") { echo "[wctmultiselect field=\"state_newjersey\" id=\"1\" salt="1"]"; }[/wctphp]

    much work for yourself, but would work.

    For Businesses, you would need n to n relation, because a business can be in 1 or multiple states and cities.

    I would there not make a relation, only add there the:

    [wctphp]if ($_GET['wct1mudrof'] != "City") { echo "[wctselect id=\"1\" field=\"Business\" salt=\"2\" maintext=\"Choose Business\"]"; }[/wctphp]

    This code would show the business select field as soon a city has been selected. But to be honest, in this list would apear all business including the ones which are not available in the city, because no relationship is there.

    If you have php knowledge, you can also use a hook to implement your solution for this which will handle the complete relations ships.

  13. odhranmullan
    Member
    Posted 2 years ago #

    Hi,

    How do I set the drop down filter to put items in certain order, e.g. alphabetically. At the minute it will only order the filter items in descending order by the number of entries.

    Here is an example:

    http://2013fleadh.ie/fleadh-cheoil/competitions-timetable/

  14. Stefan M.
    Member
    Plugin Author

    Posted 2 years ago #

    Hi
    Take:
    sort="name ASC"

    OR name DESC for clockwise.

    Smarttag generator can help ;)

    Regards
    Stefan

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic