0

Problem:

A value set is not parsed inside a channel:entries tag.

The value is actually set (and parsed with the embed on the page).

Also, when I hard-code the value in te channel:entries tag the result appears, so there is nothing wrong with the channel code.

I want get this value:

{exp:stash:set
     name="MedlemLetterAuthor"
 }
    {exp:channel:entries
        channel="member_profiles"
        dynamic_parameters="search:member_letter"
        orderby="title"
        sort="asc"
        dynamic="off"}
    {author_id}|
    {/exp:channel:entries}
 {/exp:stash:set}

This is my embed:

begin test
    just for testing: {exp:stash:get
         name="MedlemLetterAuthor"
     }
end test

{exp:stash:parse
process="end"
trim="yes"}



        {exp:channel:entries
                            channel="kcvast_arbet|kcvast_offentlig"
                            disable="pagination|category-fields|member-data"
                            dynamic="no"
                            author_id="{stash:MedlemLetterAuthor}"
                            orderby="author_id"
                            parse="inward"
                            }
                            {off-gest-bilder
                            cover_only="yes"
                            }some channel code here
    {/exp:channel:entries}

This appears on my page

begin test
    just for testing: 

        8|

        46|


end test

2 Answers 2

1

In your embed code you have pasted it looks like you have an extra pipe character in your author_id parameter

author_id="{stash:get name="MedlemLetterAuthor"}|"parse="inward"

makes it a little hard to understand what the code is supposed to be. Perhaps its just a typo. The other thing to try would be what is suggested in this thread.

https://devot-ee.com/add-ons/support/stash/viewthread/7166

Sometimes I find using single quotes within double quotes of parameters helps as well for example

author_id="{stash:get name='MedlemLetterAuthor'}"
7
  • Thanks. The extra pipeline is there because the result can be more then one author_id and the tag accepts that (checked that by hardcoding it)
    – Hansl
    Commented Jan 11, 2016 at 11:55
  • I have seen the methode used in the discussion you mention and checked that out, but, I will test that solution again.
    – Hansl
    Commented Jan 11, 2016 at 11:56
  • Still confused on the pipe. Stash would output whatever is in it and then the pipe would be added after it. So if stash held multiple authors wouldn't it output author_id="author1author2author3|"
    – Phil
    Commented Jan 12, 2016 at 17:32
  • You are absolute right about the pipeline, it sould be inside what Stash picks up, not in output. (was typo from earlier version ;-)
    – Hansl
    Commented Jan 13, 2016 at 18:08
  • But, unfortunately this example does noting for me, I edited the example with the code I use now.
    – Hansl
    Commented Jan 13, 2016 at 18:09
0

Looking at the output the stash is capturing white space and EE doesn't like that for var values.

When setting your initial stash, add the param trim="yes" - this will remove any whitespace.

Update Your stash var: MedlemLetterAuthor should output in 1 line: 1|38|9999 etc. As I wrote initially add the trim to THE FIRST SET STASH!!!!!!

2
  • I am sorry to report that did did not help.
    – Hansl
    Commented Jan 16, 2016 at 13:06
  • Add the trim part to your first stash where you aet the var - not the parse stash. Commented Jan 17, 2016 at 1:13

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.