Display content only on a page with specific tag
- Applies to:
- All versions
- Role required:
- Draft Contributor
Conditionally display content only when a specific tag exists on a page.
- Open a page in Edit Mode.
- Select Style > DekiScript from the Editor toolbar.
- Copy the following code:
if ( map.contains(page.tags,"mytag") ){ "This text is only displayed if a page contains the tag listed above." } - Paste the code into the DekiScript block.
- Replace mytag with your desired tag.
- Replace the text within the curly brackets.
The conditional content can include CSS, HTML, or standard text.
Double quotes should only appear at the beginning and end of the conditional content. Double quotes within the conditional content will cause an error.
