Listing Filter and State + City

Discussion in 'TemplateCodes' started by sbhkma, May 4, 2010.

Thread Status:
Not open for further replies.
  1. sbhkma Customer

    I've read the threads on being able to use city AND state as a filter and am wondering if there is ANY way to make this happen. Client wants this to function so that you can select State / City to view listings, not just filtering to State level. If anyone has done this or has any ideas, please let me know.
  2. seymourjames All Hands On Deck

    The listing filter works one one variable, namely states (you can rename that) or an extra field. What you are requesting is a second filter.
  3. sbhkma Customer

    That's what I thought.
    If I add a field called "location" I imagine I could filter by THAT, correct? I am however unclear as to how to change the ListingFilter from its default "state" to another field. I've looked at the docs that came with it and it's not very thorough in that regard. How do I go about changing that?
  4. TemplateCodes-Mike TemplateCodes

    From the instructions text:
    /**
    * Override the default filtering by state with an extra field, put the fields
    * id in place of 0 if you want to enable searching by an extra field versus the
    * users registration data.
    *
    * Please note that this extra field must be a select option, as there is no
    * other extra field that enables you to create a list of filterable options.
    * These will be used to populate the popup as well as being filtered against.
    */

    $data['module']['lfilter_field'] = '0'; //'0' default, integer extra field id

    So get the extra field id from the administration extra fields and put the number in.
    The code is from the templatecodes module file around line 156.

    yoursite/modules/templatecodes/config.php
  5. sbhkma Customer

    Perfect. Thank you!
  6. TemplateCodes-Mike TemplateCodes

    We're here to help and I'm sincerely glad I was able to help you.

    Thank you for pointing out an opportunity to improve our support. That is appreciated! :)
  7. Bronxgodzilla Ageless Member

    The Listing Filter has a great magnitude of possibilities. Thanks for adding even greater clarity and application, Mike. Much appreciated!

    Barry G
Thread Status:
Not open for further replies.

Share This Page