Do you have a IPageViewModel - or a similar design to AlloyTech templates? You could have something similar with PageContextActionFilter where you can change the Model before it gets to the View (see OnResultExecuting in AlloyTech for inspiration). There, you could check PageEditing.PageIsInEditMode and set the value to something or null based on that.
Or have I misunderstood your intention?
Hello! I need to add code to a page load event or something similar but only in edit mode. Is there any way to do this without adding it to every single controller on the site. And I just want to render it to the CMS and not save it to the database.