Error executing template "Designs/Baseline/Paragraph/accordions.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_758301150dbb4d8a98c2ea3e4f26d3a1.ExecuteAsync()
at RazorEngine.Templating.TemplateBase.Run(ExecuteContext context, TextWriter reader)
at RazorEngine.Templating.RazorEngineCore.RunTemplate(ICompiledTemplate template, TextWriter writer, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.DynamicWrapperService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.RunCompile(IRazorEngineService service, String name, 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 RazorEngine.Templating.RazorEngineServiceExtensions.RunCompile(IRazorEngineService service, String name, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.RunCompile(IRazorEngineService service, String templateSource, String name, Type modelType, Object model, DynamicViewBag viewBag)
at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
at Dynamicweb.Rendering.Template.RenderRazorTemplate()
1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel>
2 @using Dynamicweb.Frontend
3
4 @{
5 string moduleId = $"module{Model.ID}";
6 string themeValue = Model.Item.GetString("Theme");
7 string themeClass = $"theme{themeValue}";
8
9 string headline = Model.Item.GetString("Headline");
10 string teaser = Model.Item.GetString("Teaser");
11 string richText = Model.Item.GetString("RichText");
12 var link = Model.Item.GetValue<ItemViewModel>("Link");
13 string linkUrl = link.GetString("Link");
14 linkUrl = linkUrl.IndexOf("#") != -1 ? $"#module{linkUrl.Substring(linkUrl.IndexOf("#") + 1)}" : linkUrl;
15 var accordions = Model.Item.GetValue<List<ItemViewModel>>("Accordions");
16 }
17
18 <article id="@moduleId" class="accordions-module @themeClass">
19 <div class="accordions-module__text-wrap">
20 @if (!string.IsNullOrWhiteSpace(teaser)) {
21 <div class="accordions-module__teaser rich-text">@teaser</div>
22 }
23 @if (!string.IsNullOrWhiteSpace(linkUrl))
24 {
25 @RenderPartial("/partials/components/link.cshtml", link)
26 }
27 </div>
28 <div class="accordions-module__content-wrap">
29 @if (!string.IsNullOrWhiteSpace(headline))
30 {
31 <h2 class="accordions-module__headline">@headline</h2>
32 }
33 @if (!string.IsNullOrWhiteSpace(richText))
34 {
35 <div class="accordions-module__text rich-text">@richText</div>
36 }
37 <div class="accordions-module__content accordion__list">
38 @if (accordions != null && accordions.Count > 0)
39 {
40 foreach (var item in accordions)
41 {
42 string accordionHeadlineId = $"accordion-item-{item.Id}-headline";
43 string accordionContentId = $"accordtion-item-{item.Id}-content";
44
45 <div class="accordion__item" data-action="accordion">
46 <a href="#@accordionContentId" class="accordion__headline" id="@accordionHeadlineId" role="button" aria-expanded="false" aria-controls="@accordionContentId">
47 <h3 class="accordion__headline-inner">@item.GetString("Headline")</h3>
48 </a>
49 <div class="accordion__content-wrap" id="@accordionContentId" aria-hidden="true" aria-labelledby="@accordionHeadlineId">
50 <div class="accordion__content rich-text">@item.GetString("RichText")</div>
51 </div>
52 </div>
53 }
54 }
55 </div>
56 </div>
57 </article>
Error executing template "Designs/Baseline/Paragraph/accordions.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_758301150dbb4d8a98c2ea3e4f26d3a1.ExecuteAsync()
at RazorEngine.Templating.TemplateBase.Run(ExecuteContext context, TextWriter reader)
at RazorEngine.Templating.RazorEngineCore.RunTemplate(ICompiledTemplate template, TextWriter writer, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.DynamicWrapperService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.Run(IRazorEngineService service, String name, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass23_0.<Run>b__0(TextWriter writer)
at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
at RazorEngine.Templating.RazorEngineServiceExtensions.Run(IRazorEngineService service, String name, Type modelType, Object model, DynamicViewBag viewBag)
at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
at Dynamicweb.Rendering.Template.RenderRazorTemplate()
1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel>
2 @using Dynamicweb.Frontend
3
4 @{
5 string moduleId = $"module{Model.ID}";
6 string themeValue = Model.Item.GetString("Theme");
7 string themeClass = $"theme{themeValue}";
8
9 string headline = Model.Item.GetString("Headline");
10 string teaser = Model.Item.GetString("Teaser");
11 string richText = Model.Item.GetString("RichText");
12 var link = Model.Item.GetValue<ItemViewModel>("Link");
13 string linkUrl = link.GetString("Link");
14 linkUrl = linkUrl.IndexOf("#") != -1 ? $"#module{linkUrl.Substring(linkUrl.IndexOf("#") + 1)}" : linkUrl;
15 var accordions = Model.Item.GetValue<List<ItemViewModel>>("Accordions");
16 }
17
18 <article id="@moduleId" class="accordions-module @themeClass">
19 <div class="accordions-module__text-wrap">
20 @if (!string.IsNullOrWhiteSpace(teaser)) {
21 <div class="accordions-module__teaser rich-text">@teaser</div>
22 }
23 @if (!string.IsNullOrWhiteSpace(linkUrl))
24 {
25 @RenderPartial("/partials/components/link.cshtml", link)
26 }
27 </div>
28 <div class="accordions-module__content-wrap">
29 @if (!string.IsNullOrWhiteSpace(headline))
30 {
31 <h2 class="accordions-module__headline">@headline</h2>
32 }
33 @if (!string.IsNullOrWhiteSpace(richText))
34 {
35 <div class="accordions-module__text rich-text">@richText</div>
36 }
37 <div class="accordions-module__content accordion__list">
38 @if (accordions != null && accordions.Count > 0)
39 {
40 foreach (var item in accordions)
41 {
42 string accordionHeadlineId = $"accordion-item-{item.Id}-headline";
43 string accordionContentId = $"accordtion-item-{item.Id}-content";
44
45 <div class="accordion__item" data-action="accordion">
46 <a href="#@accordionContentId" class="accordion__headline" id="@accordionHeadlineId" role="button" aria-expanded="false" aria-controls="@accordionContentId">
47 <h3 class="accordion__headline-inner">@item.GetString("Headline")</h3>
48 </a>
49 <div class="accordion__content-wrap" id="@accordionContentId" aria-hidden="true" aria-labelledby="@accordionHeadlineId">
50 <div class="accordion__content rich-text">@item.GetString("RichText")</div>
51 </div>
52 </div>
53 }
54 }
55 </div>
56 </div>
57 </article>
Error executing template "Designs/Baseline/Paragraph/accordions.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_758301150dbb4d8a98c2ea3e4f26d3a1.ExecuteAsync()
at RazorEngine.Templating.TemplateBase.Run(ExecuteContext context, TextWriter reader)
at RazorEngine.Templating.RazorEngineCore.RunTemplate(ICompiledTemplate template, TextWriter writer, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.DynamicWrapperService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.Run(IRazorEngineService service, String name, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass23_0.<Run>b__0(TextWriter writer)
at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
at RazorEngine.Templating.RazorEngineServiceExtensions.Run(IRazorEngineService service, String name, Type modelType, Object model, DynamicViewBag viewBag)
at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
at Dynamicweb.Rendering.Template.RenderRazorTemplate()
1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel>
2 @using Dynamicweb.Frontend
3
4 @{
5 string moduleId = $"module{Model.ID}";
6 string themeValue = Model.Item.GetString("Theme");
7 string themeClass = $"theme{themeValue}";
8
9 string headline = Model.Item.GetString("Headline");
10 string teaser = Model.Item.GetString("Teaser");
11 string richText = Model.Item.GetString("RichText");
12 var link = Model.Item.GetValue<ItemViewModel>("Link");
13 string linkUrl = link.GetString("Link");
14 linkUrl = linkUrl.IndexOf("#") != -1 ? $"#module{linkUrl.Substring(linkUrl.IndexOf("#") + 1)}" : linkUrl;
15 var accordions = Model.Item.GetValue<List<ItemViewModel>>("Accordions");
16 }
17
18 <article id="@moduleId" class="accordions-module @themeClass">
19 <div class="accordions-module__text-wrap">
20 @if (!string.IsNullOrWhiteSpace(teaser)) {
21 <div class="accordions-module__teaser rich-text">@teaser</div>
22 }
23 @if (!string.IsNullOrWhiteSpace(linkUrl))
24 {
25 @RenderPartial("/partials/components/link.cshtml", link)
26 }
27 </div>
28 <div class="accordions-module__content-wrap">
29 @if (!string.IsNullOrWhiteSpace(headline))
30 {
31 <h2 class="accordions-module__headline">@headline</h2>
32 }
33 @if (!string.IsNullOrWhiteSpace(richText))
34 {
35 <div class="accordions-module__text rich-text">@richText</div>
36 }
37 <div class="accordions-module__content accordion__list">
38 @if (accordions != null && accordions.Count > 0)
39 {
40 foreach (var item in accordions)
41 {
42 string accordionHeadlineId = $"accordion-item-{item.Id}-headline";
43 string accordionContentId = $"accordtion-item-{item.Id}-content";
44
45 <div class="accordion__item" data-action="accordion">
46 <a href="#@accordionContentId" class="accordion__headline" id="@accordionHeadlineId" role="button" aria-expanded="false" aria-controls="@accordionContentId">
47 <h3 class="accordion__headline-inner">@item.GetString("Headline")</h3>
48 </a>
49 <div class="accordion__content-wrap" id="@accordionContentId" aria-hidden="true" aria-labelledby="@accordionHeadlineId">
50 <div class="accordion__content rich-text">@item.GetString("RichText")</div>
51 </div>
52 </div>
53 }
54 }
55 </div>
56 </div>
57 </article>
Error executing template "Designs/Baseline/Paragraph/accordions.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_758301150dbb4d8a98c2ea3e4f26d3a1.ExecuteAsync()
at RazorEngine.Templating.TemplateBase.Run(ExecuteContext context, TextWriter reader)
at RazorEngine.Templating.RazorEngineCore.RunTemplate(ICompiledTemplate template, TextWriter writer, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.DynamicWrapperService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.Run(IRazorEngineService service, String name, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass23_0.<Run>b__0(TextWriter writer)
at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
at RazorEngine.Templating.RazorEngineServiceExtensions.Run(IRazorEngineService service, String name, Type modelType, Object model, DynamicViewBag viewBag)
at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
at Dynamicweb.Rendering.Template.RenderRazorTemplate()
1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel>
2 @using Dynamicweb.Frontend
3
4 @{
5 string moduleId = $"module{Model.ID}";
6 string themeValue = Model.Item.GetString("Theme");
7 string themeClass = $"theme{themeValue}";
8
9 string headline = Model.Item.GetString("Headline");
10 string teaser = Model.Item.GetString("Teaser");
11 string richText = Model.Item.GetString("RichText");
12 var link = Model.Item.GetValue<ItemViewModel>("Link");
13 string linkUrl = link.GetString("Link");
14 linkUrl = linkUrl.IndexOf("#") != -1 ? $"#module{linkUrl.Substring(linkUrl.IndexOf("#") + 1)}" : linkUrl;
15 var accordions = Model.Item.GetValue<List<ItemViewModel>>("Accordions");
16 }
17
18 <article id="@moduleId" class="accordions-module @themeClass">
19 <div class="accordions-module__text-wrap">
20 @if (!string.IsNullOrWhiteSpace(teaser)) {
21 <div class="accordions-module__teaser rich-text">@teaser</div>
22 }
23 @if (!string.IsNullOrWhiteSpace(linkUrl))
24 {
25 @RenderPartial("/partials/components/link.cshtml", link)
26 }
27 </div>
28 <div class="accordions-module__content-wrap">
29 @if (!string.IsNullOrWhiteSpace(headline))
30 {
31 <h2 class="accordions-module__headline">@headline</h2>
32 }
33 @if (!string.IsNullOrWhiteSpace(richText))
34 {
35 <div class="accordions-module__text rich-text">@richText</div>
36 }
37 <div class="accordions-module__content accordion__list">
38 @if (accordions != null && accordions.Count > 0)
39 {
40 foreach (var item in accordions)
41 {
42 string accordionHeadlineId = $"accordion-item-{item.Id}-headline";
43 string accordionContentId = $"accordtion-item-{item.Id}-content";
44
45 <div class="accordion__item" data-action="accordion">
46 <a href="#@accordionContentId" class="accordion__headline" id="@accordionHeadlineId" role="button" aria-expanded="false" aria-controls="@accordionContentId">
47 <h3 class="accordion__headline-inner">@item.GetString("Headline")</h3>
48 </a>
49 <div class="accordion__content-wrap" id="@accordionContentId" aria-hidden="true" aria-labelledby="@accordionHeadlineId">
50 <div class="accordion__content rich-text">@item.GetString("RichText")</div>
51 </div>
52 </div>
53 }
54 }
55 </div>
56 </div>
57 </article>
Error executing template "Designs/Baseline/Paragraph/accordions.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_758301150dbb4d8a98c2ea3e4f26d3a1.ExecuteAsync()
at RazorEngine.Templating.TemplateBase.Run(ExecuteContext context, TextWriter reader)
at RazorEngine.Templating.RazorEngineCore.RunTemplate(ICompiledTemplate template, TextWriter writer, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.DynamicWrapperService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.Run(IRazorEngineService service, String name, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass23_0.<Run>b__0(TextWriter writer)
at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
at RazorEngine.Templating.RazorEngineServiceExtensions.Run(IRazorEngineService service, String name, Type modelType, Object model, DynamicViewBag viewBag)
at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
at Dynamicweb.Rendering.Template.RenderRazorTemplate()
1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel>
2 @using Dynamicweb.Frontend
3
4 @{
5 string moduleId = $"module{Model.ID}";
6 string themeValue = Model.Item.GetString("Theme");
7 string themeClass = $"theme{themeValue}";
8
9 string headline = Model.Item.GetString("Headline");
10 string teaser = Model.Item.GetString("Teaser");
11 string richText = Model.Item.GetString("RichText");
12 var link = Model.Item.GetValue<ItemViewModel>("Link");
13 string linkUrl = link.GetString("Link");
14 linkUrl = linkUrl.IndexOf("#") != -1 ? $"#module{linkUrl.Substring(linkUrl.IndexOf("#") + 1)}" : linkUrl;
15 var accordions = Model.Item.GetValue<List<ItemViewModel>>("Accordions");
16 }
17
18 <article id="@moduleId" class="accordions-module @themeClass">
19 <div class="accordions-module__text-wrap">
20 @if (!string.IsNullOrWhiteSpace(teaser)) {
21 <div class="accordions-module__teaser rich-text">@teaser</div>
22 }
23 @if (!string.IsNullOrWhiteSpace(linkUrl))
24 {
25 @RenderPartial("/partials/components/link.cshtml", link)
26 }
27 </div>
28 <div class="accordions-module__content-wrap">
29 @if (!string.IsNullOrWhiteSpace(headline))
30 {
31 <h2 class="accordions-module__headline">@headline</h2>
32 }
33 @if (!string.IsNullOrWhiteSpace(richText))
34 {
35 <div class="accordions-module__text rich-text">@richText</div>
36 }
37 <div class="accordions-module__content accordion__list">
38 @if (accordions != null && accordions.Count > 0)
39 {
40 foreach (var item in accordions)
41 {
42 string accordionHeadlineId = $"accordion-item-{item.Id}-headline";
43 string accordionContentId = $"accordtion-item-{item.Id}-content";
44
45 <div class="accordion__item" data-action="accordion">
46 <a href="#@accordionContentId" class="accordion__headline" id="@accordionHeadlineId" role="button" aria-expanded="false" aria-controls="@accordionContentId">
47 <h3 class="accordion__headline-inner">@item.GetString("Headline")</h3>
48 </a>
49 <div class="accordion__content-wrap" id="@accordionContentId" aria-hidden="true" aria-labelledby="@accordionHeadlineId">
50 <div class="accordion__content rich-text">@item.GetString("RichText")</div>
51 </div>
52 </div>
53 }
54 }
55 </div>
56 </div>
57 </article>
Error executing template "Designs/Baseline/Paragraph/accordions.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_758301150dbb4d8a98c2ea3e4f26d3a1.ExecuteAsync()
at RazorEngine.Templating.TemplateBase.Run(ExecuteContext context, TextWriter reader)
at RazorEngine.Templating.RazorEngineCore.RunTemplate(ICompiledTemplate template, TextWriter writer, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.DynamicWrapperService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.Run(IRazorEngineService service, String name, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass23_0.<Run>b__0(TextWriter writer)
at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
at RazorEngine.Templating.RazorEngineServiceExtensions.Run(IRazorEngineService service, String name, Type modelType, Object model, DynamicViewBag viewBag)
at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
at Dynamicweb.Rendering.Template.RenderRazorTemplate()
1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel>
2 @using Dynamicweb.Frontend
3
4 @{
5 string moduleId = $"module{Model.ID}";
6 string themeValue = Model.Item.GetString("Theme");
7 string themeClass = $"theme{themeValue}";
8
9 string headline = Model.Item.GetString("Headline");
10 string teaser = Model.Item.GetString("Teaser");
11 string richText = Model.Item.GetString("RichText");
12 var link = Model.Item.GetValue<ItemViewModel>("Link");
13 string linkUrl = link.GetString("Link");
14 linkUrl = linkUrl.IndexOf("#") != -1 ? $"#module{linkUrl.Substring(linkUrl.IndexOf("#") + 1)}" : linkUrl;
15 var accordions = Model.Item.GetValue<List<ItemViewModel>>("Accordions");
16 }
17
18 <article id="@moduleId" class="accordions-module @themeClass">
19 <div class="accordions-module__text-wrap">
20 @if (!string.IsNullOrWhiteSpace(teaser)) {
21 <div class="accordions-module__teaser rich-text">@teaser</div>
22 }
23 @if (!string.IsNullOrWhiteSpace(linkUrl))
24 {
25 @RenderPartial("/partials/components/link.cshtml", link)
26 }
27 </div>
28 <div class="accordions-module__content-wrap">
29 @if (!string.IsNullOrWhiteSpace(headline))
30 {
31 <h2 class="accordions-module__headline">@headline</h2>
32 }
33 @if (!string.IsNullOrWhiteSpace(richText))
34 {
35 <div class="accordions-module__text rich-text">@richText</div>
36 }
37 <div class="accordions-module__content accordion__list">
38 @if (accordions != null && accordions.Count > 0)
39 {
40 foreach (var item in accordions)
41 {
42 string accordionHeadlineId = $"accordion-item-{item.Id}-headline";
43 string accordionContentId = $"accordtion-item-{item.Id}-content";
44
45 <div class="accordion__item" data-action="accordion">
46 <a href="#@accordionContentId" class="accordion__headline" id="@accordionHeadlineId" role="button" aria-expanded="false" aria-controls="@accordionContentId">
47 <h3 class="accordion__headline-inner">@item.GetString("Headline")</h3>
48 </a>
49 <div class="accordion__content-wrap" id="@accordionContentId" aria-hidden="true" aria-labelledby="@accordionHeadlineId">
50 <div class="accordion__content rich-text">@item.GetString("RichText")</div>
51 </div>
52 </div>
53 }
54 }
55 </div>
56 </div>
57 </article>
Error executing template "Designs/Baseline/Paragraph/accordions.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_758301150dbb4d8a98c2ea3e4f26d3a1.ExecuteAsync()
at RazorEngine.Templating.TemplateBase.Run(ExecuteContext context, TextWriter reader)
at RazorEngine.Templating.RazorEngineCore.RunTemplate(ICompiledTemplate template, TextWriter writer, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.DynamicWrapperService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.Run(IRazorEngineService service, String name, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass23_0.<Run>b__0(TextWriter writer)
at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
at RazorEngine.Templating.RazorEngineServiceExtensions.Run(IRazorEngineService service, String name, Type modelType, Object model, DynamicViewBag viewBag)
at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
at Dynamicweb.Rendering.Template.RenderRazorTemplate()
1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel>
2 @using Dynamicweb.Frontend
3
4 @{
5 string moduleId = $"module{Model.ID}";
6 string themeValue = Model.Item.GetString("Theme");
7 string themeClass = $"theme{themeValue}";
8
9 string headline = Model.Item.GetString("Headline");
10 string teaser = Model.Item.GetString("Teaser");
11 string richText = Model.Item.GetString("RichText");
12 var link = Model.Item.GetValue<ItemViewModel>("Link");
13 string linkUrl = link.GetString("Link");
14 linkUrl = linkUrl.IndexOf("#") != -1 ? $"#module{linkUrl.Substring(linkUrl.IndexOf("#") + 1)}" : linkUrl;
15 var accordions = Model.Item.GetValue<List<ItemViewModel>>("Accordions");
16 }
17
18 <article id="@moduleId" class="accordions-module @themeClass">
19 <div class="accordions-module__text-wrap">
20 @if (!string.IsNullOrWhiteSpace(teaser)) {
21 <div class="accordions-module__teaser rich-text">@teaser</div>
22 }
23 @if (!string.IsNullOrWhiteSpace(linkUrl))
24 {
25 @RenderPartial("/partials/components/link.cshtml", link)
26 }
27 </div>
28 <div class="accordions-module__content-wrap">
29 @if (!string.IsNullOrWhiteSpace(headline))
30 {
31 <h2 class="accordions-module__headline">@headline</h2>
32 }
33 @if (!string.IsNullOrWhiteSpace(richText))
34 {
35 <div class="accordions-module__text rich-text">@richText</div>
36 }
37 <div class="accordions-module__content accordion__list">
38 @if (accordions != null && accordions.Count > 0)
39 {
40 foreach (var item in accordions)
41 {
42 string accordionHeadlineId = $"accordion-item-{item.Id}-headline";
43 string accordionContentId = $"accordtion-item-{item.Id}-content";
44
45 <div class="accordion__item" data-action="accordion">
46 <a href="#@accordionContentId" class="accordion__headline" id="@accordionHeadlineId" role="button" aria-expanded="false" aria-controls="@accordionContentId">
47 <h3 class="accordion__headline-inner">@item.GetString("Headline")</h3>
48 </a>
49 <div class="accordion__content-wrap" id="@accordionContentId" aria-hidden="true" aria-labelledby="@accordionHeadlineId">
50 <div class="accordion__content rich-text">@item.GetString("RichText")</div>
51 </div>
52 </div>
53 }
54 }
55 </div>
56 </div>
57 </article>
Error executing template "Designs/Baseline/Paragraph/accordions.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_758301150dbb4d8a98c2ea3e4f26d3a1.ExecuteAsync()
at RazorEngine.Templating.TemplateBase.Run(ExecuteContext context, TextWriter reader)
at RazorEngine.Templating.RazorEngineCore.RunTemplate(ICompiledTemplate template, TextWriter writer, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.DynamicWrapperService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.Run(IRazorEngineService service, String name, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass23_0.<Run>b__0(TextWriter writer)
at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
at RazorEngine.Templating.RazorEngineServiceExtensions.Run(IRazorEngineService service, String name, Type modelType, Object model, DynamicViewBag viewBag)
at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
at Dynamicweb.Rendering.Template.RenderRazorTemplate()
1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel>
2 @using Dynamicweb.Frontend
3
4 @{
5 string moduleId = $"module{Model.ID}";
6 string themeValue = Model.Item.GetString("Theme");
7 string themeClass = $"theme{themeValue}";
8
9 string headline = Model.Item.GetString("Headline");
10 string teaser = Model.Item.GetString("Teaser");
11 string richText = Model.Item.GetString("RichText");
12 var link = Model.Item.GetValue<ItemViewModel>("Link");
13 string linkUrl = link.GetString("Link");
14 linkUrl = linkUrl.IndexOf("#") != -1 ? $"#module{linkUrl.Substring(linkUrl.IndexOf("#") + 1)}" : linkUrl;
15 var accordions = Model.Item.GetValue<List<ItemViewModel>>("Accordions");
16 }
17
18 <article id="@moduleId" class="accordions-module @themeClass">
19 <div class="accordions-module__text-wrap">
20 @if (!string.IsNullOrWhiteSpace(teaser)) {
21 <div class="accordions-module__teaser rich-text">@teaser</div>
22 }
23 @if (!string.IsNullOrWhiteSpace(linkUrl))
24 {
25 @RenderPartial("/partials/components/link.cshtml", link)
26 }
27 </div>
28 <div class="accordions-module__content-wrap">
29 @if (!string.IsNullOrWhiteSpace(headline))
30 {
31 <h2 class="accordions-module__headline">@headline</h2>
32 }
33 @if (!string.IsNullOrWhiteSpace(richText))
34 {
35 <div class="accordions-module__text rich-text">@richText</div>
36 }
37 <div class="accordions-module__content accordion__list">
38 @if (accordions != null && accordions.Count > 0)
39 {
40 foreach (var item in accordions)
41 {
42 string accordionHeadlineId = $"accordion-item-{item.Id}-headline";
43 string accordionContentId = $"accordtion-item-{item.Id}-content";
44
45 <div class="accordion__item" data-action="accordion">
46 <a href="#@accordionContentId" class="accordion__headline" id="@accordionHeadlineId" role="button" aria-expanded="false" aria-controls="@accordionContentId">
47 <h3 class="accordion__headline-inner">@item.GetString("Headline")</h3>
48 </a>
49 <div class="accordion__content-wrap" id="@accordionContentId" aria-hidden="true" aria-labelledby="@accordionHeadlineId">
50 <div class="accordion__content rich-text">@item.GetString("RichText")</div>
51 </div>
52 </div>
53 }
54 }
55 </div>
56 </div>
57 </article>
Error executing template "Designs/Baseline/Paragraph/accordions.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_758301150dbb4d8a98c2ea3e4f26d3a1.ExecuteAsync()
at RazorEngine.Templating.TemplateBase.Run(ExecuteContext context, TextWriter reader)
at RazorEngine.Templating.RazorEngineCore.RunTemplate(ICompiledTemplate template, TextWriter writer, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.DynamicWrapperService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.Run(IRazorEngineService service, String name, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass23_0.<Run>b__0(TextWriter writer)
at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
at RazorEngine.Templating.RazorEngineServiceExtensions.Run(IRazorEngineService service, String name, Type modelType, Object model, DynamicViewBag viewBag)
at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
at Dynamicweb.Rendering.Template.RenderRazorTemplate()
1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel>
2 @using Dynamicweb.Frontend
3
4 @{
5 string moduleId = $"module{Model.ID}";
6 string themeValue = Model.Item.GetString("Theme");
7 string themeClass = $"theme{themeValue}";
8
9 string headline = Model.Item.GetString("Headline");
10 string teaser = Model.Item.GetString("Teaser");
11 string richText = Model.Item.GetString("RichText");
12 var link = Model.Item.GetValue<ItemViewModel>("Link");
13 string linkUrl = link.GetString("Link");
14 linkUrl = linkUrl.IndexOf("#") != -1 ? $"#module{linkUrl.Substring(linkUrl.IndexOf("#") + 1)}" : linkUrl;
15 var accordions = Model.Item.GetValue<List<ItemViewModel>>("Accordions");
16 }
17
18 <article id="@moduleId" class="accordions-module @themeClass">
19 <div class="accordions-module__text-wrap">
20 @if (!string.IsNullOrWhiteSpace(teaser)) {
21 <div class="accordions-module__teaser rich-text">@teaser</div>
22 }
23 @if (!string.IsNullOrWhiteSpace(linkUrl))
24 {
25 @RenderPartial("/partials/components/link.cshtml", link)
26 }
27 </div>
28 <div class="accordions-module__content-wrap">
29 @if (!string.IsNullOrWhiteSpace(headline))
30 {
31 <h2 class="accordions-module__headline">@headline</h2>
32 }
33 @if (!string.IsNullOrWhiteSpace(richText))
34 {
35 <div class="accordions-module__text rich-text">@richText</div>
36 }
37 <div class="accordions-module__content accordion__list">
38 @if (accordions != null && accordions.Count > 0)
39 {
40 foreach (var item in accordions)
41 {
42 string accordionHeadlineId = $"accordion-item-{item.Id}-headline";
43 string accordionContentId = $"accordtion-item-{item.Id}-content";
44
45 <div class="accordion__item" data-action="accordion">
46 <a href="#@accordionContentId" class="accordion__headline" id="@accordionHeadlineId" role="button" aria-expanded="false" aria-controls="@accordionContentId">
47 <h3 class="accordion__headline-inner">@item.GetString("Headline")</h3>
48 </a>
49 <div class="accordion__content-wrap" id="@accordionContentId" aria-hidden="true" aria-labelledby="@accordionHeadlineId">
50 <div class="accordion__content rich-text">@item.GetString("RichText")</div>
51 </div>
52 </div>
53 }
54 }
55 </div>
56 </div>
57 </article>
Error executing template "Designs/Baseline/Paragraph/accordions.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_758301150dbb4d8a98c2ea3e4f26d3a1.ExecuteAsync()
at RazorEngine.Templating.TemplateBase.Run(ExecuteContext context, TextWriter reader)
at RazorEngine.Templating.RazorEngineCore.RunTemplate(ICompiledTemplate template, TextWriter writer, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.DynamicWrapperService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.Run(IRazorEngineService service, String name, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass23_0.<Run>b__0(TextWriter writer)
at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
at RazorEngine.Templating.RazorEngineServiceExtensions.Run(IRazorEngineService service, String name, Type modelType, Object model, DynamicViewBag viewBag)
at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
at Dynamicweb.Rendering.Template.RenderRazorTemplate()
1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel>
2 @using Dynamicweb.Frontend
3
4 @{
5 string moduleId = $"module{Model.ID}";
6 string themeValue = Model.Item.GetString("Theme");
7 string themeClass = $"theme{themeValue}";
8
9 string headline = Model.Item.GetString("Headline");
10 string teaser = Model.Item.GetString("Teaser");
11 string richText = Model.Item.GetString("RichText");
12 var link = Model.Item.GetValue<ItemViewModel>("Link");
13 string linkUrl = link.GetString("Link");
14 linkUrl = linkUrl.IndexOf("#") != -1 ? $"#module{linkUrl.Substring(linkUrl.IndexOf("#") + 1)}" : linkUrl;
15 var accordions = Model.Item.GetValue<List<ItemViewModel>>("Accordions");
16 }
17
18 <article id="@moduleId" class="accordions-module @themeClass">
19 <div class="accordions-module__text-wrap">
20 @if (!string.IsNullOrWhiteSpace(teaser)) {
21 <div class="accordions-module__teaser rich-text">@teaser</div>
22 }
23 @if (!string.IsNullOrWhiteSpace(linkUrl))
24 {
25 @RenderPartial("/partials/components/link.cshtml", link)
26 }
27 </div>
28 <div class="accordions-module__content-wrap">
29 @if (!string.IsNullOrWhiteSpace(headline))
30 {
31 <h2 class="accordions-module__headline">@headline</h2>
32 }
33 @if (!string.IsNullOrWhiteSpace(richText))
34 {
35 <div class="accordions-module__text rich-text">@richText</div>
36 }
37 <div class="accordions-module__content accordion__list">
38 @if (accordions != null && accordions.Count > 0)
39 {
40 foreach (var item in accordions)
41 {
42 string accordionHeadlineId = $"accordion-item-{item.Id}-headline";
43 string accordionContentId = $"accordtion-item-{item.Id}-content";
44
45 <div class="accordion__item" data-action="accordion">
46 <a href="#@accordionContentId" class="accordion__headline" id="@accordionHeadlineId" role="button" aria-expanded="false" aria-controls="@accordionContentId">
47 <h3 class="accordion__headline-inner">@item.GetString("Headline")</h3>
48 </a>
49 <div class="accordion__content-wrap" id="@accordionContentId" aria-hidden="true" aria-labelledby="@accordionHeadlineId">
50 <div class="accordion__content rich-text">@item.GetString("RichText")</div>
51 </div>
52 </div>
53 }
54 }
55 </div>
56 </div>
57 </article>
Error executing template "Designs/Baseline/Paragraph/accordions.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_758301150dbb4d8a98c2ea3e4f26d3a1.ExecuteAsync()
at RazorEngine.Templating.TemplateBase.Run(ExecuteContext context, TextWriter reader)
at RazorEngine.Templating.RazorEngineCore.RunTemplate(ICompiledTemplate template, TextWriter writer, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.DynamicWrapperService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.Run(IRazorEngineService service, String name, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass23_0.<Run>b__0(TextWriter writer)
at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
at RazorEngine.Templating.RazorEngineServiceExtensions.Run(IRazorEngineService service, String name, Type modelType, Object model, DynamicViewBag viewBag)
at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
at Dynamicweb.Rendering.Template.RenderRazorTemplate()
1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel>
2 @using Dynamicweb.Frontend
3
4 @{
5 string moduleId = $"module{Model.ID}";
6 string themeValue = Model.Item.GetString("Theme");
7 string themeClass = $"theme{themeValue}";
8
9 string headline = Model.Item.GetString("Headline");
10 string teaser = Model.Item.GetString("Teaser");
11 string richText = Model.Item.GetString("RichText");
12 var link = Model.Item.GetValue<ItemViewModel>("Link");
13 string linkUrl = link.GetString("Link");
14 linkUrl = linkUrl.IndexOf("#") != -1 ? $"#module{linkUrl.Substring(linkUrl.IndexOf("#") + 1)}" : linkUrl;
15 var accordions = Model.Item.GetValue<List<ItemViewModel>>("Accordions");
16 }
17
18 <article id="@moduleId" class="accordions-module @themeClass">
19 <div class="accordions-module__text-wrap">
20 @if (!string.IsNullOrWhiteSpace(teaser)) {
21 <div class="accordions-module__teaser rich-text">@teaser</div>
22 }
23 @if (!string.IsNullOrWhiteSpace(linkUrl))
24 {
25 @RenderPartial("/partials/components/link.cshtml", link)
26 }
27 </div>
28 <div class="accordions-module__content-wrap">
29 @if (!string.IsNullOrWhiteSpace(headline))
30 {
31 <h2 class="accordions-module__headline">@headline</h2>
32 }
33 @if (!string.IsNullOrWhiteSpace(richText))
34 {
35 <div class="accordions-module__text rich-text">@richText</div>
36 }
37 <div class="accordions-module__content accordion__list">
38 @if (accordions != null && accordions.Count > 0)
39 {
40 foreach (var item in accordions)
41 {
42 string accordionHeadlineId = $"accordion-item-{item.Id}-headline";
43 string accordionContentId = $"accordtion-item-{item.Id}-content";
44
45 <div class="accordion__item" data-action="accordion">
46 <a href="#@accordionContentId" class="accordion__headline" id="@accordionHeadlineId" role="button" aria-expanded="false" aria-controls="@accordionContentId">
47 <h3 class="accordion__headline-inner">@item.GetString("Headline")</h3>
48 </a>
49 <div class="accordion__content-wrap" id="@accordionContentId" aria-hidden="true" aria-labelledby="@accordionHeadlineId">
50 <div class="accordion__content rich-text">@item.GetString("RichText")</div>
51 </div>
52 </div>
53 }
54 }
55 </div>
56 </div>
57 </article>
Error executing template "Designs/Baseline/Paragraph/accordions.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_758301150dbb4d8a98c2ea3e4f26d3a1.ExecuteAsync()
at RazorEngine.Templating.TemplateBase.Run(ExecuteContext context, TextWriter reader)
at RazorEngine.Templating.RazorEngineCore.RunTemplate(ICompiledTemplate template, TextWriter writer, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.DynamicWrapperService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.Run(IRazorEngineService service, String name, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass23_0.<Run>b__0(TextWriter writer)
at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
at RazorEngine.Templating.RazorEngineServiceExtensions.Run(IRazorEngineService service, String name, Type modelType, Object model, DynamicViewBag viewBag)
at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
at Dynamicweb.Rendering.Template.RenderRazorTemplate()
1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel>
2 @using Dynamicweb.Frontend
3
4 @{
5 string moduleId = $"module{Model.ID}";
6 string themeValue = Model.Item.GetString("Theme");
7 string themeClass = $"theme{themeValue}";
8
9 string headline = Model.Item.GetString("Headline");
10 string teaser = Model.Item.GetString("Teaser");
11 string richText = Model.Item.GetString("RichText");
12 var link = Model.Item.GetValue<ItemViewModel>("Link");
13 string linkUrl = link.GetString("Link");
14 linkUrl = linkUrl.IndexOf("#") != -1 ? $"#module{linkUrl.Substring(linkUrl.IndexOf("#") + 1)}" : linkUrl;
15 var accordions = Model.Item.GetValue<List<ItemViewModel>>("Accordions");
16 }
17
18 <article id="@moduleId" class="accordions-module @themeClass">
19 <div class="accordions-module__text-wrap">
20 @if (!string.IsNullOrWhiteSpace(teaser)) {
21 <div class="accordions-module__teaser rich-text">@teaser</div>
22 }
23 @if (!string.IsNullOrWhiteSpace(linkUrl))
24 {
25 @RenderPartial("/partials/components/link.cshtml", link)
26 }
27 </div>
28 <div class="accordions-module__content-wrap">
29 @if (!string.IsNullOrWhiteSpace(headline))
30 {
31 <h2 class="accordions-module__headline">@headline</h2>
32 }
33 @if (!string.IsNullOrWhiteSpace(richText))
34 {
35 <div class="accordions-module__text rich-text">@richText</div>
36 }
37 <div class="accordions-module__content accordion__list">
38 @if (accordions != null && accordions.Count > 0)
39 {
40 foreach (var item in accordions)
41 {
42 string accordionHeadlineId = $"accordion-item-{item.Id}-headline";
43 string accordionContentId = $"accordtion-item-{item.Id}-content";
44
45 <div class="accordion__item" data-action="accordion">
46 <a href="#@accordionContentId" class="accordion__headline" id="@accordionHeadlineId" role="button" aria-expanded="false" aria-controls="@accordionContentId">
47 <h3 class="accordion__headline-inner">@item.GetString("Headline")</h3>
48 </a>
49 <div class="accordion__content-wrap" id="@accordionContentId" aria-hidden="true" aria-labelledby="@accordionHeadlineId">
50 <div class="accordion__content rich-text">@item.GetString("RichText")</div>
51 </div>
52 </div>
53 }
54 }
55 </div>
56 </div>
57 </article>
Error executing template "Designs/Baseline/Paragraph/accordions.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_758301150dbb4d8a98c2ea3e4f26d3a1.ExecuteAsync()
at RazorEngine.Templating.TemplateBase.Run(ExecuteContext context, TextWriter reader)
at RazorEngine.Templating.RazorEngineCore.RunTemplate(ICompiledTemplate template, TextWriter writer, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.DynamicWrapperService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.Run(IRazorEngineService service, String name, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass23_0.<Run>b__0(TextWriter writer)
at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
at RazorEngine.Templating.RazorEngineServiceExtensions.Run(IRazorEngineService service, String name, Type modelType, Object model, DynamicViewBag viewBag)
at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
at Dynamicweb.Rendering.Template.RenderRazorTemplate()
1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel>
2 @using Dynamicweb.Frontend
3
4 @{
5 string moduleId = $"module{Model.ID}";
6 string themeValue = Model.Item.GetString("Theme");
7 string themeClass = $"theme{themeValue}";
8
9 string headline = Model.Item.GetString("Headline");
10 string teaser = Model.Item.GetString("Teaser");
11 string richText = Model.Item.GetString("RichText");
12 var link = Model.Item.GetValue<ItemViewModel>("Link");
13 string linkUrl = link.GetString("Link");
14 linkUrl = linkUrl.IndexOf("#") != -1 ? $"#module{linkUrl.Substring(linkUrl.IndexOf("#") + 1)}" : linkUrl;
15 var accordions = Model.Item.GetValue<List<ItemViewModel>>("Accordions");
16 }
17
18 <article id="@moduleId" class="accordions-module @themeClass">
19 <div class="accordions-module__text-wrap">
20 @if (!string.IsNullOrWhiteSpace(teaser)) {
21 <div class="accordions-module__teaser rich-text">@teaser</div>
22 }
23 @if (!string.IsNullOrWhiteSpace(linkUrl))
24 {
25 @RenderPartial("/partials/components/link.cshtml", link)
26 }
27 </div>
28 <div class="accordions-module__content-wrap">
29 @if (!string.IsNullOrWhiteSpace(headline))
30 {
31 <h2 class="accordions-module__headline">@headline</h2>
32 }
33 @if (!string.IsNullOrWhiteSpace(richText))
34 {
35 <div class="accordions-module__text rich-text">@richText</div>
36 }
37 <div class="accordions-module__content accordion__list">
38 @if (accordions != null && accordions.Count > 0)
39 {
40 foreach (var item in accordions)
41 {
42 string accordionHeadlineId = $"accordion-item-{item.Id}-headline";
43 string accordionContentId = $"accordtion-item-{item.Id}-content";
44
45 <div class="accordion__item" data-action="accordion">
46 <a href="#@accordionContentId" class="accordion__headline" id="@accordionHeadlineId" role="button" aria-expanded="false" aria-controls="@accordionContentId">
47 <h3 class="accordion__headline-inner">@item.GetString("Headline")</h3>
48 </a>
49 <div class="accordion__content-wrap" id="@accordionContentId" aria-hidden="true" aria-labelledby="@accordionHeadlineId">
50 <div class="accordion__content rich-text">@item.GetString("RichText")</div>
51 </div>
52 </div>
53 }
54 }
55 </div>
56 </div>
57 </article>
Error executing template "Designs/Baseline/Paragraph/accordions.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_758301150dbb4d8a98c2ea3e4f26d3a1.ExecuteAsync()
at RazorEngine.Templating.TemplateBase.Run(ExecuteContext context, TextWriter reader)
at RazorEngine.Templating.RazorEngineCore.RunTemplate(ICompiledTemplate template, TextWriter writer, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.DynamicWrapperService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.Run(IRazorEngineService service, String name, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass23_0.<Run>b__0(TextWriter writer)
at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
at RazorEngine.Templating.RazorEngineServiceExtensions.Run(IRazorEngineService service, String name, Type modelType, Object model, DynamicViewBag viewBag)
at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
at Dynamicweb.Rendering.Template.RenderRazorTemplate()
1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel>
2 @using Dynamicweb.Frontend
3
4 @{
5 string moduleId = $"module{Model.ID}";
6 string themeValue = Model.Item.GetString("Theme");
7 string themeClass = $"theme{themeValue}";
8
9 string headline = Model.Item.GetString("Headline");
10 string teaser = Model.Item.GetString("Teaser");
11 string richText = Model.Item.GetString("RichText");
12 var link = Model.Item.GetValue<ItemViewModel>("Link");
13 string linkUrl = link.GetString("Link");
14 linkUrl = linkUrl.IndexOf("#") != -1 ? $"#module{linkUrl.Substring(linkUrl.IndexOf("#") + 1)}" : linkUrl;
15 var accordions = Model.Item.GetValue<List<ItemViewModel>>("Accordions");
16 }
17
18 <article id="@moduleId" class="accordions-module @themeClass">
19 <div class="accordions-module__text-wrap">
20 @if (!string.IsNullOrWhiteSpace(teaser)) {
21 <div class="accordions-module__teaser rich-text">@teaser</div>
22 }
23 @if (!string.IsNullOrWhiteSpace(linkUrl))
24 {
25 @RenderPartial("/partials/components/link.cshtml", link)
26 }
27 </div>
28 <div class="accordions-module__content-wrap">
29 @if (!string.IsNullOrWhiteSpace(headline))
30 {
31 <h2 class="accordions-module__headline">@headline</h2>
32 }
33 @if (!string.IsNullOrWhiteSpace(richText))
34 {
35 <div class="accordions-module__text rich-text">@richText</div>
36 }
37 <div class="accordions-module__content accordion__list">
38 @if (accordions != null && accordions.Count > 0)
39 {
40 foreach (var item in accordions)
41 {
42 string accordionHeadlineId = $"accordion-item-{item.Id}-headline";
43 string accordionContentId = $"accordtion-item-{item.Id}-content";
44
45 <div class="accordion__item" data-action="accordion">
46 <a href="#@accordionContentId" class="accordion__headline" id="@accordionHeadlineId" role="button" aria-expanded="false" aria-controls="@accordionContentId">
47 <h3 class="accordion__headline-inner">@item.GetString("Headline")</h3>
48 </a>
49 <div class="accordion__content-wrap" id="@accordionContentId" aria-hidden="true" aria-labelledby="@accordionHeadlineId">
50 <div class="accordion__content rich-text">@item.GetString("RichText")</div>
51 </div>
52 </div>
53 }
54 }
55 </div>
56 </div>
57 </article>