Exception in template (Designs/miracle42/Paragraph/Accordion.cshtml): System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.efafbeafadb.Execute()
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context)
   at RazorEngine.Templating.TemplateService.Run(ITemplate template, DynamicViewBag viewBag)
   at RazorEngine.Templating.TemplateService.Parse(String razorTemplate, Object model, DynamicViewBag viewBag, String cacheName)
   at RazorEngine.Razor.Parse[T](String razorTemplate, T model, String cacheName)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()
@using Dynamicweb.Content.Items @using Co3.Espresso.Base.Models @using Co3.Espresso.Base.Extensions @using Co3.Espresso.Website.Models.FrontEnd @using Co3.Espresso.Website.Models.FrontEnd.Elements @using Co3.Espresso.Website.Models.FrontEnd.Paragraphs @inherits Co3.Espresso.Website.TemplateBases.Paragraphs.ImageTextTopBottom @{ bool HideOnDesktop = Espresso.Item.HideOnDesktop == "True"; bool HideOnPhone = Espresso.Item.HideOnPhone == "True"; if ( HideOnDesktop ) { Espresso.Container.ClassList.Add( "d-lg-none" ); } if ( HideOnPhone ) { Espresso.Container.ClassList.Add( "d-none" ); if ( !HideOnDesktop ) { Espresso.Container.ClassList.Add( "d-lg-block" ); } } Espresso.Wrapper.ClassList.Clear(); ClassList AccordionItemClassList = new ClassList(); ClassList AccordionItemBorderStyleClassList = new ClassList(); ClassList AccordionItemToggleClassList = new ClassList(); ClassList AccordionItemToggleTextClassList = new ClassList(); ClassList AccordionItemToggleIconClassList = new ClassList(); ClassList AccordionItemContentClassList = new ClassList(); AccordionItemClassList.AddClasses("p-accordion-item"); if( Espresso.Page.Item.GetValue<bool>("ContentAnimate") == true ) { AccordionItemClassList.AddClasses("js-e-scroll-reveal"); } Espresso.Container.ClassList.RemoveClasses("p-imagetext"); Espresso.Container.ClassList.AddClasses("p-accordion"); string AccordionBorderStyle = string.Empty; if( Espresso.Item.Border == "top-bottom" ) { if( Espresso.Item.Margin != "none" && string.IsNullOrEmpty( Espresso.Item.Margin ) == false ) { AccordionBorderStyle = "horizontal-spaced"; } else{ AccordionBorderStyle = "horizontal-condensed"; } } else if( Espresso.Item.Border == "top-bottom-left-right" ) { if( Espresso.Item.Margin != "none" && string.IsNullOrEmpty( Espresso.Item.Margin ) == false ) { AccordionBorderStyle = "around-spaced"; } else{ AccordionBorderStyle = "around-condensed"; } } else{ if( Espresso.Item.Margin != "none" && string.IsNullOrEmpty( Espresso.Item.Margin ) == false ) { AccordionBorderStyle = "none-spaced"; } else{ AccordionBorderStyle = "none-condensed"; } } if( Espresso.Item.TextColor != "" && Espresso.Item.TextColor != "auto" ) { Espresso.Wrapper.ClassList.AddClasses( "e-text-" + Espresso.Item.TextColor ); } if( AccordionBorderStyle == "horizontal-spaced" ) { AccordionItemClassList.AddClasses("border border-right-0 border-left-0"); } else if( AccordionBorderStyle == "horizontal-condensed" ) { AccordionItemClassList.AddClasses("border border-right-0 border-left-0"); } else if( AccordionBorderStyle == "around-spaced" ) { AccordionItemClassList.AddClasses("border rounded"); } else if( AccordionBorderStyle == "around-condensed" ) { AccordionItemClassList.AddClasses("border"); } if( Espresso.Item.BorderColor != "auto" && Espresso.Item.BorderColor != "" ) { Espresso.Wrapper.ClassList.AddClasses( "border-" + Espresso.Item.BorderColor ); AccordionItemClassList.AddClasses( "border-" + Espresso.Item.BorderColor ); } if( Espresso.Item.BackgroundColor != "" && Espresso.Item.BackgroundColor != "none" ) { AccordionItemClassList.AddClasses( "bg-" + Espresso.Item.BackgroundColor ); } if( Espresso.Item.IconColor != "" && Espresso.Item.IconColor != "auto" ) { AccordionItemToggleIconClassList.AddClasses( "text-" + Espresso.Item.IconColor ); } if( Espresso.Item.ToggleTextColor != "" && Espresso.Item.ToggleTextColor != "auto" ) { AccordionItemToggleTextClassList.AddClasses( "text-" + Espresso.Item.ToggleTextColor ); } if( Espresso.Item.PaddingHorizontal == "sm" ) { AccordionItemToggleClassList.AddClasses("px-1"); AccordionItemContentClassList.AddClasses("px-1"); } else if( Espresso.Item.PaddingHorizontal == "md" ) { AccordionItemToggleClassList.AddClasses("px-2"); AccordionItemContentClassList.AddClasses("px-2"); } else if( Espresso.Item.PaddingHorizontal == "lg" ) { AccordionItemToggleClassList.AddClasses("px-3"); AccordionItemContentClassList.AddClasses("px-3"); } else { AccordionItemToggleClassList.AddClasses("px-0"); AccordionItemContentClassList.AddClasses("px-0"); } if( Espresso.Item.PaddingVertical == "sm" ) { AccordionItemToggleClassList.AddClasses("py-1"); AccordionItemContentClassList.AddClasses("pb-1"); } else if( Espresso.Item.PaddingVertical == "md" ) { AccordionItemToggleClassList.AddClasses("py-2"); AccordionItemContentClassList.AddClasses("pb-2"); } else if( Espresso.Item.PaddingVertical == "lg" ) { AccordionItemToggleClassList.AddClasses("py-3"); AccordionItemContentClassList.AddClasses("pb-3"); } if( Espresso.Item.Margin == "sm" ) { AccordionItemClassList.AddClasses("mb-1"); } else if( Espresso.Item.Margin == "md" ) { AccordionItemClassList.AddClasses("mb-2"); } else if( Espresso.Item.Margin == "lg" ) { AccordionItemClassList.AddClasses("mb-3"); } else { AccordionItemClassList.AddClasses("mb-0"); } AccordionItemToggleClassList.AddClasses("d-flex align-items-center m-0 collapsed"); AccordionItemToggleTextClassList.AddClasses("line-height-sm"); if ( Espresso.Item.ToggleTextStyle != "" && Espresso.Item.ToggleTextStyle != "none" ) { AccordionItemToggleTextClassList.AddClasses( Espresso.Item.ToggleTextStyle ); AccordionItemToggleTextClassList.AddClasses( "my-0" ); } if( Espresso.Item.IconPosition == "right" ) { AccordionItemToggleClassList.AddClasses("justify-content-between"); AccordionItemToggleIconClassList.AddClasses("ml-1 order-last"); } else { AccordionItemToggleIconClassList.AddClasses("mr-1 order-first"); } } <div class="@Espresso.Container.ClassList" id="@Espresso.Id"> @if ( string.IsNullOrEmpty( Espresso.Text.Raw ) == false ) { <div class="p-accordion-lead"> @Espresso.Text.Raw </div> } <div class="p-accordion-container @Espresso.Wrapper.ClassList"> @{ int AccordionItemLoopCounter = 1; } @foreach( dynamic AccordionItem in Espresso.Item.AccordionItems ) { EspressoImage AccordionItemImage = new EspressoImage( AccordionItem.Item ); AccordionItemImage.Width = 640; AccordionItemBorderStyleClassList.Clear(); if( AccordionBorderStyle == "horizontal-spaced" ) { AccordionItemBorderStyleClassList.AddClasses(""); } else if( AccordionBorderStyle == "horizontal-condensed" ) { if( AccordionItemLoopCounter != Espresso.Item.AccordionItems.Count ) { AccordionItemBorderStyleClassList.AddClasses("border-bottom-0"); } } else if( AccordionBorderStyle == "around-spaced" ) { AccordionItemClassList.AddClasses("border rounded"); } else if( AccordionBorderStyle == "around-condensed" ) { if( AccordionItemLoopCounter != Espresso.Item.AccordionItems.Count ) { AccordionItemBorderStyleClassList.AddClasses("border-bottom-0"); } if( AccordionItemLoopCounter == 1 ) { AccordionItemBorderStyleClassList.AddClasses("rounded-top"); } else if( AccordionItemLoopCounter == Espresso.Item.AccordionItems.Count ) { AccordionItemBorderStyleClassList.AddClasses("rounded-bottom"); } } else if( AccordionBorderStyle == "none-spaced" ) { AccordionItemClassList.AddClasses("rounded"); } else if( AccordionBorderStyle == "none-condensed" ) { if( AccordionItemLoopCounter == 1 ) { AccordionItemBorderStyleClassList.AddClasses("rounded-top"); } else if( AccordionItemLoopCounter == Espresso.Item.AccordionItems.Count ) { AccordionItemBorderStyleClassList.AddClasses("rounded-bottom"); } } <div class="@AccordionItemClassList @AccordionItemBorderStyleClassList"> <div class="p-accordion-toggle"> <p data-toggle="collapse" data-target="#e-accordion-@Espresso.Id-@AccordionItem.Item.Id" class="@AccordionItemToggleClassList"> <span class="p-accordion-toggle-text @AccordionItemToggleTextClassList"> @AccordionItem.Heading </span> <i class="material-icons p-accordion-toggle-icon @AccordionItemToggleIconClassList">add</i> </p> </div> <div id="e-accordion-@Espresso.Id-@AccordionItem.Item.Id" class="collapse"> <div class="@AccordionItemContentClassList p-accordion-content"> @if( @AccordionItemImage.URL != "" ) { <div class="row no-gutters justify-content-@AccordionItem.ImageAlignmentHorizontal"> <div class="col-@AccordionItem.ImageScale"> <p class="p-img-container"> <img src="@AccordionItemImage.URL" class="p-img" alt="@AccordionItem.Heading"> </p> </div> </div> } <div class="p-txt-container"> @AccordionItem.Text </div> </div> </div> </div> AccordionItemLoopCounter++; } </div> </div>
keyboard_arrow_up