Skip to content

Instantly share code, notes, and snippets.

@NaibafCH
Created March 22, 2018 18:04
Show Gist options
  • Save NaibafCH/228c65c07999b229b57299c4492112f4 to your computer and use it in GitHub Desktop.
Save NaibafCH/228c65c07999b229b57299c4492112f4 to your computer and use it in GitHub Desktop.
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