Last active
April 8, 2018 02:23
-
-
Save croxton/e21f43549bbe6de4527b to your computer and use it in GitHub Desktop.
Stash caching example 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{!-- ============================================================================ --} | |
{!-- CONTENTS OF pages/index --} | |
{!-- ============================================================================ --} | |
{exp:stash:cache context="{global:env}" bundle="pages" replace="{global:stash_cache_replace}"} | |
{!-- embed the base layout --} | |
{stash:embed:view} | |
{!-- capture data --} | |
{exp:channel:entries | |
channel="pages" | |
limit="1" | |
disable="categories|member_data|pagination" | |
} | |
{exp:stash:set type="snippet"} | |
{stash:content_title}{title}{/stash:content_title} | |
{stash:content_entry_id}{entry_id}{/stash:content_entry_id} | |
{stash:content_channel_id}{channel_id}{/stash:content_channel_id} | |
{/exp:stash:set} | |
{/exp:channel:entries} | |
{/exp:stash:cache} | |
{!-- ============================================================================ --} | |
{!-- CONTENTS OF stash_templates/view --} | |
{!-- ============================================================================ --} | |
<html> | |
<body> | |
{exp:stash:block name="content"} | |
{!-- default layout for the 'content' block --} | |
<h1>{content_title}</h1> | |
{stash:nocache} | |
{exp:edit_this:entry {/stash:nocache}entry_id="{content_entry_id}" channel_id="{content_channel_id}"{stash:nocache}} | |
<a href="{edit_this_url}">Edit this</a> | |
{/exp:edit_this:entry} | |
{/stash:nocache} | |
{/exp:stash:block} | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment