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

Support archive

Can I get the row_id of a matrix field in my Low Search Results?

onebrightlight 13 Nov 2013 11:57 question, complete

I currently have some education slides being served up via matrix fields within an entry, and the url is using their row_id for permalinks to each "slide"/row. I'm curious if there's a way for me to get at the row_id with 3.0.0, as the user will rarely land on the correct page if I can't.

Replies

  1. Low 13 Nov 2013 12:02

    Low Search won't return the row_id, no. But you could use the {low_search_search:field:column} var in the Matrix search-param and filter the rows like that, which would likely get you to the right row_id.

  2. onebrightlight 13 Nov 2013 12:04

    Yeah, I was thinking that might help, I'll just limit it to one result as well; that'll probably get it 99% of the time.

  3. onebrightlight 13 Nov 2013 12:24

    Oh, but just so I'm clear, with {low_search_search:field:column}, it would be changed to {low_search_search:my_field_name:my_field_column_name}, correct?

  4. onebrightlight 13 Nov 2013 12:42

    Also, did your tags for this change? I can find low_search_search information on a cached page from Google, but not on the updated documents. Not entirely sure how I should use this variable after all.

  5. Low 13 Nov 2013 12:45

    Oh, but just so I'm clear, with {low_search_search:field:column}, it would be changed to {low_search_search:my_field_name:my_field_column_name}, correct?


    Correct, as per the Field Search filter parameters.

    Also, did your tags for this change? I can find low_search_search information on a cached page from Google, but not on the updated documents. Not entirely sure how I should use this variable after all.


    Read this: http://gotolow.com/addons/low-search/...
    All parameters follow these rules.

  6. onebrightlight 13 Nov 2013 13:02

    Okay, weird. When I have a results tag like this:

     
    {exp:low_search:results collection="education_sections"}
    <!-- Testing for output: {low_search_search:education_slide:subsection_body} -->
    <p><b><a href="{entry_id_path='get-involved/forum'}">{title}</a></b><br>
    {low_search_excerpt}</p>
    {/exp:low_search:results}


    the test for output isn't getting anything back, and field and column names are correct.

    Is there something painfully obvious I'm missing on the parameters page? If I can't get a value from it as a tag alone, I wouldn't think it'll work with a matrix search parameter, either.

  7. Low 13 Nov 2013 13:04

    Okay, then what does your Form tag look like? You can use http://pastie.org/ or http://pastebin.com/ for large chunks of code.

  8. onebrightlight 13 Nov 2013 13:49

    The code in question is here: https://gist.github.com/64783831bf900... starting at line 13 and ending around 31.

  9. Low 13 Nov 2013 13:51

    The {low_search_search:education_slide:subsection_body} is only available if you also have an input field (or parameter) named search:education_slide:subsection_body. You're using Keywords, so you'd have to use the variable {low_search_keywords} instead.

  10. onebrightlight 13 Nov 2013 14:07

    So if I use it as a parameter as seen here, I should be able to parse the {low_search_search:education_slide:subsection_body} tag and see something, correct? https://gist.github.com/58ebd4771045d... I'm currently returning results, but the commented tag is parsing blank.

  11. Low 13 Nov 2013 14:18

    search:education_slide:subsection_body="foo"
    will generate a var:
    {low_search_search:education_slide:subsection_body}
    that outputs
    foo

    Really, just what I explained here: http://gotolow.com/addons/low-search/...

    Since you're not using the parameter as an input field in your form at all, just stick to using {low_search_keywords}.

  12. onebrightlight 13 Nov 2013 14:23

    Gotcha, sorry for the round n' round. I shouldn't be coding at these hours. :) So then I should just do a matrix field search for each result, searching for the keyword, then? That seems easy enough. Sorry again.

  13. Low 13 Nov 2013 14:24

    So then I should just do a matrix field search for each result, searching for the keyword, then?


    Exactly.