Jonas Lindau
Sep 7, 2009
  5777
(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
Introducing Optimizely Graph Source .NET SDK

Overview Of Optimizely Graph Optimizely Graph is a cutting-edge, headless content management solution designed to integrate seamlessly with any...

Jake Minard | Oct 10, 2024

Content Search with Optimizely Graph

Optimizely Graph lets you fetch content and sync data from other Optimizely products. For content search, this lets you create custom search tools...

Dileep D | Oct 9, 2024 | Syndicated blog

Omnichannel Analytics Simplified – Optimizely Acquires Netspring

Recently, the news broke that Optimizely acquired Netspring, a warehouse-native analytics platform. I’ll admit, I hadn’t heard of Netspring before,...

Alex Harris - Perficient | Oct 9, 2024 | Syndicated blog

Problem with language file localization after upgrading to Optimizely CMS 12

Avoid common problems with xml file localization when upgrading from Optimizely CMS 11 to CMS 12.

Tomas Hensrud Gulla | Oct 9, 2024 | Syndicated blog