0

I'm using the MVVC approach and all works well until I turn on fragment caching. This works, but of course does not offer any performance advantages.

`{exp:stash:set_list 
        name="tutorials" 
        parse_tags="yes"
        parse_conditionals="yes"
        parse_depth="2"
    }

        {exp:channel:entries 
            channel="tutorials"
            dynamic="no" 
            disable="member_data"
        }   
            {stash:item-entry-id}{entry_id}{/stash:item-entry-id}
            {stash:entry-title}{title}{/stash:entry-title}
            {exp:stash:set_list:nested 
                name="tags"
                context="{entry_id}"
                parse_tags="yes"
            }
                {exp:tagger:tags entry_id="{entry_id}"}
                    {stash:tag-url-name}{tagger:urlsafe_tagname}{/stash:tag-url-name}
                    {stash:tag-name}{tagger:tag_name}{/stash:tag-name}
                {/exp:tagger:tags}
        {/exp:channel:entries} 
    {/exp:stash:set_list}` 

If I set it to save using the following parameters, the tags are not shown anymore:

{exp:stash:set_list 
        name="tutorials" 
        parse_tags="yes"
        parse_conditionals="yes"
        parse_depth="2"
        save="yes"
        scope="site"
        refresh="5"
        replace="no"
    }

My layout template where I get the tags looks like this (other markup and stash data removed for clarity):

{exp:stash:get_list name="tutorials" paginate="bottom" limit="10"}
    <p class="custom meta">
    <span class="fa fa-tags">
    {exp:stash:get_list:nested 
        name="tags" 
        context="{item-entry-id}" 
        prefix="nested" 
        backspace="2"}
        <a href="/search/tag/{nested:tag-url-name}" rel="tag">{nested:tag-name}</a>,      
    {/exp:stash:get_list:nested}
{/exp:stash:get_list}               

I suspect it is caching the first set_list data before it actually parses the nested list that gets the tag data. I did try to use:

{stash:embed:layouts:listing-text parse_stage="both"}

But that didn't work.

Maybe this approach (using a set_list) isn't the best way to do this. The page is a listing of entries and I want to be able to use pagination and switchee cases to allow for displaying filtered content by category and tag using regex with switchee.

1 Answer 1

1

Try adding on your get_list tag scope=site I seem to recall this being a thing.

3
  • Thanks. I could swear I did try that and it didn't work. When I came back to it this morning it did have the scope parameter in there. When I set them all to site it works just like it should. Another reason to walk away from a problem, it was late, I was tired, and I must have missed something in my trial and error (not saving the file after adding scope?
    – Doug
    May 21, 2014 at 14:52
  • One other observation. It only works when set to "site". If I try to use local, the page uses the same memory and queries as when I don't save the list. I think I may need to pass along something else so it knows what page it is used on. For now "site" works and I don't think that will be a problem.
    – Doug
    May 21, 2014 at 14:54
  • I pushed the changes to development and I saw the same strange behavior. Tags would get lost on the second page load (loading the saved data). However since I saw that with local...didn't work, then a period of time late it did work...I figured it has something to do with the timing of the save data. It needs to go through a cycle before it works as it should. Sure enough, I left it for the 5 minutes I had set for "refresh" and now it is working correctly. Exactly why it works that way the first time I'm not sure. If it will happen again, also unsure.
    – Doug
    May 21, 2014 at 15:42

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.