# Conditional Statements

**URL:** <https://forums.realmacsoftware.com/t/conditional-statements/44213>\
**Category:** RapidWeaver Elements\
**Created:** [August 11, 2024, 1:28am UTC](https://forums.realmacsoftware.com/t/conditional-statements/44213 "2024-08-11T01:28:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bill](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/bill/32/107_2.png) [@Bill](https://forums.realmacsoftware.com/u/Bill)\
**Post date:** [August 11, 2024, 1:28am UTC](https://forums.realmacsoftware.com/t/conditional-statements/44213/1 "2024-08-11T01:28:52Z")

</div>

When trying the following conditional statements:

```auto
@if(edit)
  <h2 style="color:#9a27a1">Show this in Edit</h2><!-- Shows in Edit -->  
@elseif(preview)   
  <h2 style="color:#00ff00">Show this in Preview</h2><!-- Doesn't show in Preview -->
@else
  <h2 style="color:#ff0000">Show this in Publish</h2><!-- Shows in Preview & Publish -->
@endif

```

- The @ elseif(preview) is not showing up in Preview at all.

- The @ else is showing in both Preview & Publish - this really needs to only be for Publish things, as preview use case is often used to display informational messages, etc. Maybe a dedicated @ if / @ elseif (publish) would be clearer and easier when setting things up.

- the @ elseif(somecontrol) is Not showing in Edit when enabled, I used a switch

---

<div class="post-metadata">

**Author:** ![tpbradley](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/tpbradley/32/25503_2.png) [@tpbradley](https://forums.realmacsoftware.com/u/tpbradley)\
**Post date:** [August 12, 2024, 11:47am UTC](https://forums.realmacsoftware.com/t/conditional-statements/44213/2 "2024-08-12T11:47:03Z")

</div>

Hey @Bill, thanks for reporting this!

Great news, this is fixed in the next beta 😄

Cheers
