Come build with us.
Stacks API v6 for Stacks 2.5
%[if edit]% %[endif]%
%[if edit]% %[endif]%
%[if edit]%
any content
%[endif]%
or
%[if !edit]%
any content
%[endif]%
Enable content specifically for Edit Mode or specifically for Preview/Publish Mode.
Some content is not appropriate for display in Edit mode and other content is not appropriate for being published. You can limit the display of the content to a specific mode by using conditionals. You can use conditionals in any type of template (HTML, CSS, JS, etc.). Using a conditional to disable the display of certain elements with CSS is a good way to keep the user focused on the content that needs to be edited.
Warning: Do not place conditionals around editable content or containers (i.e. don't wrap %slice%, %text%, or %html% in a conditional.
#%id% .fancyStuff {
%[if edit]%
display:none;
%[endif]%
%[if !edit]%
display:block;
%[endif]%
}
%[if !edit]%
<span>This will not appear in edit mode!</span>
%[endif]%