Skip to content

Commit d7adacc

Browse files
authored
Merge pull request #913 from nep/patch-5
Update single-variables.md
2 parents 8509585 + e03a0c9 commit d7adacc

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

docs/templates/globals/single-variables.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,24 @@ Boolean (TRUE/FALSE) variable representing whether or not the template is being
128128
Boolean (TRUE/FALSE) variable representing whether or not the current request is a Live Preview from the control panel. Most commonly you would use this to add/hide information on your preview page for content authors:
129129

130130
{if is_live_preview_request}
131-
{!-- include sample rendering of a social share, Twitter card, FB post, etc. --}
131+
<span>DRAFT: Verify before publishing.</span>
132+
{/if}
133+
134+
You can also use this variable to control parameters within a tag, so that your preview template can show content that might not appear on the live site:
135+
136+
{if is_live_preview_request}
137+
{exp:channel:entries
138+
channel="events"
139+
limit="1"
140+
{if is_live_preview_request}
141+
status="open|archive|draft" show_future_entries="yes" show_expired="yes"
142+
{if:else}
143+
status="open"
144+
{/if}
145+
disable="category_fields|member_data|pagination"
146+
}
147+
{title}
148+
{/exp:channel:entries}
132149
{/if}
133150

134151
### `{lang}`
@@ -382,4 +399,4 @@ This variable pair is useful for displaying all errors at once, for example, in
382399
</ul>
383400
{if:else}
384401
<!-- No errors, or form not submitted yet -->
385-
{/if}
402+
{/if}

0 commit comments

Comments
 (0)