Created
February 23, 2019 13:05
-
-
Save alasvant/718253abacae7157d4750c5a8a212a02 to your computer and use it in GitHub Desktop.
Sample GTM selection factory to pre-populate category selection options (Episerver Forms demo).
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 EPiServer.Shell.ObjectEditing; | |
using System.Collections.Generic; | |
namespace AlloyWithFind.Business.SelectionFactories | |
{ | |
/// <summary> | |
/// Selection factory to return GTM category values for form submission event. | |
/// </summary> | |
public class GtmCategorySelectionFactory : ISelectionFactory | |
{ | |
/// <summary> | |
/// Gets the GTM category values. | |
/// </summary> | |
/// <param name="metadata"></param> | |
/// <returns>GTM category values</returns> | |
public IEnumerable<ISelectItem> GetSelections(ExtendedMetadata metadata) | |
{ | |
// not localized for now | |
return new List<ISelectItem> | |
{ | |
new SelectItem{ Text = "CustomerProfile", Value = "customerprofile"}, | |
new SelectItem{ Text = "Commercial", Value = "commercial"}, | |
new SelectItem{ Text = "Other", Value = "other"} | |
}; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment