# Elements @if | @endif Not Always Updating in Elements

**URL:** <https://forums.realmacsoftware.com/t/elements-if-endif-not-always-updating-in-elements/47158>\
**Category:** Elements\
**Created:** [April 14, 2025, 1:26pm UTC](https://forums.realmacsoftware.com/t/elements-if-endif-not-always-updating-in-elements/47158 "2025-04-14T13:26:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![logrunner](https://avatars.discourse-cdn.com/v4/letter/l/59ef9b/32.png) [@logrunner](https://forums.realmacsoftware.com/u/logrunner)\
**Post date:** [April 14, 2025, 1:26pm UTC](https://forums.realmacsoftware.com/t/elements-if-endif-not-always-updating-in-elements/47158/1 "2025-04-14T13:26:17Z")

</div>

This is minor in the scheme of things but …

If I am editing Component PHP / HTML code (using Nova) in my DevPack and add in new @if | @else | @endif … statements, then when I save the Component DevPack PHP code, Elements doesn’t always action the @ commands but it will take any code PHP / HTML updates I have done and reflect these in the Elements Editor. This can be and is confusing! 😕

The sort of code I am referring to is like this:

```auto
@if(!edit)
value="<?= htmlspecialchars($value) ?>" readonly>
@else
value="Metadata will be here." readonly>
@endif

```

In the above example, I am changing the Edit output so that PHP code (which the Editor doesn’t action) is hidden in the Editor and gives the user more useful output.

I have found a work-around method is to save the PHP / HTML code and then change to a different webpage (i.e. not the one with the custom Component I am changing) and then go back again and then the update is taken.
