All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

Can Low Alphabet search by relationship field?

John Faulds 10 Nov 2014 06:11 question, complete

I have a channel where entries should be filtered by alphabet if segment_2 = alpha, by a category if segment_2 = division and by a native relationship field if it = location.

alpha_filter and category parameters on exp:low_alphabet:entries both work fine but is it possible to use the search parameter on related entries or some other method?

Replies

  1. Low 10 Nov 2014 08:11

    The native Relationship field doesn't store anything in the exp_channel_data table, which means you can't use the search:field="" parameter on it. This is true for the native channel:entries tag, and therefore for the low_alphabet:entries tag, too.

    Playa does store searchable data in said table, so if you were using that, you could.

    Instead, you could be looking at Low Search for filtering by Relationship, which would take an entry ID (or IDs), just like the category param.

    Note that Low Search can also filter by first letter, using the Field Search filter with the starts_with parameter.

  2. John Faulds 11 Nov 2014 02:20

    So I should be able to do

    child:location="{if segment_2=='location'}{segment_3}{/if}"

    in the exp:low_search:results tag? Because when I try that (or with parent:expert_location) I get no result for a URL like /template_group/location/XX

  3. Low 11 Nov 2014 07:28

    The Relationships filter only takes entry IDs as a parameter. However, I'll soon release an update which will make it accept url_titles, too.

  4. John Faulds 11 Nov 2014 07:49

    Sorry, didn't make it clear, in my example, XX, segment_3 is an entry_id.

  5. Low 11 Nov 2014 07:56

    Then using child:location="123" should give you all the entries that have entry ID 123 as a child through the relationship field named 'location'. So, that's entries that have the field 'location' in its publish form where entry ID 123 is selected.

  6. John Faulds 11 Nov 2014 08:27

    Hmm, not getting any results. Example code: http://pastie.org/9711174

  7. Low 11 Nov 2014 08:28

    I'll need to take a look myself. Please send SuperAdmin login credentials to hi at gotolow dot com if you can.

  8. John Faulds 11 Nov 2014 10:50

    Before I do that, can I just confirm that I can use the results tag without needing a form, that I can just link to URLs that should produce results?

  9. Low 11 Nov 2014 11:46

    Yes, you can use the Results tag as a replacement for the channel:entries tag.