ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Simple Search searching custom field populated from another field?

May 18, 2011 6:23pm

Subscribe [3]
  • #1 / May 18, 2011 6:23pm

    I have a simple search started that searches a database of psychologists.

    I’d like users to be able to search psychologists by specialty, which is a custom field in the psychologists channel. The specialty custom field I’m referring to is populated by a custom field pulled in from a different Channel. (on the custom field page for “specialty” I am using checkboxes as field type and I have “Populate the menu from another custom field” and the field is a custom field from another channel.)

    It doesn’t show any results when I search on known specialties, but I’m not sure if it should.
    Should I be able to perform a search like this that uses a custom field with data from another channel?
    If not, I’ll stop trying to figure it out and implement it a different way. Just wanted to check…

    {exp:search:simple_form channel="psychologists" form_id="psychologist-search" search_in="entries" where="all" result_page="resources/search-results" no_result_page="resources/no-results"}
        <h3>Search by</h3><p> <br />
        </p><h6>Specialty</h6><p>               <br />
        <input id="keywords" name="keywords" value="" /><br />
        <input id="submit-search" name="Go" type="submit" value="Go" class="block submit" /><br />
    {/exp:search:simple_form}

    Thank you!

  • #2 / May 19, 2011 6:06am

    John Henry Donovan

    12339 posts

    Susan,

    I don’t think that will work. When it pulls data from another channel like this on your publish form and you save it you are only saving the reference to the other entries custom field and not the other custom field data. Does that make sense?

    Maybe something like Dynamic Parameters might help. A different way of searching granted, more like filtering but might fit your needs

  • #3 / May 19, 2011 11:22am

    Hi John, that makes sense and I sorta figured it wouldn’t work, but thought I’d double-check. I’ll probably save this data into a new custom field using the Preparse add-on (which I’m already using for some other data on this channel.)

    Thanks! Susan

  • #4 / May 19, 2011 3:23pm

    Okay, I’m a little embarrassed, but thought I’d post here in case it helps anyone searching in the future:

    You CAN search the data in custom fields of type checkbox that are populated from other custom fields.

    I forgot to “make the field searchable”!!! But once I did it worked perfectly.

    This thread can be closed. thanks!

  • #5 / May 20, 2011 8:59am

    Sue Crocker

    26054 posts

    Glad you were able to figure out what the problem was. Don’t hesitate to post again as needed.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases