Created
June 3, 2015 21:49
-
-
Save chrismrgn/e18842da251747eea767 to your computer and use it in GitHub Desktop.
Testing if a PublicationTarget is SiteEdit Enabled in the Razor Mediator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@{ | |
var pubTargetIsSiteEditEnabled = false; | |
var engine = TridionHelper.Engine; | |
var publishContext = engine.PublishingContext; | |
var appData= publishContext.PublicationTarget.LoadAllApplicationData(); | |
foreach (var appDataItem in appData) | |
{ | |
if(Encoding.UTF8.GetString(appDataItem.Data).Contains("http://www.sdltridion.com/2011/SiteEdit")) | |
pubTargetIsSiteEditEnabled = true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment