Created
March 22, 2018 18:04
-
-
Save NaibafCH/228c65c07999b229b57299c4492112f4 to your computer and use it in GitHub Desktop.
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
using System.Web; | |
using Foundation.DynamicPlaceholder.Pipelines.GetDynamicPlaceholderKeys; | |
using Sitecore.Data; | |
using Sitecore.Diagnostics; | |
using Sitecore.Mvc.Helpers; | |
using Sitecore.Mvc.Presentation; | |
namespace Foundation.DynamicPlaceholder.Helpers | |
{ | |
public static class SitecoreHelperExtension | |
{ | |
public static HtmlString DynamicPlaceholder(this SitecoreHelper helper, string placeholderName, ID placeholderSuffix) | |
{ | |
Assert.ArgumentNotNull(placeholderName, nameof(placeholderName)); | |
helper.CurrentRendering.Parameters[GetUniqueIdKeyWithinRendering.RenderingParameterKey] = placeholderSuffix.ToString(); | |
return helper.DynamicPlaceholder(new DynamicPlaceholderDefinition(placeholderName)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment