0

Is it possible to override the inclusive_categories parameter with a search string? I want to use inclusive_categories for every case except for when a search string is passed to the results template. For example, this is my template:

{exp:super_search:results inclusive_categories="yes"}
    Results
{/exp:super_search:results}

And I want to pass a search string to the results template and set inclusive_categories="no". So I tried this string which does not work:

/search/locations/search?&channel=locations&XID={XID_HASH}&category=category1+category2&inclusive_categories=no

Any ideas on how to approach this?

0

Please excuse my ignorence if I've got you wrong, but are you simply asking how to get a value from the URL and put it into the results tag parameters?

I'm not 100% familiar with super search however I assume it allows the rest of the URL to be processed as a search request? channel, category, XID (ect)?

Also, in your code example you are seperating parameters with &, is this in fact &?

Back to the question and assuming the above, you could use PHP to query the GET values, set your template to PHP on Input :

<?php
    $incCat = strtolower( ee()->input->get('inclusive_categories', true) );
    $incCat = !in_array($incCat, array( 'no', 'false', '0', 'off' ) );
?>

{exp:super_search:results inclusive_categories="<?php echo ( $incCat ? 'yes' : 'no' ); ?>"}
    {!-- Results --}
{/exp:super_search:results}
| improve this answer | |
0

You could use an if statement to override the inclusive_categories parameter.

If your search string is in the url and assuming inclusive_categories has "no" as a default value, you could do something like this:

   {exp:super_search:results {if segment_x}inclusive_categories="yes"{/if}}
    Results
   {/exp:super_search:results}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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