1

I'd massively appreciate a bit of help with the Stash ExpressionEngine plugin... I think it must be quite simple but feel like I've tried everything...

The {expertise} tag is an ExpressionEngine grid field and contains multiple grid rows. I want to store these in stash - it's working to store them once but is always replaced when I run it again... I want what's stored in stash to constantly append rather than blanking the variable and starting again each time is is run...

Any ideas?

Many thanks in advance for any help!

{exp:channel:entries channel="barristers" url_title="{segment_3}" status="open" sort="asc" disable="pagination"}

<p>Adding {title}'s full CV (all the skills)...</p>

{expertise}

{exp:stash:append scope="user" save="yes" name="skills" output="yes" replace="no"}
{expertise:row_id},
{/exp:stash:append}

{/expertise}

<p>IN SESSION: {exp:stash:get name="skills"}</p>

{/exp:channel:entries} 
1

I would wrap the grid field with stash set_list instead of append. You can add output="yes" to view what's being set in the database with the set_list (or better yet, check out Mustash).

{exp:channel:entries channel="barristers" url_title="{segment_3}" status="open" sort="asc" disable="pagination" limit="1"}

    Adding {title}'s full CV (all the skills)...

    {exp:stash:set_list
        name="skills" 
        scope="user" 
        save="yes" 
        replace="no" 
        parse_tags="yes"
    }
        {expertise}
            {stash:expertise_row_id}{expertise:row_id}{/stash:expertise_row_id}
        {/expertise}
    {/exp:stash:set_list}


    IN SESSION: 
        {exp:stash:get_list 
            name="skills"
            scope="user"
            backspace="2"
        }
            {expertise_row_id}, 
        {/exp:stash:get_list}

{/exp:channel:entries}

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.