0

I am trying to put a multiple choice filter into a stash index and running into some issues. From the debug output it would appear that its a parse order issue as the debug match statement shows my low replace text instead of the filtered text. How can I set a stash list and use low replace on one of the variable inside the list? Low replace seems to work in a stash list when setting the variable but not in the index. Help is appreciated.

edit, premature comment below. This isn't fixed. EE 2.52 and here is my set list and index

{exp:stash:set_list name="event_result_list" parse_tags="yes" parse_depth="3" parse_conditionals="yes"} {exp:calendar:cal enable="custom_fields" calendar_name="events" pad_short_weeks="n" parse="inward" date_range_start="{exp:stash:get name='event-from' parse='inward' dynamic='yes'}" date_range_end="{exp:stash:get name='event-from' parse='inward' dynamic='yes'}" paginate="bottom"}{display_each_day}{events} {event_parent disable="" var_prefix="loc"} {exp:channel:entries entry_id="{loc:entry_id}" channel="events" sort="asc" orderby="event_start" dynamic="off" parse="inward"} {stash:index}{loc:event_eat_type}/,{loc:event_destination},/@{loc:categories show="not 205|213|225"}{category_name}@{/loc:categories}{/stash:index}

and here is my get list

{exp:stash:get_list name="event_result_list" match="#^({embed:search_type})/.*,{embed:search_destination},/.*@{embed:search_cat}@#" against="index" paginate="bottom" limit="10" parse="inward" orderby="item_title"}

the embed:search_destination is what I am having a problem with. If I put the .* in front I get matches where there is a single entry in the set list or a match if the secondary option matches ex if I was searching for 'option1' it would get a match if my index is set with ,option1, or if its set with ,option2,option1, But it won't match for ,option1,option2,

If I remove the .* it matches for the first option only. Clearly I am missing something. This was my secondary option to trying to use low_replace. The low replace option looked like this

{stash:index}{loc:event_eat_type}/@{exp:low_replace find="," replace="@" multiple="yes"}{loc:event_destination}{/exp:low_replace}@/@{loc:categories show="not 205|213|225"}{category_name}@{/loc:categories}{/stash:index}

With that low replace seemed to be falling behind in the parse order and that is literally what would end up in the index.

Help is appreciated and apologies for the confusion. Any more information I can provide let me know.

secondary edit, stash seems to not want to let me use 2 categories index fields. If I remove either embed:event_destination or embed:event_search_cat it works. Still need help and thanks.

edit 3 I appreciate you looking at this. stash sets the list, then I build the list using expressionengine calendar from solspace. In that channel there is a playa field that I then loop through to get other fields prefixed with loc:

Basically I have 2 channels and I have them linked together using playa. I need to apply filters dynamically to both the channels. For that reason I am building it out and pumping to stash and then filtering my stash dataset. Thanks again for the help.

5
  • A simplified code example and ee version would be helpful? Commented Aug 7, 2017 at 20:41
  • thanks for the reply. I will show my code and my fix. {stash:index}{loc:event_eat_type}/,{loc:event_destination},/@{loc:categories show="not 205|213|225"}{category_name}@{/loc:categories}{/stash:index} and then I filter like so ` {exp:stash:get_list name="event_result_list" match="#^({embed:search_type})/.*,{embed:search_destination},/.*@{embed:search_cat}@#" against="index" paginate="bottom" limit="10" parse="inward" orderby="item_title"}` I ended up modifying the multi select field type to only give me a comma, not comma and space. then in stash the comma is my delimeter
    – Jason L
    Commented Aug 7, 2017 at 23:25
  • What wraps the stash set list? You have "loc" prefix, but can't tell what that references. Commented Aug 8, 2017 at 0:54
  • added my edits above
    – Jason L
    Commented Aug 8, 2017 at 1:07
  • In my example above, when using an index can one of my search parameters be a regex match?
    – Jason L
    Commented Aug 8, 2017 at 12:19

1 Answer 1

0

It's a complicated scenario... Without refactoring everything, I would take a step back and test the output the individual variables you're setting in set_list within the index tag and making sure it's what's expected. Either output to page, or save the list and check the db or Mustash if you're using it.

Then test the get_list by hardcoding the regex match parameter with some of those index test results.

1
  • I have done that and the output seems good. When it doesn't work though I look through the EE debugging below page and the stash match line has my low_replace tags instead of the variable it creates. I seem to have splintered the issue. If I remove low replace is it not possible to have 2 sets of categories? One is an actual category from EE and the other is a multi-select I am trying to treat as categories. I can't seem to filter both at the same time. Thanks again.
    – Jason L
    Commented Aug 8, 2017 at 14:45

Your Answer

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

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