London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!

Jonas Lindau
Sep 7, 2009
  5839
(1 votes)

Is page in edit mode?

I’ve seen a lot of different ways to determine if the actual page is in edit mode. Since i’m a fan of extension methods, i couldn’t resist make my own. This have to be the shortest possible way to determine if page is in edit or not :)

 

public static bool IsPageInEditMode(this PageData page)
{
  return page.WorkPageID != 0;
}

 

To find out if the page is in edit:

bool x = CurrentPage.IsPageInEditMode()
Sep 07, 2009

Comments

Please login to comment.
Latest blogs
Notes on Optimizely Self-Optimizing Block

While the free A/B Testing might be dead , the Self-Optimizing Block is still alive and kicking. Here's some notes for those debugging it.  ...

Jacob Pretorius | Apr 29, 2025

Optimizely Product Recommendation Troubleshooting

In today’s fast-paced digital landscape, personalization is everything . Customers expect relevant, tailored experiences whenever they interact wit...

Sanjay Kumar | Apr 28, 2025

Natural Language Q&A in Optimizely CMS Using Azure OpenAI and AI Search

In Part 2, we integrated Azure AI Search with Azure Personalizer to build a smarter, user-focused experience in Optimizely CMS. We used ServiceAPI ...

Naveed Ul-Haq | Apr 25, 2025 |

Identifying Spike Requests and Issues in Application Insights

Sometimes within the DXP we see specific Azure App Instances having request spikes causing performance degredation and we need to investigate. I fi...

Scott Reed | Apr 25, 2025