/// <summary> /// Intialize Accordion item /// </summary> public AccordionRepository() { Item dynamicAccordion = RenderingContext.Current.Rendering.Item; if (dynamicAccordion == null) { throw new ArgumentNullException(nameof(dynamicAccordion)); } this.Item = dynamicAccordion; this.Id = $"accordion-{Guid.NewGuid().ToString("N")}"; IAccordion accordiontems = ScContext.Cast <IAccordion>(dynamicAccordion); this.AccordionHeading = accordiontems.Title; }
public static Umbraco.Core.Models.Blocks.BlockListModel GetAccordionBlocks(IAccordion that) => that.Value <Umbraco.Core.Models.Blocks.BlockListModel>("accordionBlocks");
public static string GetOpenOptions(IAccordion that) => that.Value <string>("openOptions");
/// <summary>Static getter for Items</summary> public static IEnumerable <IPublishedContent> GetItems(IAccordion that) { return(that.GetPropertyValue <IEnumerable <IPublishedContent> >("items")); }