Exemple #1
0
        /// <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;
        }
Exemple #2
0
 public static Umbraco.Core.Models.Blocks.BlockListModel GetAccordionBlocks(IAccordion that) => that.Value <Umbraco.Core.Models.Blocks.BlockListModel>("accordionBlocks");
Exemple #3
0
 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"));
 }