Error executing template "Designs/rybners/Paragraph/Accordion.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_1c0a6815e6ba4c87931b8bebeee1c3bd.Execute() in C:\inetpub\wwwroot\rybners_2022.espresso4.dk\Files\Templates\Designs\rybners\Paragraph\Accordion.cshtml:line 156
at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer)
at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
at Dynamicweb.Rendering.Template.RenderRazorTemplate()
1 @using Dynamicweb.Content.Items
2 @using Co3.Espresso.Base.Models
3 @using Co3.Espresso.Base.Extensions
4 @using Co3.Espresso.Website.Models.FrontEnd
5 @using Co3.Espresso.Website.Models.FrontEnd.Elements
6 @using Co3.Espresso.Website.Models.FrontEnd.Paragraphs
7 @inherits Co3.Espresso.Website.TemplateBases.Paragraphs.ImageTextTopBottom
8 @{
9 Espresso.Wrapper.Classes.Clear();
10 ClassList AccordionLeadClassList = new ClassList();
11 ClassList AccordionItemClassList = new ClassList();
12 ClassList AccordionItemBorderStyleClassList = new ClassList();
13 ClassList AccordionItemToggleClassList = new ClassList();
14 ClassList AccordionItemToggleTextClassList = new ClassList();
15 ClassList AccordionItemToggleIconClassList = new ClassList();
16 ClassList AccordionItemContentClassList = new ClassList();
17 AccordionLeadClassList.AddClasses( "p-accordion-lead" );
18 AccordionItemClassList.AddClasses("p-accordion-item");
19 20 Espresso.Container.Classes.RemoveClasses( "p-imagetext p-imagetext-tb p-imagetext-lr" );
21 Espresso.Container.Classes.AddClasses("p-accordion");
22 23 string AccordionBorderStyle = string.Empty;
24 if( Espresso.Item.Border == "top-bottom" ) {
25 if( Espresso.Item.Margin != "none" && string.IsNullOrEmpty( Espresso.Item.Margin ) == false ) {
26 AccordionBorderStyle = "horizontal-spaced";
27 }
28 else{
29 AccordionBorderStyle = "horizontal-condensed";
30 } }
31 else if( Espresso.Item.Border == "top-bottom-left-right" ) {
32 if( Espresso.Item.Margin != "none" && string.IsNullOrEmpty( Espresso.Item.Margin ) == false ) {
33 AccordionBorderStyle = "around-spaced";
34 }
35 else{
36 AccordionBorderStyle = "around-condensed";
37 }
38 }
39 else{
40 if( Espresso.Item.Margin != "none" && string.IsNullOrEmpty( Espresso.Item.Margin ) == false ) {
41 AccordionBorderStyle = "none-spaced";
42 }
43 else{
44 AccordionBorderStyle = "none-condensed";
45 }
46 }
47 if( Espresso.Item.TextColor != "" && Espresso.Item.TextColor != "auto" ) {
48 AccordionItemContentClassList.AddClasses( "e-text-" + Espresso.Item.TextColor );
49 }
50 if( AccordionBorderStyle == "horizontal-spaced" ) {
51 AccordionItemClassList.AddClasses("border border-right-0 border-left-0");
52 }
53 else if( AccordionBorderStyle == "horizontal-condensed" ) {
54 AccordionItemClassList.AddClasses("border border-right-0 border-left-0");
55 }
56 else if( AccordionBorderStyle == "around-spaced" ) {
57 AccordionItemClassList.AddClasses("border rounded");
58 }
59 else if( AccordionBorderStyle == "around-condensed" ) {
60 AccordionItemClassList.AddClasses("border");
61 }
62 if( Espresso.Item.BorderColor != "auto" && Espresso.Item.BorderColor != "" ) {
63 Espresso.Wrapper.Classes.AddClasses( "border-" + Espresso.Item.BorderColor );
64 AccordionItemClassList.AddClasses( "border-" + Espresso.Item.BorderColor );
65 }
66 if( Espresso.Item.BackgroundColor != "" && Espresso.Item.BackgroundColor != "none" && Espresso.Item.BackgroundColor != "auto" ) {
67 AccordionItemClassList.AddClasses( "e-theme-" + Espresso.Item.BackgroundColor );
68 }
69 if( Espresso.Item.IconColor != "" && Espresso.Item.IconColor != "auto" ) {
70 AccordionItemToggleIconClassList.AddClasses( "e-text-" + Espresso.Item.IconColor );
71 }
72 if( Espresso.Item.ToggleTextColor != "" && Espresso.Item.ToggleTextColor != "auto" ) {
73 AccordionItemToggleTextClassList.AddClasses( "e-text-" + Espresso.Item.ToggleTextColor );
74 }
75 76 if( Espresso.Item.PaddingHorizontal == "sm" ) {
77 AccordionItemToggleClassList.AddClasses("px-1");
78 AccordionItemContentClassList.AddClasses("px-1");
79 }
80 else if( Espresso.Item.PaddingHorizontal == "md" ) {
81 AccordionItemToggleClassList.AddClasses("px-2");
82 AccordionItemContentClassList.AddClasses("px-2");
83 }
84 else if( Espresso.Item.PaddingHorizontal == "lg" ) {
85 AccordionItemToggleClassList.AddClasses("px-3");
86 AccordionItemContentClassList.AddClasses("px-3");
87 }
88 else {
89 AccordionItemToggleClassList.AddClasses("px-0");
90 AccordionItemContentClassList.AddClasses("px-0");
91 }
92 93 if( Espresso.Item.PaddingVertical == "sm" ) {
94 AccordionItemToggleClassList.AddClasses("py-1");
95 AccordionItemContentClassList.AddClasses("pb-1");
96 }
97 else if( Espresso.Item.PaddingVertical == "md" ) {
98 AccordionItemToggleClassList.AddClasses("py-2");
99 AccordionItemContentClassList.AddClasses("pb-2");
100 }
101 else if( Espresso.Item.PaddingVertical == "lg" ) {
102 AccordionItemToggleClassList.AddClasses("py-3");
103 AccordionItemContentClassList.AddClasses("pb-3");
104 }
105106 if( Espresso.Item.Margin == "sm" ) {
107 AccordionItemClassList.AddClasses("mb-1");
108 }
109 else if( Espresso.Item.Margin == "md" ) {
110 AccordionItemClassList.AddClasses("mb-2");
111 }
112 else if( Espresso.Item.Margin == "lg" ) {
113 AccordionItemClassList.AddClasses("mb-3");
114 }
115 else {
116 AccordionItemClassList.AddClasses("mb-0");
117 }
118119 AccordionItemToggleClassList.AddClasses("d-flex align-items-center m-0 collapsed");
120 AccordionItemToggleTextClassList.AddClasses("line-height-sm");
121 if ( Espresso.Item.ToggleTextStyle != "" && Espresso.Item.ToggleTextStyle != "none" )
122 {
123 AccordionItemToggleTextClassList.AddClasses( Espresso.Item.ToggleTextStyle );
124 AccordionItemToggleTextClassList.AddClasses( "my-0" );
125 }
126127 if( Espresso.Item.IconPosition == "right" ) {
128 AccordionItemToggleClassList.AddClasses("justify-content-between");
129 AccordionItemToggleIconClassList.AddClasses("order-last");
130 }
131 else {
132 AccordionItemToggleIconClassList.AddClasses("order-first");
133 }
134135 if (Espresso.Item.Studieretning == "True" )
136 {
137 AccordionItemToggleClassList.AddClasses("flex-lg-column");
138 AccordionItemToggleClassList.RemoveClasses("align-items-center");
139 AccordionItemToggleIconClassList.AddClasses("d-block d-lg-none");
140 Espresso.Wrapper.Classes.AddClasses( "rybners-accordion-studieretning js-rybners-disable-collapse-on-desktop" );
141 }
142 }
143144 <div class="@Espresso.Container.Classes" id="@Espresso.Id">
145146 @if ( string.IsNullOrEmpty( Espresso.Text.Raw ) == false )
147 {
148 <div class="@AccordionLeadClassList">
149 @Espresso.Text.Raw
150 </div>
151 }
152153 <div class="p-accordion-container @Espresso.Wrapper.Classes">
154155 @{ int AccordionItemLoopCounter = 1; }
156 @foreach( dynamic AccordionItem in Espresso.Item.AccordionItems ) {
157 EspressoImage AccordionItemImage = new EspressoImage( AccordionItem.Item );
158 AccordionItemImage.Width = 1620;
159 AccordionItemBorderStyleClassList.Clear();
160161 if( AccordionBorderStyle == "horizontal-spaced" ) {
162 AccordionItemBorderStyleClassList.AddClasses("");
163 }
164 else if( AccordionBorderStyle == "horizontal-condensed" ) {
165 if( AccordionItemLoopCounter != Espresso.Item.AccordionItems.Count ) {
166 AccordionItemBorderStyleClassList.AddClasses("border-bottom-0");
167 }
168 }
169 else if( AccordionBorderStyle == "around-spaced" ) {
170 AccordionItemClassList.AddClasses("border rounded");
171 }
172 else if( AccordionBorderStyle == "around-condensed" ) {
173 if( AccordionItemLoopCounter != Espresso.Item.AccordionItems.Count ) {
174 AccordionItemBorderStyleClassList.AddClasses("border-bottom-0");
175 }
176 if( AccordionItemLoopCounter == 1 ) {
177 AccordionItemBorderStyleClassList.AddClasses("rounded-top");
178 }
179 else if( AccordionItemLoopCounter == Espresso.Item.AccordionItems.Count ) {
180 AccordionItemBorderStyleClassList.AddClasses("rounded-bottom");
181 }
182 }
183 else if( AccordionBorderStyle == "none-spaced" ) {
184 AccordionItemClassList.AddClasses("rounded");
185 }
186 else if( AccordionBorderStyle == "none-condensed" ) {
187 if( AccordionItemLoopCounter == 1 ) {
188 AccordionItemBorderStyleClassList.AddClasses("rounded-top");
189 }
190 else if( AccordionItemLoopCounter == Espresso.Item.AccordionItems.Count ) {
191 AccordionItemBorderStyleClassList.AddClasses("rounded-bottom");
192 }
193 }
194195 <div @( Espresso.Item.Studieretning == "True" ? "data-toggle=\"tooltip\" data-placement=\"bottom\"" : "" ) class="@AccordionItemClassList @AccordionItemBorderStyleClassList e-theme-@AccordionItem.BackgroundColor" title='@AccordionItem.Text'>
196197 <div class="p-accordion-toggle">
198 <p data-toggle="collapse" data-target="#e-accordion-@Espresso.Id-@AccordionItem.Item.Id" class="@AccordionItemToggleClassList">
199200 @if ( Espresso.Item.CustomIcon == "True" )
201 {
202 <span style="height: 3.25em; min-width: 3.25em;" class="align-items-center d-flex justify-content-center e-theme-education-primary mr-2">
203 <i class="material-icons p-accordion-toggle-icon custom-icon @AccordionItemToggleIconClassList">chevron_right</i>
204 </span>
205 }
206 else
207 {
208 <i class="material-icons p-accordion-toggle-icon @AccordionItemToggleIconClassList">add</i>
209 }
210211 <span class="p-accordion-toggle-text @AccordionItemToggleTextClassList">
212 @AccordionItem.Heading
213 </span>
214 @if ( string.IsNullOrEmpty( AccordionItem.Subheader ) == false )
215 {
216 <span class="d-none d-lg-block rybners-accordion-subheader">
217 @AccordionItem.Subheader<br />
218 @AccordionItem.Weeks<br/>
219 </span>
220 }
221 @if( Espresso.Item.Studieretning == "True") {
222 <i style="margin-left: -0.25em; position: absolute; bottom: 1em;" class="material-icons p-accordion-toggle-icon d-none d-lg-block mt-1">chevron_right</i>
223 }
224 </p>
225 </div>
226227 <div id="e-accordion-@Espresso.Id-@AccordionItem.Item.Id" class="collapse fade">
228 <div class="@AccordionItemContentClassList p-accordion-content">
229 @if( @AccordionItemImage.URL != "" ) {
230 <div class="row no-gutters justify-content-@AccordionItem.ImageAlignmentHorizontal">
231 <div class="col-@AccordionItem.ImageScale">
232 <p class="p-img-container">
233 <img src="@AccordionItemImage.URL" class="p-img" alt="@AccordionItem.Heading">
234 </p>
235 </div>
236 </div>
237 }
238 <div class="p-txt-container">
239 @AccordionItem.Text
240 </div>
241242 </div>
243 </div>
244245 </div>
246 AccordionItemLoopCounter++;
247 }
248249 </div>
250251 </div>
252
Error executing template "Designs/rybners/Paragraph/Accordion.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_1c0a6815e6ba4c87931b8bebeee1c3bd.Execute() in C:\inetpub\wwwroot\rybners_2022.espresso4.dk\Files\Templates\Designs\rybners\Paragraph\Accordion.cshtml:line 156
at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer)
at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
at Dynamicweb.Rendering.Template.RenderRazorTemplate()
1 @using Dynamicweb.Content.Items
2 @using Co3.Espresso.Base.Models
3 @using Co3.Espresso.Base.Extensions
4 @using Co3.Espresso.Website.Models.FrontEnd
5 @using Co3.Espresso.Website.Models.FrontEnd.Elements
6 @using Co3.Espresso.Website.Models.FrontEnd.Paragraphs
7 @inherits Co3.Espresso.Website.TemplateBases.Paragraphs.ImageTextTopBottom
8 @{
9 Espresso.Wrapper.Classes.Clear();
10 ClassList AccordionLeadClassList = new ClassList();
11 ClassList AccordionItemClassList = new ClassList();
12 ClassList AccordionItemBorderStyleClassList = new ClassList();
13 ClassList AccordionItemToggleClassList = new ClassList();
14 ClassList AccordionItemToggleTextClassList = new ClassList();
15 ClassList AccordionItemToggleIconClassList = new ClassList();
16 ClassList AccordionItemContentClassList = new ClassList();
17 AccordionLeadClassList.AddClasses( "p-accordion-lead" );
18 AccordionItemClassList.AddClasses("p-accordion-item");
19 20 Espresso.Container.Classes.RemoveClasses( "p-imagetext p-imagetext-tb p-imagetext-lr" );
21 Espresso.Container.Classes.AddClasses("p-accordion");
22 23 string AccordionBorderStyle = string.Empty;
24 if( Espresso.Item.Border == "top-bottom" ) {
25 if( Espresso.Item.Margin != "none" && string.IsNullOrEmpty( Espresso.Item.Margin ) == false ) {
26 AccordionBorderStyle = "horizontal-spaced";
27 }
28 else{
29 AccordionBorderStyle = "horizontal-condensed";
30 } }
31 else if( Espresso.Item.Border == "top-bottom-left-right" ) {
32 if( Espresso.Item.Margin != "none" && string.IsNullOrEmpty( Espresso.Item.Margin ) == false ) {
33 AccordionBorderStyle = "around-spaced";
34 }
35 else{
36 AccordionBorderStyle = "around-condensed";
37 }
38 }
39 else{
40 if( Espresso.Item.Margin != "none" && string.IsNullOrEmpty( Espresso.Item.Margin ) == false ) {
41 AccordionBorderStyle = "none-spaced";
42 }
43 else{
44 AccordionBorderStyle = "none-condensed";
45 }
46 }
47 if( Espresso.Item.TextColor != "" && Espresso.Item.TextColor != "auto" ) {
48 AccordionItemContentClassList.AddClasses( "e-text-" + Espresso.Item.TextColor );
49 }
50 if( AccordionBorderStyle == "horizontal-spaced" ) {
51 AccordionItemClassList.AddClasses("border border-right-0 border-left-0");
52 }
53 else if( AccordionBorderStyle == "horizontal-condensed" ) {
54 AccordionItemClassList.AddClasses("border border-right-0 border-left-0");
55 }
56 else if( AccordionBorderStyle == "around-spaced" ) {
57 AccordionItemClassList.AddClasses("border rounded");
58 }
59 else if( AccordionBorderStyle == "around-condensed" ) {
60 AccordionItemClassList.AddClasses("border");
61 }
62 if( Espresso.Item.BorderColor != "auto" && Espresso.Item.BorderColor != "" ) {
63 Espresso.Wrapper.Classes.AddClasses( "border-" + Espresso.Item.BorderColor );
64 AccordionItemClassList.AddClasses( "border-" + Espresso.Item.BorderColor );
65 }
66 if( Espresso.Item.BackgroundColor != "" && Espresso.Item.BackgroundColor != "none" && Espresso.Item.BackgroundColor != "auto" ) {
67 AccordionItemClassList.AddClasses( "e-theme-" + Espresso.Item.BackgroundColor );
68 }
69 if( Espresso.Item.IconColor != "" && Espresso.Item.IconColor != "auto" ) {
70 AccordionItemToggleIconClassList.AddClasses( "e-text-" + Espresso.Item.IconColor );
71 }
72 if( Espresso.Item.ToggleTextColor != "" && Espresso.Item.ToggleTextColor != "auto" ) {
73 AccordionItemToggleTextClassList.AddClasses( "e-text-" + Espresso.Item.ToggleTextColor );
74 }
75 76 if( Espresso.Item.PaddingHorizontal == "sm" ) {
77 AccordionItemToggleClassList.AddClasses("px-1");
78 AccordionItemContentClassList.AddClasses("px-1");
79 }
80 else if( Espresso.Item.PaddingHorizontal == "md" ) {
81 AccordionItemToggleClassList.AddClasses("px-2");
82 AccordionItemContentClassList.AddClasses("px-2");
83 }
84 else if( Espresso.Item.PaddingHorizontal == "lg" ) {
85 AccordionItemToggleClassList.AddClasses("px-3");
86 AccordionItemContentClassList.AddClasses("px-3");
87 }
88 else {
89 AccordionItemToggleClassList.AddClasses("px-0");
90 AccordionItemContentClassList.AddClasses("px-0");
91 }
92 93 if( Espresso.Item.PaddingVertical == "sm" ) {
94 AccordionItemToggleClassList.AddClasses("py-1");
95 AccordionItemContentClassList.AddClasses("pb-1");
96 }
97 else if( Espresso.Item.PaddingVertical == "md" ) {
98 AccordionItemToggleClassList.AddClasses("py-2");
99 AccordionItemContentClassList.AddClasses("pb-2");
100 }
101 else if( Espresso.Item.PaddingVertical == "lg" ) {
102 AccordionItemToggleClassList.AddClasses("py-3");
103 AccordionItemContentClassList.AddClasses("pb-3");
104 }
105106 if( Espresso.Item.Margin == "sm" ) {
107 AccordionItemClassList.AddClasses("mb-1");
108 }
109 else if( Espresso.Item.Margin == "md" ) {
110 AccordionItemClassList.AddClasses("mb-2");
111 }
112 else if( Espresso.Item.Margin == "lg" ) {
113 AccordionItemClassList.AddClasses("mb-3");
114 }
115 else {
116 AccordionItemClassList.AddClasses("mb-0");
117 }
118119 AccordionItemToggleClassList.AddClasses("d-flex align-items-center m-0 collapsed");
120 AccordionItemToggleTextClassList.AddClasses("line-height-sm");
121 if ( Espresso.Item.ToggleTextStyle != "" && Espresso.Item.ToggleTextStyle != "none" )
122 {
123 AccordionItemToggleTextClassList.AddClasses( Espresso.Item.ToggleTextStyle );
124 AccordionItemToggleTextClassList.AddClasses( "my-0" );
125 }
126127 if( Espresso.Item.IconPosition == "right" ) {
128 AccordionItemToggleClassList.AddClasses("justify-content-between");
129 AccordionItemToggleIconClassList.AddClasses("order-last");
130 }
131 else {
132 AccordionItemToggleIconClassList.AddClasses("order-first");
133 }
134135 if (Espresso.Item.Studieretning == "True" )
136 {
137 AccordionItemToggleClassList.AddClasses("flex-lg-column");
138 AccordionItemToggleClassList.RemoveClasses("align-items-center");
139 AccordionItemToggleIconClassList.AddClasses("d-block d-lg-none");
140 Espresso.Wrapper.Classes.AddClasses( "rybners-accordion-studieretning js-rybners-disable-collapse-on-desktop" );
141 }
142 }
143144 <div class="@Espresso.Container.Classes" id="@Espresso.Id">
145146 @if ( string.IsNullOrEmpty( Espresso.Text.Raw ) == false )
147 {
148 <div class="@AccordionLeadClassList">
149 @Espresso.Text.Raw
150 </div>
151 }
152153 <div class="p-accordion-container @Espresso.Wrapper.Classes">
154155 @{ int AccordionItemLoopCounter = 1; }
156 @foreach( dynamic AccordionItem in Espresso.Item.AccordionItems ) {
157 EspressoImage AccordionItemImage = new EspressoImage( AccordionItem.Item );
158 AccordionItemImage.Width = 1620;
159 AccordionItemBorderStyleClassList.Clear();
160161 if( AccordionBorderStyle == "horizontal-spaced" ) {
162 AccordionItemBorderStyleClassList.AddClasses("");
163 }
164 else if( AccordionBorderStyle == "horizontal-condensed" ) {
165 if( AccordionItemLoopCounter != Espresso.Item.AccordionItems.Count ) {
166 AccordionItemBorderStyleClassList.AddClasses("border-bottom-0");
167 }
168 }
169 else if( AccordionBorderStyle == "around-spaced" ) {
170 AccordionItemClassList.AddClasses("border rounded");
171 }
172 else if( AccordionBorderStyle == "around-condensed" ) {
173 if( AccordionItemLoopCounter != Espresso.Item.AccordionItems.Count ) {
174 AccordionItemBorderStyleClassList.AddClasses("border-bottom-0");
175 }
176 if( AccordionItemLoopCounter == 1 ) {
177 AccordionItemBorderStyleClassList.AddClasses("rounded-top");
178 }
179 else if( AccordionItemLoopCounter == Espresso.Item.AccordionItems.Count ) {
180 AccordionItemBorderStyleClassList.AddClasses("rounded-bottom");
181 }
182 }
183 else if( AccordionBorderStyle == "none-spaced" ) {
184 AccordionItemClassList.AddClasses("rounded");
185 }
186 else if( AccordionBorderStyle == "none-condensed" ) {
187 if( AccordionItemLoopCounter == 1 ) {
188 AccordionItemBorderStyleClassList.AddClasses("rounded-top");
189 }
190 else if( AccordionItemLoopCounter == Espresso.Item.AccordionItems.Count ) {
191 AccordionItemBorderStyleClassList.AddClasses("rounded-bottom");
192 }
193 }
194195 <div @( Espresso.Item.Studieretning == "True" ? "data-toggle=\"tooltip\" data-placement=\"bottom\"" : "" ) class="@AccordionItemClassList @AccordionItemBorderStyleClassList e-theme-@AccordionItem.BackgroundColor" title='@AccordionItem.Text'>
196197 <div class="p-accordion-toggle">
198 <p data-toggle="collapse" data-target="#e-accordion-@Espresso.Id-@AccordionItem.Item.Id" class="@AccordionItemToggleClassList">
199200 @if ( Espresso.Item.CustomIcon == "True" )
201 {
202 <span style="height: 3.25em; min-width: 3.25em;" class="align-items-center d-flex justify-content-center e-theme-education-primary mr-2">
203 <i class="material-icons p-accordion-toggle-icon custom-icon @AccordionItemToggleIconClassList">chevron_right</i>
204 </span>
205 }
206 else
207 {
208 <i class="material-icons p-accordion-toggle-icon @AccordionItemToggleIconClassList">add</i>
209 }
210211 <span class="p-accordion-toggle-text @AccordionItemToggleTextClassList">
212 @AccordionItem.Heading
213 </span>
214 @if ( string.IsNullOrEmpty( AccordionItem.Subheader ) == false )
215 {
216 <span class="d-none d-lg-block rybners-accordion-subheader">
217 @AccordionItem.Subheader<br />
218 @AccordionItem.Weeks<br/>
219 </span>
220 }
221 @if( Espresso.Item.Studieretning == "True") {
222 <i style="margin-left: -0.25em; position: absolute; bottom: 1em;" class="material-icons p-accordion-toggle-icon d-none d-lg-block mt-1">chevron_right</i>
223 }
224 </p>
225 </div>
226227 <div id="e-accordion-@Espresso.Id-@AccordionItem.Item.Id" class="collapse fade">
228 <div class="@AccordionItemContentClassList p-accordion-content">
229 @if( @AccordionItemImage.URL != "" ) {
230 <div class="row no-gutters justify-content-@AccordionItem.ImageAlignmentHorizontal">
231 <div class="col-@AccordionItem.ImageScale">
232 <p class="p-img-container">
233 <img src="@AccordionItemImage.URL" class="p-img" alt="@AccordionItem.Heading">
234 </p>
235 </div>
236 </div>
237 }
238 <div class="p-txt-container">
239 @AccordionItem.Text
240 </div>
241242 </div>
243 </div>
244245 </div>
246 AccordionItemLoopCounter++;
247 }
248249 </div>
250251 </div>
252
Error executing template "Designs/rybners/Paragraph/Accordion.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_1c0a6815e6ba4c87931b8bebeee1c3bd.Execute() in C:\inetpub\wwwroot\rybners_2022.espresso4.dk\Files\Templates\Designs\rybners\Paragraph\Accordion.cshtml:line 156
at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer)
at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
at Dynamicweb.Rendering.Template.RenderRazorTemplate()
1 @using Dynamicweb.Content.Items
2 @using Co3.Espresso.Base.Models
3 @using Co3.Espresso.Base.Extensions
4 @using Co3.Espresso.Website.Models.FrontEnd
5 @using Co3.Espresso.Website.Models.FrontEnd.Elements
6 @using Co3.Espresso.Website.Models.FrontEnd.Paragraphs
7 @inherits Co3.Espresso.Website.TemplateBases.Paragraphs.ImageTextTopBottom
8 @{
9 Espresso.Wrapper.Classes.Clear();
10 ClassList AccordionLeadClassList = new ClassList();
11 ClassList AccordionItemClassList = new ClassList();
12 ClassList AccordionItemBorderStyleClassList = new ClassList();
13 ClassList AccordionItemToggleClassList = new ClassList();
14 ClassList AccordionItemToggleTextClassList = new ClassList();
15 ClassList AccordionItemToggleIconClassList = new ClassList();
16 ClassList AccordionItemContentClassList = new ClassList();
17 AccordionLeadClassList.AddClasses( "p-accordion-lead" );
18 AccordionItemClassList.AddClasses("p-accordion-item");
19 20 Espresso.Container.Classes.RemoveClasses( "p-imagetext p-imagetext-tb p-imagetext-lr" );
21 Espresso.Container.Classes.AddClasses("p-accordion");
22 23 string AccordionBorderStyle = string.Empty;
24 if( Espresso.Item.Border == "top-bottom" ) {
25 if( Espresso.Item.Margin != "none" && string.IsNullOrEmpty( Espresso.Item.Margin ) == false ) {
26 AccordionBorderStyle = "horizontal-spaced";
27 }
28 else{
29 AccordionBorderStyle = "horizontal-condensed";
30 } }
31 else if( Espresso.Item.Border == "top-bottom-left-right" ) {
32 if( Espresso.Item.Margin != "none" && string.IsNullOrEmpty( Espresso.Item.Margin ) == false ) {
33 AccordionBorderStyle = "around-spaced";
34 }
35 else{
36 AccordionBorderStyle = "around-condensed";
37 }
38 }
39 else{
40 if( Espresso.Item.Margin != "none" && string.IsNullOrEmpty( Espresso.Item.Margin ) == false ) {
41 AccordionBorderStyle = "none-spaced";
42 }
43 else{
44 AccordionBorderStyle = "none-condensed";
45 }
46 }
47 if( Espresso.Item.TextColor != "" && Espresso.Item.TextColor != "auto" ) {
48 AccordionItemContentClassList.AddClasses( "e-text-" + Espresso.Item.TextColor );
49 }
50 if( AccordionBorderStyle == "horizontal-spaced" ) {
51 AccordionItemClassList.AddClasses("border border-right-0 border-left-0");
52 }
53 else if( AccordionBorderStyle == "horizontal-condensed" ) {
54 AccordionItemClassList.AddClasses("border border-right-0 border-left-0");
55 }
56 else if( AccordionBorderStyle == "around-spaced" ) {
57 AccordionItemClassList.AddClasses("border rounded");
58 }
59 else if( AccordionBorderStyle == "around-condensed" ) {
60 AccordionItemClassList.AddClasses("border");
61 }
62 if( Espresso.Item.BorderColor != "auto" && Espresso.Item.BorderColor != "" ) {
63 Espresso.Wrapper.Classes.AddClasses( "border-" + Espresso.Item.BorderColor );
64 AccordionItemClassList.AddClasses( "border-" + Espresso.Item.BorderColor );
65 }
66 if( Espresso.Item.BackgroundColor != "" && Espresso.Item.BackgroundColor != "none" && Espresso.Item.BackgroundColor != "auto" ) {
67 AccordionItemClassList.AddClasses( "e-theme-" + Espresso.Item.BackgroundColor );
68 }
69 if( Espresso.Item.IconColor != "" && Espresso.Item.IconColor != "auto" ) {
70 AccordionItemToggleIconClassList.AddClasses( "e-text-" + Espresso.Item.IconColor );
71 }
72 if( Espresso.Item.ToggleTextColor != "" && Espresso.Item.ToggleTextColor != "auto" ) {
73 AccordionItemToggleTextClassList.AddClasses( "e-text-" + Espresso.Item.ToggleTextColor );
74 }
75 76 if( Espresso.Item.PaddingHorizontal == "sm" ) {
77 AccordionItemToggleClassList.AddClasses("px-1");
78 AccordionItemContentClassList.AddClasses("px-1");
79 }
80 else if( Espresso.Item.PaddingHorizontal == "md" ) {
81 AccordionItemToggleClassList.AddClasses("px-2");
82 AccordionItemContentClassList.AddClasses("px-2");
83 }
84 else if( Espresso.Item.PaddingHorizontal == "lg" ) {
85 AccordionItemToggleClassList.AddClasses("px-3");
86 AccordionItemContentClassList.AddClasses("px-3");
87 }
88 else {
89 AccordionItemToggleClassList.AddClasses("px-0");
90 AccordionItemContentClassList.AddClasses("px-0");
91 }
92 93 if( Espresso.Item.PaddingVertical == "sm" ) {
94 AccordionItemToggleClassList.AddClasses("py-1");
95 AccordionItemContentClassList.AddClasses("pb-1");
96 }
97 else if( Espresso.Item.PaddingVertical == "md" ) {
98 AccordionItemToggleClassList.AddClasses("py-2");
99 AccordionItemContentClassList.AddClasses("pb-2");
100 }
101 else if( Espresso.Item.PaddingVertical == "lg" ) {
102 AccordionItemToggleClassList.AddClasses("py-3");
103 AccordionItemContentClassList.AddClasses("pb-3");
104 }
105106 if( Espresso.Item.Margin == "sm" ) {
107 AccordionItemClassList.AddClasses("mb-1");
108 }
109 else if( Espresso.Item.Margin == "md" ) {
110 AccordionItemClassList.AddClasses("mb-2");
111 }
112 else if( Espresso.Item.Margin == "lg" ) {
113 AccordionItemClassList.AddClasses("mb-3");
114 }
115 else {
116 AccordionItemClassList.AddClasses("mb-0");
117 }
118119 AccordionItemToggleClassList.AddClasses("d-flex align-items-center m-0 collapsed");
120 AccordionItemToggleTextClassList.AddClasses("line-height-sm");
121 if ( Espresso.Item.ToggleTextStyle != "" && Espresso.Item.ToggleTextStyle != "none" )
122 {
123 AccordionItemToggleTextClassList.AddClasses( Espresso.Item.ToggleTextStyle );
124 AccordionItemToggleTextClassList.AddClasses( "my-0" );
125 }
126127 if( Espresso.Item.IconPosition == "right" ) {
128 AccordionItemToggleClassList.AddClasses("justify-content-between");
129 AccordionItemToggleIconClassList.AddClasses("order-last");
130 }
131 else {
132 AccordionItemToggleIconClassList.AddClasses("order-first");
133 }
134135 if (Espresso.Item.Studieretning == "True" )
136 {
137 AccordionItemToggleClassList.AddClasses("flex-lg-column");
138 AccordionItemToggleClassList.RemoveClasses("align-items-center");
139 AccordionItemToggleIconClassList.AddClasses("d-block d-lg-none");
140 Espresso.Wrapper.Classes.AddClasses( "rybners-accordion-studieretning js-rybners-disable-collapse-on-desktop" );
141 }
142 }
143144 <div class="@Espresso.Container.Classes" id="@Espresso.Id">
145146 @if ( string.IsNullOrEmpty( Espresso.Text.Raw ) == false )
147 {
148 <div class="@AccordionLeadClassList">
149 @Espresso.Text.Raw
150 </div>
151 }
152153 <div class="p-accordion-container @Espresso.Wrapper.Classes">
154155 @{ int AccordionItemLoopCounter = 1; }
156 @foreach( dynamic AccordionItem in Espresso.Item.AccordionItems ) {
157 EspressoImage AccordionItemImage = new EspressoImage( AccordionItem.Item );
158 AccordionItemImage.Width = 1620;
159 AccordionItemBorderStyleClassList.Clear();
160161 if( AccordionBorderStyle == "horizontal-spaced" ) {
162 AccordionItemBorderStyleClassList.AddClasses("");
163 }
164 else if( AccordionBorderStyle == "horizontal-condensed" ) {
165 if( AccordionItemLoopCounter != Espresso.Item.AccordionItems.Count ) {
166 AccordionItemBorderStyleClassList.AddClasses("border-bottom-0");
167 }
168 }
169 else if( AccordionBorderStyle == "around-spaced" ) {
170 AccordionItemClassList.AddClasses("border rounded");
171 }
172 else if( AccordionBorderStyle == "around-condensed" ) {
173 if( AccordionItemLoopCounter != Espresso.Item.AccordionItems.Count ) {
174 AccordionItemBorderStyleClassList.AddClasses("border-bottom-0");
175 }
176 if( AccordionItemLoopCounter == 1 ) {
177 AccordionItemBorderStyleClassList.AddClasses("rounded-top");
178 }
179 else if( AccordionItemLoopCounter == Espresso.Item.AccordionItems.Count ) {
180 AccordionItemBorderStyleClassList.AddClasses("rounded-bottom");
181 }
182 }
183 else if( AccordionBorderStyle == "none-spaced" ) {
184 AccordionItemClassList.AddClasses("rounded");
185 }
186 else if( AccordionBorderStyle == "none-condensed" ) {
187 if( AccordionItemLoopCounter == 1 ) {
188 AccordionItemBorderStyleClassList.AddClasses("rounded-top");
189 }
190 else if( AccordionItemLoopCounter == Espresso.Item.AccordionItems.Count ) {
191 AccordionItemBorderStyleClassList.AddClasses("rounded-bottom");
192 }
193 }
194195 <div @( Espresso.Item.Studieretning == "True" ? "data-toggle=\"tooltip\" data-placement=\"bottom\"" : "" ) class="@AccordionItemClassList @AccordionItemBorderStyleClassList e-theme-@AccordionItem.BackgroundColor" title='@AccordionItem.Text'>
196197 <div class="p-accordion-toggle">
198 <p data-toggle="collapse" data-target="#e-accordion-@Espresso.Id-@AccordionItem.Item.Id" class="@AccordionItemToggleClassList">
199200 @if ( Espresso.Item.CustomIcon == "True" )
201 {
202 <span style="height: 3.25em; min-width: 3.25em;" class="align-items-center d-flex justify-content-center e-theme-education-primary mr-2">
203 <i class="material-icons p-accordion-toggle-icon custom-icon @AccordionItemToggleIconClassList">chevron_right</i>
204 </span>
205 }
206 else
207 {
208 <i class="material-icons p-accordion-toggle-icon @AccordionItemToggleIconClassList">add</i>
209 }
210211 <span class="p-accordion-toggle-text @AccordionItemToggleTextClassList">
212 @AccordionItem.Heading
213 </span>
214 @if ( string.IsNullOrEmpty( AccordionItem.Subheader ) == false )
215 {
216 <span class="d-none d-lg-block rybners-accordion-subheader">
217 @AccordionItem.Subheader<br />
218 @AccordionItem.Weeks<br/>
219 </span>
220 }
221 @if( Espresso.Item.Studieretning == "True") {
222 <i style="margin-left: -0.25em; position: absolute; bottom: 1em;" class="material-icons p-accordion-toggle-icon d-none d-lg-block mt-1">chevron_right</i>
223 }
224 </p>
225 </div>
226227 <div id="e-accordion-@Espresso.Id-@AccordionItem.Item.Id" class="collapse fade">
228 <div class="@AccordionItemContentClassList p-accordion-content">
229 @if( @AccordionItemImage.URL != "" ) {
230 <div class="row no-gutters justify-content-@AccordionItem.ImageAlignmentHorizontal">
231 <div class="col-@AccordionItem.ImageScale">
232 <p class="p-img-container">
233 <img src="@AccordionItemImage.URL" class="p-img" alt="@AccordionItem.Heading">
234 </p>
235 </div>
236 </div>
237 }
238 <div class="p-txt-container">
239 @AccordionItem.Text
240 </div>
241242 </div>
243 </div>
244245 </div>
246 AccordionItemLoopCounter++;
247 }
248249 </div>
250251 </div>
252
Error executing template "Designs/rybners/Paragraph/Accordion.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_1c0a6815e6ba4c87931b8bebeee1c3bd.Execute() in C:\inetpub\wwwroot\rybners_2022.espresso4.dk\Files\Templates\Designs\rybners\Paragraph\Accordion.cshtml:line 156
at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer)
at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
at Dynamicweb.Rendering.Template.RenderRazorTemplate()
1 @using Dynamicweb.Content.Items
2 @using Co3.Espresso.Base.Models
3 @using Co3.Espresso.Base.Extensions
4 @using Co3.Espresso.Website.Models.FrontEnd
5 @using Co3.Espresso.Website.Models.FrontEnd.Elements
6 @using Co3.Espresso.Website.Models.FrontEnd.Paragraphs
7 @inherits Co3.Espresso.Website.TemplateBases.Paragraphs.ImageTextTopBottom
8 @{
9 Espresso.Wrapper.Classes.Clear();
10 ClassList AccordionLeadClassList = new ClassList();
11 ClassList AccordionItemClassList = new ClassList();
12 ClassList AccordionItemBorderStyleClassList = new ClassList();
13 ClassList AccordionItemToggleClassList = new ClassList();
14 ClassList AccordionItemToggleTextClassList = new ClassList();
15 ClassList AccordionItemToggleIconClassList = new ClassList();
16 ClassList AccordionItemContentClassList = new ClassList();
17 AccordionLeadClassList.AddClasses( "p-accordion-lead" );
18 AccordionItemClassList.AddClasses("p-accordion-item");
19 20 Espresso.Container.Classes.RemoveClasses( "p-imagetext p-imagetext-tb p-imagetext-lr" );
21 Espresso.Container.Classes.AddClasses("p-accordion");
22 23 string AccordionBorderStyle = string.Empty;
24 if( Espresso.Item.Border == "top-bottom" ) {
25 if( Espresso.Item.Margin != "none" && string.IsNullOrEmpty( Espresso.Item.Margin ) == false ) {
26 AccordionBorderStyle = "horizontal-spaced";
27 }
28 else{
29 AccordionBorderStyle = "horizontal-condensed";
30 } }
31 else if( Espresso.Item.Border == "top-bottom-left-right" ) {
32 if( Espresso.Item.Margin != "none" && string.IsNullOrEmpty( Espresso.Item.Margin ) == false ) {
33 AccordionBorderStyle = "around-spaced";
34 }
35 else{
36 AccordionBorderStyle = "around-condensed";
37 }
38 }
39 else{
40 if( Espresso.Item.Margin != "none" && string.IsNullOrEmpty( Espresso.Item.Margin ) == false ) {
41 AccordionBorderStyle = "none-spaced";
42 }
43 else{
44 AccordionBorderStyle = "none-condensed";
45 }
46 }
47 if( Espresso.Item.TextColor != "" && Espresso.Item.TextColor != "auto" ) {
48 AccordionItemContentClassList.AddClasses( "e-text-" + Espresso.Item.TextColor );
49 }
50 if( AccordionBorderStyle == "horizontal-spaced" ) {
51 AccordionItemClassList.AddClasses("border border-right-0 border-left-0");
52 }
53 else if( AccordionBorderStyle == "horizontal-condensed" ) {
54 AccordionItemClassList.AddClasses("border border-right-0 border-left-0");
55 }
56 else if( AccordionBorderStyle == "around-spaced" ) {
57 AccordionItemClassList.AddClasses("border rounded");
58 }
59 else if( AccordionBorderStyle == "around-condensed" ) {
60 AccordionItemClassList.AddClasses("border");
61 }
62 if( Espresso.Item.BorderColor != "auto" && Espresso.Item.BorderColor != "" ) {
63 Espresso.Wrapper.Classes.AddClasses( "border-" + Espresso.Item.BorderColor );
64 AccordionItemClassList.AddClasses( "border-" + Espresso.Item.BorderColor );
65 }
66 if( Espresso.Item.BackgroundColor != "" && Espresso.Item.BackgroundColor != "none" && Espresso.Item.BackgroundColor != "auto" ) {
67 AccordionItemClassList.AddClasses( "e-theme-" + Espresso.Item.BackgroundColor );
68 }
69 if( Espresso.Item.IconColor != "" && Espresso.Item.IconColor != "auto" ) {
70 AccordionItemToggleIconClassList.AddClasses( "e-text-" + Espresso.Item.IconColor );
71 }
72 if( Espresso.Item.ToggleTextColor != "" && Espresso.Item.ToggleTextColor != "auto" ) {
73 AccordionItemToggleTextClassList.AddClasses( "e-text-" + Espresso.Item.ToggleTextColor );
74 }
75 76 if( Espresso.Item.PaddingHorizontal == "sm" ) {
77 AccordionItemToggleClassList.AddClasses("px-1");
78 AccordionItemContentClassList.AddClasses("px-1");
79 }
80 else if( Espresso.Item.PaddingHorizontal == "md" ) {
81 AccordionItemToggleClassList.AddClasses("px-2");
82 AccordionItemContentClassList.AddClasses("px-2");
83 }
84 else if( Espresso.Item.PaddingHorizontal == "lg" ) {
85 AccordionItemToggleClassList.AddClasses("px-3");
86 AccordionItemContentClassList.AddClasses("px-3");
87 }
88 else {
89 AccordionItemToggleClassList.AddClasses("px-0");
90 AccordionItemContentClassList.AddClasses("px-0");
91 }
92 93 if( Espresso.Item.PaddingVertical == "sm" ) {
94 AccordionItemToggleClassList.AddClasses("py-1");
95 AccordionItemContentClassList.AddClasses("pb-1");
96 }
97 else if( Espresso.Item.PaddingVertical == "md" ) {
98 AccordionItemToggleClassList.AddClasses("py-2");
99 AccordionItemContentClassList.AddClasses("pb-2");
100 }
101 else if( Espresso.Item.PaddingVertical == "lg" ) {
102 AccordionItemToggleClassList.AddClasses("py-3");
103 AccordionItemContentClassList.AddClasses("pb-3");
104 }
105106 if( Espresso.Item.Margin == "sm" ) {
107 AccordionItemClassList.AddClasses("mb-1");
108 }
109 else if( Espresso.Item.Margin == "md" ) {
110 AccordionItemClassList.AddClasses("mb-2");
111 }
112 else if( Espresso.Item.Margin == "lg" ) {
113 AccordionItemClassList.AddClasses("mb-3");
114 }
115 else {
116 AccordionItemClassList.AddClasses("mb-0");
117 }
118119 AccordionItemToggleClassList.AddClasses("d-flex align-items-center m-0 collapsed");
120 AccordionItemToggleTextClassList.AddClasses("line-height-sm");
121 if ( Espresso.Item.ToggleTextStyle != "" && Espresso.Item.ToggleTextStyle != "none" )
122 {
123 AccordionItemToggleTextClassList.AddClasses( Espresso.Item.ToggleTextStyle );
124 AccordionItemToggleTextClassList.AddClasses( "my-0" );
125 }
126127 if( Espresso.Item.IconPosition == "right" ) {
128 AccordionItemToggleClassList.AddClasses("justify-content-between");
129 AccordionItemToggleIconClassList.AddClasses("order-last");
130 }
131 else {
132 AccordionItemToggleIconClassList.AddClasses("order-first");
133 }
134135 if (Espresso.Item.Studieretning == "True" )
136 {
137 AccordionItemToggleClassList.AddClasses("flex-lg-column");
138 AccordionItemToggleClassList.RemoveClasses("align-items-center");
139 AccordionItemToggleIconClassList.AddClasses("d-block d-lg-none");
140 Espresso.Wrapper.Classes.AddClasses( "rybners-accordion-studieretning js-rybners-disable-collapse-on-desktop" );
141 }
142 }
143144 <div class="@Espresso.Container.Classes" id="@Espresso.Id">
145146 @if ( string.IsNullOrEmpty( Espresso.Text.Raw ) == false )
147 {
148 <div class="@AccordionLeadClassList">
149 @Espresso.Text.Raw
150 </div>
151 }
152153 <div class="p-accordion-container @Espresso.Wrapper.Classes">
154155 @{ int AccordionItemLoopCounter = 1; }
156 @foreach( dynamic AccordionItem in Espresso.Item.AccordionItems ) {
157 EspressoImage AccordionItemImage = new EspressoImage( AccordionItem.Item );
158 AccordionItemImage.Width = 1620;
159 AccordionItemBorderStyleClassList.Clear();
160161 if( AccordionBorderStyle == "horizontal-spaced" ) {
162 AccordionItemBorderStyleClassList.AddClasses("");
163 }
164 else if( AccordionBorderStyle == "horizontal-condensed" ) {
165 if( AccordionItemLoopCounter != Espresso.Item.AccordionItems.Count ) {
166 AccordionItemBorderStyleClassList.AddClasses("border-bottom-0");
167 }
168 }
169 else if( AccordionBorderStyle == "around-spaced" ) {
170 AccordionItemClassList.AddClasses("border rounded");
171 }
172 else if( AccordionBorderStyle == "around-condensed" ) {
173 if( AccordionItemLoopCounter != Espresso.Item.AccordionItems.Count ) {
174 AccordionItemBorderStyleClassList.AddClasses("border-bottom-0");
175 }
176 if( AccordionItemLoopCounter == 1 ) {
177 AccordionItemBorderStyleClassList.AddClasses("rounded-top");
178 }
179 else if( AccordionItemLoopCounter == Espresso.Item.AccordionItems.Count ) {
180 AccordionItemBorderStyleClassList.AddClasses("rounded-bottom");
181 }
182 }
183 else if( AccordionBorderStyle == "none-spaced" ) {
184 AccordionItemClassList.AddClasses("rounded");
185 }
186 else if( AccordionBorderStyle == "none-condensed" ) {
187 if( AccordionItemLoopCounter == 1 ) {
188 AccordionItemBorderStyleClassList.AddClasses("rounded-top");
189 }
190 else if( AccordionItemLoopCounter == Espresso.Item.AccordionItems.Count ) {
191 AccordionItemBorderStyleClassList.AddClasses("rounded-bottom");
192 }
193 }
194195 <div @( Espresso.Item.Studieretning == "True" ? "data-toggle=\"tooltip\" data-placement=\"bottom\"" : "" ) class="@AccordionItemClassList @AccordionItemBorderStyleClassList e-theme-@AccordionItem.BackgroundColor" title='@AccordionItem.Text'>
196197 <div class="p-accordion-toggle">
198 <p data-toggle="collapse" data-target="#e-accordion-@Espresso.Id-@AccordionItem.Item.Id" class="@AccordionItemToggleClassList">
199200 @if ( Espresso.Item.CustomIcon == "True" )
201 {
202 <span style="height: 3.25em; min-width: 3.25em;" class="align-items-center d-flex justify-content-center e-theme-education-primary mr-2">
203 <i class="material-icons p-accordion-toggle-icon custom-icon @AccordionItemToggleIconClassList">chevron_right</i>
204 </span>
205 }
206 else
207 {
208 <i class="material-icons p-accordion-toggle-icon @AccordionItemToggleIconClassList">add</i>
209 }
210211 <span class="p-accordion-toggle-text @AccordionItemToggleTextClassList">
212 @AccordionItem.Heading
213 </span>
214 @if ( string.IsNullOrEmpty( AccordionItem.Subheader ) == false )
215 {
216 <span class="d-none d-lg-block rybners-accordion-subheader">
217 @AccordionItem.Subheader<br />
218 @AccordionItem.Weeks<br/>
219 </span>
220 }
221 @if( Espresso.Item.Studieretning == "True") {
222 <i style="margin-left: -0.25em; position: absolute; bottom: 1em;" class="material-icons p-accordion-toggle-icon d-none d-lg-block mt-1">chevron_right</i>
223 }
224 </p>
225 </div>
226227 <div id="e-accordion-@Espresso.Id-@AccordionItem.Item.Id" class="collapse fade">
228 <div class="@AccordionItemContentClassList p-accordion-content">
229 @if( @AccordionItemImage.URL != "" ) {
230 <div class="row no-gutters justify-content-@AccordionItem.ImageAlignmentHorizontal">
231 <div class="col-@AccordionItem.ImageScale">
232 <p class="p-img-container">
233 <img src="@AccordionItemImage.URL" class="p-img" alt="@AccordionItem.Heading">
234 </p>
235 </div>
236 </div>
237 }
238 <div class="p-txt-container">
239 @AccordionItem.Text
240 </div>
241242 </div>
243 </div>
244245 </div>
246 AccordionItemLoopCounter++;
247 }
248249 </div>
250251 </div>
252
Error executing template "Designs/rybners/Paragraph/Accordion.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_1c0a6815e6ba4c87931b8bebeee1c3bd.Execute() in C:\inetpub\wwwroot\rybners_2022.espresso4.dk\Files\Templates\Designs\rybners\Paragraph\Accordion.cshtml:line 156
at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer)
at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
at Dynamicweb.Rendering.Template.RenderRazorTemplate()
1 @using Dynamicweb.Content.Items
2 @using Co3.Espresso.Base.Models
3 @using Co3.Espresso.Base.Extensions
4 @using Co3.Espresso.Website.Models.FrontEnd
5 @using Co3.Espresso.Website.Models.FrontEnd.Elements
6 @using Co3.Espresso.Website.Models.FrontEnd.Paragraphs
7 @inherits Co3.Espresso.Website.TemplateBases.Paragraphs.ImageTextTopBottom
8 @{
9 Espresso.Wrapper.Classes.Clear();
10 ClassList AccordionLeadClassList = new ClassList();
11 ClassList AccordionItemClassList = new ClassList();
12 ClassList AccordionItemBorderStyleClassList = new ClassList();
13 ClassList AccordionItemToggleClassList = new ClassList();
14 ClassList AccordionItemToggleTextClassList = new ClassList();
15 ClassList AccordionItemToggleIconClassList = new ClassList();
16 ClassList AccordionItemContentClassList = new ClassList();
17 AccordionLeadClassList.AddClasses( "p-accordion-lead" );
18 AccordionItemClassList.AddClasses("p-accordion-item");
19 20 Espresso.Container.Classes.RemoveClasses( "p-imagetext p-imagetext-tb p-imagetext-lr" );
21 Espresso.Container.Classes.AddClasses("p-accordion");
22 23 string AccordionBorderStyle = string.Empty;
24 if( Espresso.Item.Border == "top-bottom" ) {
25 if( Espresso.Item.Margin != "none" && string.IsNullOrEmpty( Espresso.Item.Margin ) == false ) {
26 AccordionBorderStyle = "horizontal-spaced";
27 }
28 else{
29 AccordionBorderStyle = "horizontal-condensed";
30 } }
31 else if( Espresso.Item.Border == "top-bottom-left-right" ) {
32 if( Espresso.Item.Margin != "none" && string.IsNullOrEmpty( Espresso.Item.Margin ) == false ) {
33 AccordionBorderStyle = "around-spaced";
34 }
35 else{
36 AccordionBorderStyle = "around-condensed";
37 }
38 }
39 else{
40 if( Espresso.Item.Margin != "none" && string.IsNullOrEmpty( Espresso.Item.Margin ) == false ) {
41 AccordionBorderStyle = "none-spaced";
42 }
43 else{
44 AccordionBorderStyle = "none-condensed";
45 }
46 }
47 if( Espresso.Item.TextColor != "" && Espresso.Item.TextColor != "auto" ) {
48 AccordionItemContentClassList.AddClasses( "e-text-" + Espresso.Item.TextColor );
49 }
50 if( AccordionBorderStyle == "horizontal-spaced" ) {
51 AccordionItemClassList.AddClasses("border border-right-0 border-left-0");
52 }
53 else if( AccordionBorderStyle == "horizontal-condensed" ) {
54 AccordionItemClassList.AddClasses("border border-right-0 border-left-0");
55 }
56 else if( AccordionBorderStyle == "around-spaced" ) {
57 AccordionItemClassList.AddClasses("border rounded");
58 }
59 else if( AccordionBorderStyle == "around-condensed" ) {
60 AccordionItemClassList.AddClasses("border");
61 }
62 if( Espresso.Item.BorderColor != "auto" && Espresso.Item.BorderColor != "" ) {
63 Espresso.Wrapper.Classes.AddClasses( "border-" + Espresso.Item.BorderColor );
64 AccordionItemClassList.AddClasses( "border-" + Espresso.Item.BorderColor );
65 }
66 if( Espresso.Item.BackgroundColor != "" && Espresso.Item.BackgroundColor != "none" && Espresso.Item.BackgroundColor != "auto" ) {
67 AccordionItemClassList.AddClasses( "e-theme-" + Espresso.Item.BackgroundColor );
68 }
69 if( Espresso.Item.IconColor != "" && Espresso.Item.IconColor != "auto" ) {
70 AccordionItemToggleIconClassList.AddClasses( "e-text-" + Espresso.Item.IconColor );
71 }
72 if( Espresso.Item.ToggleTextColor != "" && Espresso.Item.ToggleTextColor != "auto" ) {
73 AccordionItemToggleTextClassList.AddClasses( "e-text-" + Espresso.Item.ToggleTextColor );
74 }
75 76 if( Espresso.Item.PaddingHorizontal == "sm" ) {
77 AccordionItemToggleClassList.AddClasses("px-1");
78 AccordionItemContentClassList.AddClasses("px-1");
79 }
80 else if( Espresso.Item.PaddingHorizontal == "md" ) {
81 AccordionItemToggleClassList.AddClasses("px-2");
82 AccordionItemContentClassList.AddClasses("px-2");
83 }
84 else if( Espresso.Item.PaddingHorizontal == "lg" ) {
85 AccordionItemToggleClassList.AddClasses("px-3");
86 AccordionItemContentClassList.AddClasses("px-3");
87 }
88 else {
89 AccordionItemToggleClassList.AddClasses("px-0");
90 AccordionItemContentClassList.AddClasses("px-0");
91 }
92 93 if( Espresso.Item.PaddingVertical == "sm" ) {
94 AccordionItemToggleClassList.AddClasses("py-1");
95 AccordionItemContentClassList.AddClasses("pb-1");
96 }
97 else if( Espresso.Item.PaddingVertical == "md" ) {
98 AccordionItemToggleClassList.AddClasses("py-2");
99 AccordionItemContentClassList.AddClasses("pb-2");
100 }
101 else if( Espresso.Item.PaddingVertical == "lg" ) {
102 AccordionItemToggleClassList.AddClasses("py-3");
103 AccordionItemContentClassList.AddClasses("pb-3");
104 }
105106 if( Espresso.Item.Margin == "sm" ) {
107 AccordionItemClassList.AddClasses("mb-1");
108 }
109 else if( Espresso.Item.Margin == "md" ) {
110 AccordionItemClassList.AddClasses("mb-2");
111 }
112 else if( Espresso.Item.Margin == "lg" ) {
113 AccordionItemClassList.AddClasses("mb-3");
114 }
115 else {
116 AccordionItemClassList.AddClasses("mb-0");
117 }
118119 AccordionItemToggleClassList.AddClasses("d-flex align-items-center m-0 collapsed");
120 AccordionItemToggleTextClassList.AddClasses("line-height-sm");
121 if ( Espresso.Item.ToggleTextStyle != "" && Espresso.Item.ToggleTextStyle != "none" )
122 {
123 AccordionItemToggleTextClassList.AddClasses( Espresso.Item.ToggleTextStyle );
124 AccordionItemToggleTextClassList.AddClasses( "my-0" );
125 }
126127 if( Espresso.Item.IconPosition == "right" ) {
128 AccordionItemToggleClassList.AddClasses("justify-content-between");
129 AccordionItemToggleIconClassList.AddClasses("order-last");
130 }
131 else {
132 AccordionItemToggleIconClassList.AddClasses("order-first");
133 }
134135 if (Espresso.Item.Studieretning == "True" )
136 {
137 AccordionItemToggleClassList.AddClasses("flex-lg-column");
138 AccordionItemToggleClassList.RemoveClasses("align-items-center");
139 AccordionItemToggleIconClassList.AddClasses("d-block d-lg-none");
140 Espresso.Wrapper.Classes.AddClasses( "rybners-accordion-studieretning js-rybners-disable-collapse-on-desktop" );
141 }
142 }
143144 <div class="@Espresso.Container.Classes" id="@Espresso.Id">
145146 @if ( string.IsNullOrEmpty( Espresso.Text.Raw ) == false )
147 {
148 <div class="@AccordionLeadClassList">
149 @Espresso.Text.Raw
150 </div>
151 }
152153 <div class="p-accordion-container @Espresso.Wrapper.Classes">
154155 @{ int AccordionItemLoopCounter = 1; }
156 @foreach( dynamic AccordionItem in Espresso.Item.AccordionItems ) {
157 EspressoImage AccordionItemImage = new EspressoImage( AccordionItem.Item );
158 AccordionItemImage.Width = 1620;
159 AccordionItemBorderStyleClassList.Clear();
160161 if( AccordionBorderStyle == "horizontal-spaced" ) {
162 AccordionItemBorderStyleClassList.AddClasses("");
163 }
164 else if( AccordionBorderStyle == "horizontal-condensed" ) {
165 if( AccordionItemLoopCounter != Espresso.Item.AccordionItems.Count ) {
166 AccordionItemBorderStyleClassList.AddClasses("border-bottom-0");
167 }
168 }
169 else if( AccordionBorderStyle == "around-spaced" ) {
170 AccordionItemClassList.AddClasses("border rounded");
171 }
172 else if( AccordionBorderStyle == "around-condensed" ) {
173 if( AccordionItemLoopCounter != Espresso.Item.AccordionItems.Count ) {
174 AccordionItemBorderStyleClassList.AddClasses("border-bottom-0");
175 }
176 if( AccordionItemLoopCounter == 1 ) {
177 AccordionItemBorderStyleClassList.AddClasses("rounded-top");
178 }
179 else if( AccordionItemLoopCounter == Espresso.Item.AccordionItems.Count ) {
180 AccordionItemBorderStyleClassList.AddClasses("rounded-bottom");
181 }
182 }
183 else if( AccordionBorderStyle == "none-spaced" ) {
184 AccordionItemClassList.AddClasses("rounded");
185 }
186 else if( AccordionBorderStyle == "none-condensed" ) {
187 if( AccordionItemLoopCounter == 1 ) {
188 AccordionItemBorderStyleClassList.AddClasses("rounded-top");
189 }
190 else if( AccordionItemLoopCounter == Espresso.Item.AccordionItems.Count ) {
191 AccordionItemBorderStyleClassList.AddClasses("rounded-bottom");
192 }
193 }
194195 <div @( Espresso.Item.Studieretning == "True" ? "data-toggle=\"tooltip\" data-placement=\"bottom\"" : "" ) class="@AccordionItemClassList @AccordionItemBorderStyleClassList e-theme-@AccordionItem.BackgroundColor" title='@AccordionItem.Text'>
196197 <div class="p-accordion-toggle">
198 <p data-toggle="collapse" data-target="#e-accordion-@Espresso.Id-@AccordionItem.Item.Id" class="@AccordionItemToggleClassList">
199200 @if ( Espresso.Item.CustomIcon == "True" )
201 {
202 <span style="height: 3.25em; min-width: 3.25em;" class="align-items-center d-flex justify-content-center e-theme-education-primary mr-2">
203 <i class="material-icons p-accordion-toggle-icon custom-icon @AccordionItemToggleIconClassList">chevron_right</i>
204 </span>
205 }
206 else
207 {
208 <i class="material-icons p-accordion-toggle-icon @AccordionItemToggleIconClassList">add</i>
209 }
210211 <span class="p-accordion-toggle-text @AccordionItemToggleTextClassList">
212 @AccordionItem.Heading
213 </span>
214 @if ( string.IsNullOrEmpty( AccordionItem.Subheader ) == false )
215 {
216 <span class="d-none d-lg-block rybners-accordion-subheader">
217 @AccordionItem.Subheader<br />
218 @AccordionItem.Weeks<br/>
219 </span>
220 }
221 @if( Espresso.Item.Studieretning == "True") {
222 <i style="margin-left: -0.25em; position: absolute; bottom: 1em;" class="material-icons p-accordion-toggle-icon d-none d-lg-block mt-1">chevron_right</i>
223 }
224 </p>
225 </div>
226227 <div id="e-accordion-@Espresso.Id-@AccordionItem.Item.Id" class="collapse fade">
228 <div class="@AccordionItemContentClassList p-accordion-content">
229 @if( @AccordionItemImage.URL != "" ) {
230 <div class="row no-gutters justify-content-@AccordionItem.ImageAlignmentHorizontal">
231 <div class="col-@AccordionItem.ImageScale">
232 <p class="p-img-container">
233 <img src="@AccordionItemImage.URL" class="p-img" alt="@AccordionItem.Heading">
234 </p>
235 </div>
236 </div>
237 }
238 <div class="p-txt-container">
239 @AccordionItem.Text
240 </div>
241242 </div>
243 </div>
244245 </div>
246 AccordionItemLoopCounter++;
247 }
248249 </div>
250251 </div>
252
Error executing template "Designs/rybners/Paragraph/Accordion.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_1c0a6815e6ba4c87931b8bebeee1c3bd.Execute() in C:\inetpub\wwwroot\rybners_2022.espresso4.dk\Files\Templates\Designs\rybners\Paragraph\Accordion.cshtml:line 156
at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer)
at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
at Dynamicweb.Rendering.Template.RenderRazorTemplate()
1 @using Dynamicweb.Content.Items
2 @using Co3.Espresso.Base.Models
3 @using Co3.Espresso.Base.Extensions
4 @using Co3.Espresso.Website.Models.FrontEnd
5 @using Co3.Espresso.Website.Models.FrontEnd.Elements
6 @using Co3.Espresso.Website.Models.FrontEnd.Paragraphs
7 @inherits Co3.Espresso.Website.TemplateBases.Paragraphs.ImageTextTopBottom
8 @{
9 Espresso.Wrapper.Classes.Clear();
10 ClassList AccordionLeadClassList = new ClassList();
11 ClassList AccordionItemClassList = new ClassList();
12 ClassList AccordionItemBorderStyleClassList = new ClassList();
13 ClassList AccordionItemToggleClassList = new ClassList();
14 ClassList AccordionItemToggleTextClassList = new ClassList();
15 ClassList AccordionItemToggleIconClassList = new ClassList();
16 ClassList AccordionItemContentClassList = new ClassList();
17 AccordionLeadClassList.AddClasses( "p-accordion-lead" );
18 AccordionItemClassList.AddClasses("p-accordion-item");
19 20 Espresso.Container.Classes.RemoveClasses( "p-imagetext p-imagetext-tb p-imagetext-lr" );
21 Espresso.Container.Classes.AddClasses("p-accordion");
22 23 string AccordionBorderStyle = string.Empty;
24 if( Espresso.Item.Border == "top-bottom" ) {
25 if( Espresso.Item.Margin != "none" && string.IsNullOrEmpty( Espresso.Item.Margin ) == false ) {
26 AccordionBorderStyle = "horizontal-spaced";
27 }
28 else{
29 AccordionBorderStyle = "horizontal-condensed";
30 } }
31 else if( Espresso.Item.Border == "top-bottom-left-right" ) {
32 if( Espresso.Item.Margin != "none" && string.IsNullOrEmpty( Espresso.Item.Margin ) == false ) {
33 AccordionBorderStyle = "around-spaced";
34 }
35 else{
36 AccordionBorderStyle = "around-condensed";
37 }
38 }
39 else{
40 if( Espresso.Item.Margin != "none" && string.IsNullOrEmpty( Espresso.Item.Margin ) == false ) {
41 AccordionBorderStyle = "none-spaced";
42 }
43 else{
44 AccordionBorderStyle = "none-condensed";
45 }
46 }
47 if( Espresso.Item.TextColor != "" && Espresso.Item.TextColor != "auto" ) {
48 AccordionItemContentClassList.AddClasses( "e-text-" + Espresso.Item.TextColor );
49 }
50 if( AccordionBorderStyle == "horizontal-spaced" ) {
51 AccordionItemClassList.AddClasses("border border-right-0 border-left-0");
52 }
53 else if( AccordionBorderStyle == "horizontal-condensed" ) {
54 AccordionItemClassList.AddClasses("border border-right-0 border-left-0");
55 }
56 else if( AccordionBorderStyle == "around-spaced" ) {
57 AccordionItemClassList.AddClasses("border rounded");
58 }
59 else if( AccordionBorderStyle == "around-condensed" ) {
60 AccordionItemClassList.AddClasses("border");
61 }
62 if( Espresso.Item.BorderColor != "auto" && Espresso.Item.BorderColor != "" ) {
63 Espresso.Wrapper.Classes.AddClasses( "border-" + Espresso.Item.BorderColor );
64 AccordionItemClassList.AddClasses( "border-" + Espresso.Item.BorderColor );
65 }
66 if( Espresso.Item.BackgroundColor != "" && Espresso.Item.BackgroundColor != "none" && Espresso.Item.BackgroundColor != "auto" ) {
67 AccordionItemClassList.AddClasses( "e-theme-" + Espresso.Item.BackgroundColor );
68 }
69 if( Espresso.Item.IconColor != "" && Espresso.Item.IconColor != "auto" ) {
70 AccordionItemToggleIconClassList.AddClasses( "e-text-" + Espresso.Item.IconColor );
71 }
72 if( Espresso.Item.ToggleTextColor != "" && Espresso.Item.ToggleTextColor != "auto" ) {
73 AccordionItemToggleTextClassList.AddClasses( "e-text-" + Espresso.Item.ToggleTextColor );
74 }
75 76 if( Espresso.Item.PaddingHorizontal == "sm" ) {
77 AccordionItemToggleClassList.AddClasses("px-1");
78 AccordionItemContentClassList.AddClasses("px-1");
79 }
80 else if( Espresso.Item.PaddingHorizontal == "md" ) {
81 AccordionItemToggleClassList.AddClasses("px-2");
82 AccordionItemContentClassList.AddClasses("px-2");
83 }
84 else if( Espresso.Item.PaddingHorizontal == "lg" ) {
85 AccordionItemToggleClassList.AddClasses("px-3");
86 AccordionItemContentClassList.AddClasses("px-3");
87 }
88 else {
89 AccordionItemToggleClassList.AddClasses("px-0");
90 AccordionItemContentClassList.AddClasses("px-0");
91 }
92 93 if( Espresso.Item.PaddingVertical == "sm" ) {
94 AccordionItemToggleClassList.AddClasses("py-1");
95 AccordionItemContentClassList.AddClasses("pb-1");
96 }
97 else if( Espresso.Item.PaddingVertical == "md" ) {
98 AccordionItemToggleClassList.AddClasses("py-2");
99 AccordionItemContentClassList.AddClasses("pb-2");
100 }
101 else if( Espresso.Item.PaddingVertical == "lg" ) {
102 AccordionItemToggleClassList.AddClasses("py-3");
103 AccordionItemContentClassList.AddClasses("pb-3");
104 }
105106 if( Espresso.Item.Margin == "sm" ) {
107 AccordionItemClassList.AddClasses("mb-1");
108 }
109 else if( Espresso.Item.Margin == "md" ) {
110 AccordionItemClassList.AddClasses("mb-2");
111 }
112 else if( Espresso.Item.Margin == "lg" ) {
113 AccordionItemClassList.AddClasses("mb-3");
114 }
115 else {
116 AccordionItemClassList.AddClasses("mb-0");
117 }
118119 AccordionItemToggleClassList.AddClasses("d-flex align-items-center m-0 collapsed");
120 AccordionItemToggleTextClassList.AddClasses("line-height-sm");
121 if ( Espresso.Item.ToggleTextStyle != "" && Espresso.Item.ToggleTextStyle != "none" )
122 {
123 AccordionItemToggleTextClassList.AddClasses( Espresso.Item.ToggleTextStyle );
124 AccordionItemToggleTextClassList.AddClasses( "my-0" );
125 }
126127 if( Espresso.Item.IconPosition == "right" ) {
128 AccordionItemToggleClassList.AddClasses("justify-content-between");
129 AccordionItemToggleIconClassList.AddClasses("order-last");
130 }
131 else {
132 AccordionItemToggleIconClassList.AddClasses("order-first");
133 }
134135 if (Espresso.Item.Studieretning == "True" )
136 {
137 AccordionItemToggleClassList.AddClasses("flex-lg-column");
138 AccordionItemToggleClassList.RemoveClasses("align-items-center");
139 AccordionItemToggleIconClassList.AddClasses("d-block d-lg-none");
140 Espresso.Wrapper.Classes.AddClasses( "rybners-accordion-studieretning js-rybners-disable-collapse-on-desktop" );
141 }
142 }
143144 <div class="@Espresso.Container.Classes" id="@Espresso.Id">
145146 @if ( string.IsNullOrEmpty( Espresso.Text.Raw ) == false )
147 {
148 <div class="@AccordionLeadClassList">
149 @Espresso.Text.Raw
150 </div>
151 }
152153 <div class="p-accordion-container @Espresso.Wrapper.Classes">
154155 @{ int AccordionItemLoopCounter = 1; }
156 @foreach( dynamic AccordionItem in Espresso.Item.AccordionItems ) {
157 EspressoImage AccordionItemImage = new EspressoImage( AccordionItem.Item );
158 AccordionItemImage.Width = 1620;
159 AccordionItemBorderStyleClassList.Clear();
160161 if( AccordionBorderStyle == "horizontal-spaced" ) {
162 AccordionItemBorderStyleClassList.AddClasses("");
163 }
164 else if( AccordionBorderStyle == "horizontal-condensed" ) {
165 if( AccordionItemLoopCounter != Espresso.Item.AccordionItems.Count ) {
166 AccordionItemBorderStyleClassList.AddClasses("border-bottom-0");
167 }
168 }
169 else if( AccordionBorderStyle == "around-spaced" ) {
170 AccordionItemClassList.AddClasses("border rounded");
171 }
172 else if( AccordionBorderStyle == "around-condensed" ) {
173 if( AccordionItemLoopCounter != Espresso.Item.AccordionItems.Count ) {
174 AccordionItemBorderStyleClassList.AddClasses("border-bottom-0");
175 }
176 if( AccordionItemLoopCounter == 1 ) {
177 AccordionItemBorderStyleClassList.AddClasses("rounded-top");
178 }
179 else if( AccordionItemLoopCounter == Espresso.Item.AccordionItems.Count ) {
180 AccordionItemBorderStyleClassList.AddClasses("rounded-bottom");
181 }
182 }
183 else if( AccordionBorderStyle == "none-spaced" ) {
184 AccordionItemClassList.AddClasses("rounded");
185 }
186 else if( AccordionBorderStyle == "none-condensed" ) {
187 if( AccordionItemLoopCounter == 1 ) {
188 AccordionItemBorderStyleClassList.AddClasses("rounded-top");
189 }
190 else if( AccordionItemLoopCounter == Espresso.Item.AccordionItems.Count ) {
191 AccordionItemBorderStyleClassList.AddClasses("rounded-bottom");
192 }
193 }
194195 <div @( Espresso.Item.Studieretning == "True" ? "data-toggle=\"tooltip\" data-placement=\"bottom\"" : "" ) class="@AccordionItemClassList @AccordionItemBorderStyleClassList e-theme-@AccordionItem.BackgroundColor" title='@AccordionItem.Text'>
196197 <div class="p-accordion-toggle">
198 <p data-toggle="collapse" data-target="#e-accordion-@Espresso.Id-@AccordionItem.Item.Id" class="@AccordionItemToggleClassList">
199200 @if ( Espresso.Item.CustomIcon == "True" )
201 {
202 <span style="height: 3.25em; min-width: 3.25em;" class="align-items-center d-flex justify-content-center e-theme-education-primary mr-2">
203 <i class="material-icons p-accordion-toggle-icon custom-icon @AccordionItemToggleIconClassList">chevron_right</i>
204 </span>
205 }
206 else
207 {
208 <i class="material-icons p-accordion-toggle-icon @AccordionItemToggleIconClassList">add</i>
209 }
210211 <span class="p-accordion-toggle-text @AccordionItemToggleTextClassList">
212 @AccordionItem.Heading
213 </span>
214 @if ( string.IsNullOrEmpty( AccordionItem.Subheader ) == false )
215 {
216 <span class="d-none d-lg-block rybners-accordion-subheader">
217 @AccordionItem.Subheader<br />
218 @AccordionItem.Weeks<br/>
219 </span>
220 }
221 @if( Espresso.Item.Studieretning == "True") {
222 <i style="margin-left: -0.25em; position: absolute; bottom: 1em;" class="material-icons p-accordion-toggle-icon d-none d-lg-block mt-1">chevron_right</i>
223 }
224 </p>
225 </div>
226227 <div id="e-accordion-@Espresso.Id-@AccordionItem.Item.Id" class="collapse fade">
228 <div class="@AccordionItemContentClassList p-accordion-content">
229 @if( @AccordionItemImage.URL != "" ) {
230 <div class="row no-gutters justify-content-@AccordionItem.ImageAlignmentHorizontal">
231 <div class="col-@AccordionItem.ImageScale">
232 <p class="p-img-container">
233 <img src="@AccordionItemImage.URL" class="p-img" alt="@AccordionItem.Heading">
234 </p>
235 </div>
236 </div>
237 }
238 <div class="p-txt-container">
239 @AccordionItem.Text
240 </div>
241242 </div>
243 </div>
244245 </div>
246 AccordionItemLoopCounter++;
247 }
248249 </div>
250251 </div>
252