Created
July 27, 2012 18:26
-
-
Save SitefinityGuru/3189612 to your computer and use it in GitHub Desktop.
Hideable Sitefinity Content Block Widget
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
public class HideableContentBlock : ContentBlock | |
{ | |
protected override void Render(System.Web.UI.HtmlTextWriter writer) | |
{ | |
// always render in page editor | |
if (this.IsDesignMode() || this.IsPreviewMode()) | |
{ | |
base.Render(writer); | |
return; | |
} | |
// exit if parameters are found | |
var urlParam = this.GetUrlParameters(); | |
if (urlParam != null && urlParam.Length > 0) return; | |
base.Render(writer); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Be sure to include the namespace System.Web.UI