0

Here writing again because I do not know how to solve a problem.

I'm using Super Search and trying to search inside a channel using a keywords from other channel:

{exp:channel:entries channel="channel-1" limit="1"}

    {exp:super_search:results channel="channel-2" search="keywords={channel-1-custom-field}"}
        {title}</br>
        {channel-2-custom-field}
    {/exp:super_search:results}

{/exp:channel:entries}

{super_search_total_results} works and gets the number of results. I want to know how to get {channel-2-custom-field} and {title} from channel 2.

Thanks in advance.

1 Answer 1

1

Since Super Search uses the same Library as the {exp:channel:entries} tag pair, they share similar variable names. The outer {exp:channel:entries} tag pair would parse first, followed by the inner {exp:super_search:results} tag. This would be why {title}, for example, parses to the outer {exp:channel:entries} value.

In other words, the issue is similar to nesting two {exp:channel:entries} tag pairs inside each other: you can't do that, or at least EE won't parse correctly.

One way around this is to place the {exp:super_search:results} code in an embed tag (and pass your {channel-1-custom-field} variable in the embed). This avoids parsing order issues and variable clashes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.