I am using EE's next_entry tag to link to the next entry, and then using a stash/switchee combination to evaluate if we are at the last entry in the loop and if so use a channel entries loop to display the first entry.
Everything works fine and it does what I expect with the following code.
But when I turn on EE's template caching, I get a random string as follows:
{6ee64145dfa4ae5926a9c326266d5954499133923}
The problem seems to be inconsistent as this doesn't happen all the time. Template caching right now is at 60 minutes, but after clicking around a bit the string appears occasionally every few minutes and I haven't found a pattern to the issue.
Here's the block of code I'm using:
{exp:channel:next_entry channel="video" url_title="{segment_2}" orderby="date" sort="asc"}
{!-- If next_entry doesn't run then we are at the end of the loop so this stash won't be set --}
{exp:stash:set name="st_next_entry"}next{/exp:stash:set}
<span>Next: </span>
<a href="{path='{segment_1}'}">
{title}<span> ›</span>
</a>
{/exp:channel:next_entry}
{exp:stash:parse process="end"}
{switchee variable="{exp:stash:get name='st_next_entry' random}" parse="inward"}
{case value="next"}
{!-- Do Nothing, link to next entry is already displayed --}
{/case}
{case default="yes"}
{!-- Display start entry link, because the next_entry loop didn't run so stash value was left empty --}
{exp:channel:entries channel="video" dynamic="no" disable="categories|category_fields|member_data|pagination" status="open" limit="1" sort="asc"}
<span>Next Video: </span>
<a href="{url_title_path='{segment_1}'}">
{title}<span> ›</span>
</a>
<br />
{/exp:channel:entries}
{/case}
{/switchee}
{/exp:stash:parse}
I'm guessing that the {6ee64145dfa4ae5926a9c326266d5954499133923} string is actually a placeholder of some sort and that the template parser isn't getting around to filling in the proper value when I turn on the template caching.
Thank you for any assistance you can provide.
Also, if someone knows their way around EE's native tag caching options and how to use the cache="yes" refresh="60" parameters. Are they only for EE native tags, or can it be used across the board for any exp: tag, including also related_entries/reverse_related_entries tag pairs and the output of 3rd party plugins?
- oliver