Skip to content

Commit 1dae83d

Browse files
authored
Merge pull request #912 from nep/patch-6
Update preload-replacement.md
2 parents d101a4d + 9c76af7 commit 1dae83d

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

docs/templates/globals/preload-replacement.md

+21
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,24 @@ A common usage for preload replacements is to hold the Channel short name(s), to
3636
<h2>{title}</h2>
3737
{body}
3838
{/exp:channel:entries}
39+
40+
### Conditional Usage
41+
42+
You may want to combine this with EE's Live Preview functionality, so that your template can show content while you're in the control panel that you might not want to have appear on the live site:
43+
44+
{preload_replace:channels="news|reviews"}
45+
{if is_live_preview_request}
46+
{preload_replace:status_tag=" status='open|archive|draft' "}
47+
{if:else}
48+
{preload_replace:status_tag=" status='open' "}
49+
{/if}
50+
51+
{exp:channel:entries
52+
channel="{channels}"
53+
limit="10"
54+
{status_tag}
55+
disable="category_fields|member_data|pagination"
56+
}
57+
<h2>{title}</h2>
58+
{body}
59+
{/exp:channel:entries}

0 commit comments

Comments
 (0)