-
Notifications
You must be signed in to change notification settings - Fork 20
{exp:stash:copy}
Mark Croxton edited this page Jun 21, 2013
·
6 revisions
Makes a copy of an existing variable. By default the cloned variable will be created with the same scope, context and type of the original, but that can be changed. Currently, only variables assigned to the default bundle can be copied.
{exp:stash:set name="foo"}bar{/exp:stash:set}
{!-- make an identical copy --}
{exp:stash:copy name="foo" copy_name="foo_copy"}
{!-- copy the value but set an new context, type and scope for the copied variable --}
{exp:stash:copy
name="foo"
copy_name="foo_copy2"
copy_scope="site"
copy_context="foo"
copy_type="snippet"
}
{!-- prints "bar" --}
{exp:stash:get name="foo_copy"}
{!-- prints "bar" --}
{exp:stash:get name="foo_copy2" scope="site" context="foo" type="snippet"}
The name of the original.
The scope of the original.
The context of the original.
The type of the original.
The name of the copy.
The scope of the copy.
The context of the copy.
The type of the copy.
Getting started
Using Stash
Using Mustash
- Mustash
- Installing Mustash
- Managing variables
- Managing bundles
- Cache-breaking rules
- Mustash plugins
- Mustash Varnish plugin
- Mustash plugin development
- Mustash API
Template design patterns
Tag reference
- {exp:stash:set}
- {exp:stash:get}
- {exp:stash:block}
- {exp:stash:set_value}
- {exp:stash:append}
- {exp:stash:append_value}
- {exp:stash:prepend}
- {exp:stash:prepend_value}
- {exp:stash:copy}
- {exp:stash:context}
- {exp:stash:is_empty}
- {exp:stash:not_empty}
- {exp:stash:set_list}
- {exp:stash:get_list}
- {exp:stash:append_list}
- {exp:stash:prepend_list}
- {exp:stash:split_list}
- {exp:stash:join_lists}
- {exp:stash:list_count}
- {exp:stash:unset}
- {exp:stash:flush_cache}
- {exp:stash:bundle}
- {stash:embed}
- {exp:stash:extend}
- {exp:stash:parse}
- {exp:stash:cache}
- {exp:stash:static}
- {exp:stash:finish}
- {exp:stash:not_found}
- Short tag syntax
- Using Stash methods in your own add-ons