Skolemad der passer til virkeligheden

Vi laver realistiske og praktiske måltidsløsninger, så børnene får god mad hver dag

Med 20 års erfaring i børnemad og bæredygtige måltidsordninger har vi fundet en vej, der virker - og vi ved, hvordan man skaber robuste løsninger, der ikke vælter ved sygdom eller hverdagstravlhed. Vi sørger for, at børnene får sund mad hver dag, tilpasset de faktiske rammer på skolerne - uden at gå på kompromis med kvalitet. Maden skal kun delvist tilberedes, af en køkkenansvarlig, i skolens eget køkken – vi har allerede gjort forarbejdet. 

Maden bestilles i vores webshop og jeres køkkenansvarlige følger opskrifterne og forvandler de gode råvarer til dejlige retter. Nemt, ikke?

En komplet, nem og fleksibel skolemadsløsning

At servere børnemad skal ganske enkelt være simpelt - og møg lækkert. Vi sikrer en tryg og overskuelig proces, så skoler uden produktionskøkken stadig kan tilbyde dejlig skolemad. Vi tager os af alt det praktiske forarbejde og sørger for alt fra:

Error executing template "Designs/Swift/Paragraph/Swift_Feature.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_aaebe9563ef2480eaf3c7369e15ee87f.Execute() in D:\dynamicweb.net\Solutions\composeit\FruHansensKaelder\Files\Templates\Designs\Swift\Paragraph\Swift_Feature.cshtml:line 20
   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 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 2 @using System.IO 3 4 @{ 5 string layout = Model.Item.GetRawValueString("Layout", "icon-top"); 6 string contentPadding = Model.Item.GetRawValueString("ContentPadding", string.Empty); 7 contentPadding = contentPadding == "none" ? "" : contentPadding; 8 contentPadding = contentPadding == "small" ? "p-3 p-md-3" : contentPadding; 9 contentPadding = contentPadding == "large" ? "p-5 p-md-5" : contentPadding; 10 string theme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("Theme")) ? " theme " + Model.Item.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : string.Empty; 11 12 string target = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && Model.Item.GetString("Link").Contains("http") ? "target=\"_blank\"" : string.Empty; 13 string rel = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && Model.Item.GetString("Link").Contains("http") ? "rel=\"noopener\"" : string.Empty; 14 string alignment = (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) && !string.IsNullOrEmpty(Model.Item.GetString("Text")) ? "align-items-stretch" : "align-items-center"; 15 16 string iconColor = Model.Item.GetString("iconColor", "text-inherit"); 17 string iconOpacity = Model.Item.GetString("IconOpacity", "opacity-100"); 18 19 string iconSize = Model.Item.GetRawValueString("IconSize", "2"); 20 string imageSrc = !string.IsNullOrEmpty(Model.Item.GetString("Image")) ? Model.Item.GetFile("Image").Path : string.Empty; 21 string flexGrowClass = string.Empty; 22 23 switch (layout) 24 { 25 case "icon-left": 26 case "icon-right": 27 flexGrowClass = "flex-grow-0"; 28 break; 29 } 30 31 string imagePath = imageSrc != string.Empty ? imageSrc : Model.Item.GetRawValueString("Icon", string.Empty); 32 imagePath = Path.GetExtension(imagePath).ToLower() != ".svg" ? "/Admin/Public/GetImage.ashx?image=" + imagePath + "&height=" + iconSize + "&width=" + iconSize + "&Crop=0&format=webp" : imagePath; 33 string imgAltText = Model.Item.GetRawValueString("FeatureAltText", string.Empty); 34 35 string titleFontSize = Model.Item.GetRawValueString("TitleFontSize", "h4"); 36 string titleColor = Model.Item.GetString("TitleColor", "text-inherit"); 37 string titleOpacity = Model.Item.GetString("TitleOpacity", "opacity-100"); 38 string headingLevel = Model.Item.GetString("HeadingLevel", "h2"); 39 string headingLevelStart = $"<{headingLevel} class=\"{titleFontSize} {titleColor} {titleOpacity} m-0\">"; 40 string headingLevelStop = $"</{headingLevel}>"; 41 42 string textColor = Model.Item.GetString("TextColor", "text-inherit"); 43 string textOpacity = Model.Item.GetString("TextOpacity", "opacity-100"); 44 } 45 46 <div class="h-100 @(contentPadding)@(theme) item_@Model.Item.SystemName.ToLower()"> 47 <div id="@Model.ID" class="user-select-none" style="scroll-margin-top:var(--header-height,150px)"></div> 48 @if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 49 { 50 @:<a href="@Model.Item.GetString("Link")" class="text-decoration-none d-block h-100" @target @rel> 51 } 52 53 @switch (layout) 54 { 55 case "icon-top": 56 <div class="d-flex flex-column gap-3 text-center mb-0-last-child"> 57 @if (!string.IsNullOrEmpty(Model.Item.GetString("Image")) || !imagePath.ToLower().Contains("none") && imagePath != string.Empty) 58 {<div class="@flexGrowClass"> 59 @if (Path.GetExtension(imagePath).ToLower() == ".svg") 60 { 61 <div class="icon-auto @iconColor @iconOpacity" style="height: @(iconSize)px; width: @(iconSize)px;">@ReadFile(imagePath)</div> 62 } 63 else 64 { 65 <img loading="lazy" src="@imagePath" alt="@imgAltText" title="@Model.Item.GetString("Title")" style="height: @(iconSize)px; width: @(iconSize)px;"> 66 } 67 </div> 68 } 69 70 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle") || !string.IsNullOrEmpty(Model.Item.GetString("Text"))) 71 { 72 <div class="mb-0-last-child"> 73 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) 74 { 75 @headingLevelStart 76 @Model.Item.GetString("Title") 77 @headingLevelStop 78 } 79 80 @if (!string.IsNullOrEmpty(Model.Item.GetString("Text"))) 81 { 82 <p class="@textColor @textOpacity m-0">@Model.Item.GetString("Text")</p> 83 } 84 </div> 85 } 86 </div> 87 break; 88 case "icon-left": 89 <div class="d-flex flex-row gap-3 h-100 text-start @alignment"> 90 @if (!string.IsNullOrEmpty(Model.Item.GetString("Image")) || !imagePath.ToLower().Contains("none") && imagePath != string.Empty) 91 {<div class="@flexGrowClass"> 92 @if (Path.GetExtension(imagePath).ToLower() == ".svg") 93 { 94 <div class="icon-auto @iconColor @iconOpacity" style="height: @(iconSize)px; width: @(iconSize)px;">@ReadFile(imagePath)</div> 95 } 96 else 97 { 98 <img loading="lazy" src="@imagePath" alt="@imgAltText" title="@Model.Item.GetString("Title")" style="height: @(iconSize)px; width: @(iconSize)px;"> 99 } 100 </div> 101 } 102 103 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle") || !string.IsNullOrEmpty(Model.Item.GetString("Text"))) 104 { 105 <div class="d-flex flex-column flex-grow-1"> 106 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) 107 { 108 @headingLevelStart 109 @Model.Item.GetString("Title") 110 @headingLevelStop 111 } 112 113 @if (!string.IsNullOrEmpty(Model.Item.GetString("Text"))) 114 { 115 <p class="@textColor @textOpacity m-0">@Model.Item.GetString("Text")</p> 116 } 117 </div> 118 } 119 120 </div> 121 break; 122 case "icon-right": 123 <div class="d-flex flex-row gap-3 h-100 text-end @alignment"> 124 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle") || !string.IsNullOrEmpty(Model.Item.GetString("Text"))) 125 { 126 <div class="d-flex flex-column flex-grow-1"> 127 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) 128 { 129 @headingLevelStart 130 @Model.Item.GetString("Title") 131 @headingLevelStop 132 } 133 134 @if (!string.IsNullOrEmpty(Model.Item.GetString("Text"))) 135 { 136 <p class="@textColor @textOpacity m-0">@Model.Item.GetString("Text")</p> 137 } 138 </div> 139 } 140 141 @if (!string.IsNullOrEmpty(Model.Item.GetString("Image")) || !imagePath.ToLower().Contains("none") && imagePath != string.Empty) 142 {<div class="@flexGrowClass"> 143 @if (Path.GetExtension(imagePath).ToLower() == ".svg") 144 { 145 <div class="icon-auto @iconColor @iconOpacity" style="height: @(iconSize)px; width: @(iconSize)px;">@ReadFile(imagePath)</div> 146 } 147 else 148 { 149 <img loading="lazy" src="@imagePath" alt="@imgAltText" title="@Model.Item.GetString("Title")" style="height: @(iconSize)px; width: @(iconSize)px;"> 150 } 151 </div> 152 } 153 </div> 154 break; 155 } 156 157 @if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 158 { 159 @:</a> 160 } 161 </div> 162
Error executing template "Designs/Swift/Paragraph/Swift_Feature.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_aaebe9563ef2480eaf3c7369e15ee87f.Execute() in D:\dynamicweb.net\Solutions\composeit\FruHansensKaelder\Files\Templates\Designs\Swift\Paragraph\Swift_Feature.cshtml:line 20
   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 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 2 @using System.IO 3 4 @{ 5 string layout = Model.Item.GetRawValueString("Layout", "icon-top"); 6 string contentPadding = Model.Item.GetRawValueString("ContentPadding", string.Empty); 7 contentPadding = contentPadding == "none" ? "" : contentPadding; 8 contentPadding = contentPadding == "small" ? "p-3 p-md-3" : contentPadding; 9 contentPadding = contentPadding == "large" ? "p-5 p-md-5" : contentPadding; 10 string theme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("Theme")) ? " theme " + Model.Item.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : string.Empty; 11 12 string target = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && Model.Item.GetString("Link").Contains("http") ? "target=\"_blank\"" : string.Empty; 13 string rel = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && Model.Item.GetString("Link").Contains("http") ? "rel=\"noopener\"" : string.Empty; 14 string alignment = (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) && !string.IsNullOrEmpty(Model.Item.GetString("Text")) ? "align-items-stretch" : "align-items-center"; 15 16 string iconColor = Model.Item.GetString("iconColor", "text-inherit"); 17 string iconOpacity = Model.Item.GetString("IconOpacity", "opacity-100"); 18 19 string iconSize = Model.Item.GetRawValueString("IconSize", "2"); 20 string imageSrc = !string.IsNullOrEmpty(Model.Item.GetString("Image")) ? Model.Item.GetFile("Image").Path : string.Empty; 21 string flexGrowClass = string.Empty; 22 23 switch (layout) 24 { 25 case "icon-left": 26 case "icon-right": 27 flexGrowClass = "flex-grow-0"; 28 break; 29 } 30 31 string imagePath = imageSrc != string.Empty ? imageSrc : Model.Item.GetRawValueString("Icon", string.Empty); 32 imagePath = Path.GetExtension(imagePath).ToLower() != ".svg" ? "/Admin/Public/GetImage.ashx?image=" + imagePath + "&height=" + iconSize + "&width=" + iconSize + "&Crop=0&format=webp" : imagePath; 33 string imgAltText = Model.Item.GetRawValueString("FeatureAltText", string.Empty); 34 35 string titleFontSize = Model.Item.GetRawValueString("TitleFontSize", "h4"); 36 string titleColor = Model.Item.GetString("TitleColor", "text-inherit"); 37 string titleOpacity = Model.Item.GetString("TitleOpacity", "opacity-100"); 38 string headingLevel = Model.Item.GetString("HeadingLevel", "h2"); 39 string headingLevelStart = $"<{headingLevel} class=\"{titleFontSize} {titleColor} {titleOpacity} m-0\">"; 40 string headingLevelStop = $"</{headingLevel}>"; 41 42 string textColor = Model.Item.GetString("TextColor", "text-inherit"); 43 string textOpacity = Model.Item.GetString("TextOpacity", "opacity-100"); 44 } 45 46 <div class="h-100 @(contentPadding)@(theme) item_@Model.Item.SystemName.ToLower()"> 47 <div id="@Model.ID" class="user-select-none" style="scroll-margin-top:var(--header-height,150px)"></div> 48 @if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 49 { 50 @:<a href="@Model.Item.GetString("Link")" class="text-decoration-none d-block h-100" @target @rel> 51 } 52 53 @switch (layout) 54 { 55 case "icon-top": 56 <div class="d-flex flex-column gap-3 text-center mb-0-last-child"> 57 @if (!string.IsNullOrEmpty(Model.Item.GetString("Image")) || !imagePath.ToLower().Contains("none") && imagePath != string.Empty) 58 {<div class="@flexGrowClass"> 59 @if (Path.GetExtension(imagePath).ToLower() == ".svg") 60 { 61 <div class="icon-auto @iconColor @iconOpacity" style="height: @(iconSize)px; width: @(iconSize)px;">@ReadFile(imagePath)</div> 62 } 63 else 64 { 65 <img loading="lazy" src="@imagePath" alt="@imgAltText" title="@Model.Item.GetString("Title")" style="height: @(iconSize)px; width: @(iconSize)px;"> 66 } 67 </div> 68 } 69 70 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle") || !string.IsNullOrEmpty(Model.Item.GetString("Text"))) 71 { 72 <div class="mb-0-last-child"> 73 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) 74 { 75 @headingLevelStart 76 @Model.Item.GetString("Title") 77 @headingLevelStop 78 } 79 80 @if (!string.IsNullOrEmpty(Model.Item.GetString("Text"))) 81 { 82 <p class="@textColor @textOpacity m-0">@Model.Item.GetString("Text")</p> 83 } 84 </div> 85 } 86 </div> 87 break; 88 case "icon-left": 89 <div class="d-flex flex-row gap-3 h-100 text-start @alignment"> 90 @if (!string.IsNullOrEmpty(Model.Item.GetString("Image")) || !imagePath.ToLower().Contains("none") && imagePath != string.Empty) 91 {<div class="@flexGrowClass"> 92 @if (Path.GetExtension(imagePath).ToLower() == ".svg") 93 { 94 <div class="icon-auto @iconColor @iconOpacity" style="height: @(iconSize)px; width: @(iconSize)px;">@ReadFile(imagePath)</div> 95 } 96 else 97 { 98 <img loading="lazy" src="@imagePath" alt="@imgAltText" title="@Model.Item.GetString("Title")" style="height: @(iconSize)px; width: @(iconSize)px;"> 99 } 100 </div> 101 } 102 103 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle") || !string.IsNullOrEmpty(Model.Item.GetString("Text"))) 104 { 105 <div class="d-flex flex-column flex-grow-1"> 106 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) 107 { 108 @headingLevelStart 109 @Model.Item.GetString("Title") 110 @headingLevelStop 111 } 112 113 @if (!string.IsNullOrEmpty(Model.Item.GetString("Text"))) 114 { 115 <p class="@textColor @textOpacity m-0">@Model.Item.GetString("Text")</p> 116 } 117 </div> 118 } 119 120 </div> 121 break; 122 case "icon-right": 123 <div class="d-flex flex-row gap-3 h-100 text-end @alignment"> 124 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle") || !string.IsNullOrEmpty(Model.Item.GetString("Text"))) 125 { 126 <div class="d-flex flex-column flex-grow-1"> 127 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) 128 { 129 @headingLevelStart 130 @Model.Item.GetString("Title") 131 @headingLevelStop 132 } 133 134 @if (!string.IsNullOrEmpty(Model.Item.GetString("Text"))) 135 { 136 <p class="@textColor @textOpacity m-0">@Model.Item.GetString("Text")</p> 137 } 138 </div> 139 } 140 141 @if (!string.IsNullOrEmpty(Model.Item.GetString("Image")) || !imagePath.ToLower().Contains("none") && imagePath != string.Empty) 142 {<div class="@flexGrowClass"> 143 @if (Path.GetExtension(imagePath).ToLower() == ".svg") 144 { 145 <div class="icon-auto @iconColor @iconOpacity" style="height: @(iconSize)px; width: @(iconSize)px;">@ReadFile(imagePath)</div> 146 } 147 else 148 { 149 <img loading="lazy" src="@imagePath" alt="@imgAltText" title="@Model.Item.GetString("Title")" style="height: @(iconSize)px; width: @(iconSize)px;"> 150 } 151 </div> 152 } 153 </div> 154 break; 155 } 156 157 @if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 158 { 159 @:</a> 160 } 161 </div> 162
Error executing template "Designs/Swift/Paragraph/Swift_Feature.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_aaebe9563ef2480eaf3c7369e15ee87f.Execute() in D:\dynamicweb.net\Solutions\composeit\FruHansensKaelder\Files\Templates\Designs\Swift\Paragraph\Swift_Feature.cshtml:line 20
   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 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 2 @using System.IO 3 4 @{ 5 string layout = Model.Item.GetRawValueString("Layout", "icon-top"); 6 string contentPadding = Model.Item.GetRawValueString("ContentPadding", string.Empty); 7 contentPadding = contentPadding == "none" ? "" : contentPadding; 8 contentPadding = contentPadding == "small" ? "p-3 p-md-3" : contentPadding; 9 contentPadding = contentPadding == "large" ? "p-5 p-md-5" : contentPadding; 10 string theme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("Theme")) ? " theme " + Model.Item.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : string.Empty; 11 12 string target = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && Model.Item.GetString("Link").Contains("http") ? "target=\"_blank\"" : string.Empty; 13 string rel = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && Model.Item.GetString("Link").Contains("http") ? "rel=\"noopener\"" : string.Empty; 14 string alignment = (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) && !string.IsNullOrEmpty(Model.Item.GetString("Text")) ? "align-items-stretch" : "align-items-center"; 15 16 string iconColor = Model.Item.GetString("iconColor", "text-inherit"); 17 string iconOpacity = Model.Item.GetString("IconOpacity", "opacity-100"); 18 19 string iconSize = Model.Item.GetRawValueString("IconSize", "2"); 20 string imageSrc = !string.IsNullOrEmpty(Model.Item.GetString("Image")) ? Model.Item.GetFile("Image").Path : string.Empty; 21 string flexGrowClass = string.Empty; 22 23 switch (layout) 24 { 25 case "icon-left": 26 case "icon-right": 27 flexGrowClass = "flex-grow-0"; 28 break; 29 } 30 31 string imagePath = imageSrc != string.Empty ? imageSrc : Model.Item.GetRawValueString("Icon", string.Empty); 32 imagePath = Path.GetExtension(imagePath).ToLower() != ".svg" ? "/Admin/Public/GetImage.ashx?image=" + imagePath + "&height=" + iconSize + "&width=" + iconSize + "&Crop=0&format=webp" : imagePath; 33 string imgAltText = Model.Item.GetRawValueString("FeatureAltText", string.Empty); 34 35 string titleFontSize = Model.Item.GetRawValueString("TitleFontSize", "h4"); 36 string titleColor = Model.Item.GetString("TitleColor", "text-inherit"); 37 string titleOpacity = Model.Item.GetString("TitleOpacity", "opacity-100"); 38 string headingLevel = Model.Item.GetString("HeadingLevel", "h2"); 39 string headingLevelStart = $"<{headingLevel} class=\"{titleFontSize} {titleColor} {titleOpacity} m-0\">"; 40 string headingLevelStop = $"</{headingLevel}>"; 41 42 string textColor = Model.Item.GetString("TextColor", "text-inherit"); 43 string textOpacity = Model.Item.GetString("TextOpacity", "opacity-100"); 44 } 45 46 <div class="h-100 @(contentPadding)@(theme) item_@Model.Item.SystemName.ToLower()"> 47 <div id="@Model.ID" class="user-select-none" style="scroll-margin-top:var(--header-height,150px)"></div> 48 @if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 49 { 50 @:<a href="@Model.Item.GetString("Link")" class="text-decoration-none d-block h-100" @target @rel> 51 } 52 53 @switch (layout) 54 { 55 case "icon-top": 56 <div class="d-flex flex-column gap-3 text-center mb-0-last-child"> 57 @if (!string.IsNullOrEmpty(Model.Item.GetString("Image")) || !imagePath.ToLower().Contains("none") && imagePath != string.Empty) 58 {<div class="@flexGrowClass"> 59 @if (Path.GetExtension(imagePath).ToLower() == ".svg") 60 { 61 <div class="icon-auto @iconColor @iconOpacity" style="height: @(iconSize)px; width: @(iconSize)px;">@ReadFile(imagePath)</div> 62 } 63 else 64 { 65 <img loading="lazy" src="@imagePath" alt="@imgAltText" title="@Model.Item.GetString("Title")" style="height: @(iconSize)px; width: @(iconSize)px;"> 66 } 67 </div> 68 } 69 70 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle") || !string.IsNullOrEmpty(Model.Item.GetString("Text"))) 71 { 72 <div class="mb-0-last-child"> 73 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) 74 { 75 @headingLevelStart 76 @Model.Item.GetString("Title") 77 @headingLevelStop 78 } 79 80 @if (!string.IsNullOrEmpty(Model.Item.GetString("Text"))) 81 { 82 <p class="@textColor @textOpacity m-0">@Model.Item.GetString("Text")</p> 83 } 84 </div> 85 } 86 </div> 87 break; 88 case "icon-left": 89 <div class="d-flex flex-row gap-3 h-100 text-start @alignment"> 90 @if (!string.IsNullOrEmpty(Model.Item.GetString("Image")) || !imagePath.ToLower().Contains("none") && imagePath != string.Empty) 91 {<div class="@flexGrowClass"> 92 @if (Path.GetExtension(imagePath).ToLower() == ".svg") 93 { 94 <div class="icon-auto @iconColor @iconOpacity" style="height: @(iconSize)px; width: @(iconSize)px;">@ReadFile(imagePath)</div> 95 } 96 else 97 { 98 <img loading="lazy" src="@imagePath" alt="@imgAltText" title="@Model.Item.GetString("Title")" style="height: @(iconSize)px; width: @(iconSize)px;"> 99 } 100 </div> 101 } 102 103 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle") || !string.IsNullOrEmpty(Model.Item.GetString("Text"))) 104 { 105 <div class="d-flex flex-column flex-grow-1"> 106 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) 107 { 108 @headingLevelStart 109 @Model.Item.GetString("Title") 110 @headingLevelStop 111 } 112 113 @if (!string.IsNullOrEmpty(Model.Item.GetString("Text"))) 114 { 115 <p class="@textColor @textOpacity m-0">@Model.Item.GetString("Text")</p> 116 } 117 </div> 118 } 119 120 </div> 121 break; 122 case "icon-right": 123 <div class="d-flex flex-row gap-3 h-100 text-end @alignment"> 124 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle") || !string.IsNullOrEmpty(Model.Item.GetString("Text"))) 125 { 126 <div class="d-flex flex-column flex-grow-1"> 127 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) 128 { 129 @headingLevelStart 130 @Model.Item.GetString("Title") 131 @headingLevelStop 132 } 133 134 @if (!string.IsNullOrEmpty(Model.Item.GetString("Text"))) 135 { 136 <p class="@textColor @textOpacity m-0">@Model.Item.GetString("Text")</p> 137 } 138 </div> 139 } 140 141 @if (!string.IsNullOrEmpty(Model.Item.GetString("Image")) || !imagePath.ToLower().Contains("none") && imagePath != string.Empty) 142 {<div class="@flexGrowClass"> 143 @if (Path.GetExtension(imagePath).ToLower() == ".svg") 144 { 145 <div class="icon-auto @iconColor @iconOpacity" style="height: @(iconSize)px; width: @(iconSize)px;">@ReadFile(imagePath)</div> 146 } 147 else 148 { 149 <img loading="lazy" src="@imagePath" alt="@imgAltText" title="@Model.Item.GetString("Title")" style="height: @(iconSize)px; width: @(iconSize)px;"> 150 } 151 </div> 152 } 153 </div> 154 break; 155 } 156 157 @if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 158 { 159 @:</a> 160 } 161 </div> 162
Error executing template "Designs/Swift/Paragraph/Swift_Feature.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_aaebe9563ef2480eaf3c7369e15ee87f.Execute() in D:\dynamicweb.net\Solutions\composeit\FruHansensKaelder\Files\Templates\Designs\Swift\Paragraph\Swift_Feature.cshtml:line 20
   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 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 2 @using System.IO 3 4 @{ 5 string layout = Model.Item.GetRawValueString("Layout", "icon-top"); 6 string contentPadding = Model.Item.GetRawValueString("ContentPadding", string.Empty); 7 contentPadding = contentPadding == "none" ? "" : contentPadding; 8 contentPadding = contentPadding == "small" ? "p-3 p-md-3" : contentPadding; 9 contentPadding = contentPadding == "large" ? "p-5 p-md-5" : contentPadding; 10 string theme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("Theme")) ? " theme " + Model.Item.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : string.Empty; 11 12 string target = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && Model.Item.GetString("Link").Contains("http") ? "target=\"_blank\"" : string.Empty; 13 string rel = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && Model.Item.GetString("Link").Contains("http") ? "rel=\"noopener\"" : string.Empty; 14 string alignment = (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) && !string.IsNullOrEmpty(Model.Item.GetString("Text")) ? "align-items-stretch" : "align-items-center"; 15 16 string iconColor = Model.Item.GetString("iconColor", "text-inherit"); 17 string iconOpacity = Model.Item.GetString("IconOpacity", "opacity-100"); 18 19 string iconSize = Model.Item.GetRawValueString("IconSize", "2"); 20 string imageSrc = !string.IsNullOrEmpty(Model.Item.GetString("Image")) ? Model.Item.GetFile("Image").Path : string.Empty; 21 string flexGrowClass = string.Empty; 22 23 switch (layout) 24 { 25 case "icon-left": 26 case "icon-right": 27 flexGrowClass = "flex-grow-0"; 28 break; 29 } 30 31 string imagePath = imageSrc != string.Empty ? imageSrc : Model.Item.GetRawValueString("Icon", string.Empty); 32 imagePath = Path.GetExtension(imagePath).ToLower() != ".svg" ? "/Admin/Public/GetImage.ashx?image=" + imagePath + "&height=" + iconSize + "&width=" + iconSize + "&Crop=0&format=webp" : imagePath; 33 string imgAltText = Model.Item.GetRawValueString("FeatureAltText", string.Empty); 34 35 string titleFontSize = Model.Item.GetRawValueString("TitleFontSize", "h4"); 36 string titleColor = Model.Item.GetString("TitleColor", "text-inherit"); 37 string titleOpacity = Model.Item.GetString("TitleOpacity", "opacity-100"); 38 string headingLevel = Model.Item.GetString("HeadingLevel", "h2"); 39 string headingLevelStart = $"<{headingLevel} class=\"{titleFontSize} {titleColor} {titleOpacity} m-0\">"; 40 string headingLevelStop = $"</{headingLevel}>"; 41 42 string textColor = Model.Item.GetString("TextColor", "text-inherit"); 43 string textOpacity = Model.Item.GetString("TextOpacity", "opacity-100"); 44 } 45 46 <div class="h-100 @(contentPadding)@(theme) item_@Model.Item.SystemName.ToLower()"> 47 <div id="@Model.ID" class="user-select-none" style="scroll-margin-top:var(--header-height,150px)"></div> 48 @if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 49 { 50 @:<a href="@Model.Item.GetString("Link")" class="text-decoration-none d-block h-100" @target @rel> 51 } 52 53 @switch (layout) 54 { 55 case "icon-top": 56 <div class="d-flex flex-column gap-3 text-center mb-0-last-child"> 57 @if (!string.IsNullOrEmpty(Model.Item.GetString("Image")) || !imagePath.ToLower().Contains("none") && imagePath != string.Empty) 58 {<div class="@flexGrowClass"> 59 @if (Path.GetExtension(imagePath).ToLower() == ".svg") 60 { 61 <div class="icon-auto @iconColor @iconOpacity" style="height: @(iconSize)px; width: @(iconSize)px;">@ReadFile(imagePath)</div> 62 } 63 else 64 { 65 <img loading="lazy" src="@imagePath" alt="@imgAltText" title="@Model.Item.GetString("Title")" style="height: @(iconSize)px; width: @(iconSize)px;"> 66 } 67 </div> 68 } 69 70 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle") || !string.IsNullOrEmpty(Model.Item.GetString("Text"))) 71 { 72 <div class="mb-0-last-child"> 73 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) 74 { 75 @headingLevelStart 76 @Model.Item.GetString("Title") 77 @headingLevelStop 78 } 79 80 @if (!string.IsNullOrEmpty(Model.Item.GetString("Text"))) 81 { 82 <p class="@textColor @textOpacity m-0">@Model.Item.GetString("Text")</p> 83 } 84 </div> 85 } 86 </div> 87 break; 88 case "icon-left": 89 <div class="d-flex flex-row gap-3 h-100 text-start @alignment"> 90 @if (!string.IsNullOrEmpty(Model.Item.GetString("Image")) || !imagePath.ToLower().Contains("none") && imagePath != string.Empty) 91 {<div class="@flexGrowClass"> 92 @if (Path.GetExtension(imagePath).ToLower() == ".svg") 93 { 94 <div class="icon-auto @iconColor @iconOpacity" style="height: @(iconSize)px; width: @(iconSize)px;">@ReadFile(imagePath)</div> 95 } 96 else 97 { 98 <img loading="lazy" src="@imagePath" alt="@imgAltText" title="@Model.Item.GetString("Title")" style="height: @(iconSize)px; width: @(iconSize)px;"> 99 } 100 </div> 101 } 102 103 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle") || !string.IsNullOrEmpty(Model.Item.GetString("Text"))) 104 { 105 <div class="d-flex flex-column flex-grow-1"> 106 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) 107 { 108 @headingLevelStart 109 @Model.Item.GetString("Title") 110 @headingLevelStop 111 } 112 113 @if (!string.IsNullOrEmpty(Model.Item.GetString("Text"))) 114 { 115 <p class="@textColor @textOpacity m-0">@Model.Item.GetString("Text")</p> 116 } 117 </div> 118 } 119 120 </div> 121 break; 122 case "icon-right": 123 <div class="d-flex flex-row gap-3 h-100 text-end @alignment"> 124 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle") || !string.IsNullOrEmpty(Model.Item.GetString("Text"))) 125 { 126 <div class="d-flex flex-column flex-grow-1"> 127 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) 128 { 129 @headingLevelStart 130 @Model.Item.GetString("Title") 131 @headingLevelStop 132 } 133 134 @if (!string.IsNullOrEmpty(Model.Item.GetString("Text"))) 135 { 136 <p class="@textColor @textOpacity m-0">@Model.Item.GetString("Text")</p> 137 } 138 </div> 139 } 140 141 @if (!string.IsNullOrEmpty(Model.Item.GetString("Image")) || !imagePath.ToLower().Contains("none") && imagePath != string.Empty) 142 {<div class="@flexGrowClass"> 143 @if (Path.GetExtension(imagePath).ToLower() == ".svg") 144 { 145 <div class="icon-auto @iconColor @iconOpacity" style="height: @(iconSize)px; width: @(iconSize)px;">@ReadFile(imagePath)</div> 146 } 147 else 148 { 149 <img loading="lazy" src="@imagePath" alt="@imgAltText" title="@Model.Item.GetString("Title")" style="height: @(iconSize)px; width: @(iconSize)px;"> 150 } 151 </div> 152 } 153 </div> 154 break; 155 } 156 157 @if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 158 { 159 @:</a> 160 } 161 </div> 162
Error executing template "Designs/Swift/Paragraph/Swift_Feature.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_aaebe9563ef2480eaf3c7369e15ee87f.Execute() in D:\dynamicweb.net\Solutions\composeit\FruHansensKaelder\Files\Templates\Designs\Swift\Paragraph\Swift_Feature.cshtml:line 20
   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 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 2 @using System.IO 3 4 @{ 5 string layout = Model.Item.GetRawValueString("Layout", "icon-top"); 6 string contentPadding = Model.Item.GetRawValueString("ContentPadding", string.Empty); 7 contentPadding = contentPadding == "none" ? "" : contentPadding; 8 contentPadding = contentPadding == "small" ? "p-3 p-md-3" : contentPadding; 9 contentPadding = contentPadding == "large" ? "p-5 p-md-5" : contentPadding; 10 string theme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("Theme")) ? " theme " + Model.Item.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : string.Empty; 11 12 string target = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && Model.Item.GetString("Link").Contains("http") ? "target=\"_blank\"" : string.Empty; 13 string rel = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && Model.Item.GetString("Link").Contains("http") ? "rel=\"noopener\"" : string.Empty; 14 string alignment = (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) && !string.IsNullOrEmpty(Model.Item.GetString("Text")) ? "align-items-stretch" : "align-items-center"; 15 16 string iconColor = Model.Item.GetString("iconColor", "text-inherit"); 17 string iconOpacity = Model.Item.GetString("IconOpacity", "opacity-100"); 18 19 string iconSize = Model.Item.GetRawValueString("IconSize", "2"); 20 string imageSrc = !string.IsNullOrEmpty(Model.Item.GetString("Image")) ? Model.Item.GetFile("Image").Path : string.Empty; 21 string flexGrowClass = string.Empty; 22 23 switch (layout) 24 { 25 case "icon-left": 26 case "icon-right": 27 flexGrowClass = "flex-grow-0"; 28 break; 29 } 30 31 string imagePath = imageSrc != string.Empty ? imageSrc : Model.Item.GetRawValueString("Icon", string.Empty); 32 imagePath = Path.GetExtension(imagePath).ToLower() != ".svg" ? "/Admin/Public/GetImage.ashx?image=" + imagePath + "&height=" + iconSize + "&width=" + iconSize + "&Crop=0&format=webp" : imagePath; 33 string imgAltText = Model.Item.GetRawValueString("FeatureAltText", string.Empty); 34 35 string titleFontSize = Model.Item.GetRawValueString("TitleFontSize", "h4"); 36 string titleColor = Model.Item.GetString("TitleColor", "text-inherit"); 37 string titleOpacity = Model.Item.GetString("TitleOpacity", "opacity-100"); 38 string headingLevel = Model.Item.GetString("HeadingLevel", "h2"); 39 string headingLevelStart = $"<{headingLevel} class=\"{titleFontSize} {titleColor} {titleOpacity} m-0\">"; 40 string headingLevelStop = $"</{headingLevel}>"; 41 42 string textColor = Model.Item.GetString("TextColor", "text-inherit"); 43 string textOpacity = Model.Item.GetString("TextOpacity", "opacity-100"); 44 } 45 46 <div class="h-100 @(contentPadding)@(theme) item_@Model.Item.SystemName.ToLower()"> 47 <div id="@Model.ID" class="user-select-none" style="scroll-margin-top:var(--header-height,150px)"></div> 48 @if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 49 { 50 @:<a href="@Model.Item.GetString("Link")" class="text-decoration-none d-block h-100" @target @rel> 51 } 52 53 @switch (layout) 54 { 55 case "icon-top": 56 <div class="d-flex flex-column gap-3 text-center mb-0-last-child"> 57 @if (!string.IsNullOrEmpty(Model.Item.GetString("Image")) || !imagePath.ToLower().Contains("none") && imagePath != string.Empty) 58 {<div class="@flexGrowClass"> 59 @if (Path.GetExtension(imagePath).ToLower() == ".svg") 60 { 61 <div class="icon-auto @iconColor @iconOpacity" style="height: @(iconSize)px; width: @(iconSize)px;">@ReadFile(imagePath)</div> 62 } 63 else 64 { 65 <img loading="lazy" src="@imagePath" alt="@imgAltText" title="@Model.Item.GetString("Title")" style="height: @(iconSize)px; width: @(iconSize)px;"> 66 } 67 </div> 68 } 69 70 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle") || !string.IsNullOrEmpty(Model.Item.GetString("Text"))) 71 { 72 <div class="mb-0-last-child"> 73 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) 74 { 75 @headingLevelStart 76 @Model.Item.GetString("Title") 77 @headingLevelStop 78 } 79 80 @if (!string.IsNullOrEmpty(Model.Item.GetString("Text"))) 81 { 82 <p class="@textColor @textOpacity m-0">@Model.Item.GetString("Text")</p> 83 } 84 </div> 85 } 86 </div> 87 break; 88 case "icon-left": 89 <div class="d-flex flex-row gap-3 h-100 text-start @alignment"> 90 @if (!string.IsNullOrEmpty(Model.Item.GetString("Image")) || !imagePath.ToLower().Contains("none") && imagePath != string.Empty) 91 {<div class="@flexGrowClass"> 92 @if (Path.GetExtension(imagePath).ToLower() == ".svg") 93 { 94 <div class="icon-auto @iconColor @iconOpacity" style="height: @(iconSize)px; width: @(iconSize)px;">@ReadFile(imagePath)</div> 95 } 96 else 97 { 98 <img loading="lazy" src="@imagePath" alt="@imgAltText" title="@Model.Item.GetString("Title")" style="height: @(iconSize)px; width: @(iconSize)px;"> 99 } 100 </div> 101 } 102 103 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle") || !string.IsNullOrEmpty(Model.Item.GetString("Text"))) 104 { 105 <div class="d-flex flex-column flex-grow-1"> 106 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) 107 { 108 @headingLevelStart 109 @Model.Item.GetString("Title") 110 @headingLevelStop 111 } 112 113 @if (!string.IsNullOrEmpty(Model.Item.GetString("Text"))) 114 { 115 <p class="@textColor @textOpacity m-0">@Model.Item.GetString("Text")</p> 116 } 117 </div> 118 } 119 120 </div> 121 break; 122 case "icon-right": 123 <div class="d-flex flex-row gap-3 h-100 text-end @alignment"> 124 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle") || !string.IsNullOrEmpty(Model.Item.GetString("Text"))) 125 { 126 <div class="d-flex flex-column flex-grow-1"> 127 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) 128 { 129 @headingLevelStart 130 @Model.Item.GetString("Title") 131 @headingLevelStop 132 } 133 134 @if (!string.IsNullOrEmpty(Model.Item.GetString("Text"))) 135 { 136 <p class="@textColor @textOpacity m-0">@Model.Item.GetString("Text")</p> 137 } 138 </div> 139 } 140 141 @if (!string.IsNullOrEmpty(Model.Item.GetString("Image")) || !imagePath.ToLower().Contains("none") && imagePath != string.Empty) 142 {<div class="@flexGrowClass"> 143 @if (Path.GetExtension(imagePath).ToLower() == ".svg") 144 { 145 <div class="icon-auto @iconColor @iconOpacity" style="height: @(iconSize)px; width: @(iconSize)px;">@ReadFile(imagePath)</div> 146 } 147 else 148 { 149 <img loading="lazy" src="@imagePath" alt="@imgAltText" title="@Model.Item.GetString("Title")" style="height: @(iconSize)px; width: @(iconSize)px;"> 150 } 151 </div> 152 } 153 </div> 154 break; 155 } 156 157 @if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 158 { 159 @:</a> 160 } 161 </div> 162
Error executing template "Designs/Swift/Paragraph/Swift_Feature.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_aaebe9563ef2480eaf3c7369e15ee87f.Execute() in D:\dynamicweb.net\Solutions\composeit\FruHansensKaelder\Files\Templates\Designs\Swift\Paragraph\Swift_Feature.cshtml:line 20
   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 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 2 @using System.IO 3 4 @{ 5 string layout = Model.Item.GetRawValueString("Layout", "icon-top"); 6 string contentPadding = Model.Item.GetRawValueString("ContentPadding", string.Empty); 7 contentPadding = contentPadding == "none" ? "" : contentPadding; 8 contentPadding = contentPadding == "small" ? "p-3 p-md-3" : contentPadding; 9 contentPadding = contentPadding == "large" ? "p-5 p-md-5" : contentPadding; 10 string theme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("Theme")) ? " theme " + Model.Item.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : string.Empty; 11 12 string target = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && Model.Item.GetString("Link").Contains("http") ? "target=\"_blank\"" : string.Empty; 13 string rel = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && Model.Item.GetString("Link").Contains("http") ? "rel=\"noopener\"" : string.Empty; 14 string alignment = (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) && !string.IsNullOrEmpty(Model.Item.GetString("Text")) ? "align-items-stretch" : "align-items-center"; 15 16 string iconColor = Model.Item.GetString("iconColor", "text-inherit"); 17 string iconOpacity = Model.Item.GetString("IconOpacity", "opacity-100"); 18 19 string iconSize = Model.Item.GetRawValueString("IconSize", "2"); 20 string imageSrc = !string.IsNullOrEmpty(Model.Item.GetString("Image")) ? Model.Item.GetFile("Image").Path : string.Empty; 21 string flexGrowClass = string.Empty; 22 23 switch (layout) 24 { 25 case "icon-left": 26 case "icon-right": 27 flexGrowClass = "flex-grow-0"; 28 break; 29 } 30 31 string imagePath = imageSrc != string.Empty ? imageSrc : Model.Item.GetRawValueString("Icon", string.Empty); 32 imagePath = Path.GetExtension(imagePath).ToLower() != ".svg" ? "/Admin/Public/GetImage.ashx?image=" + imagePath + "&height=" + iconSize + "&width=" + iconSize + "&Crop=0&format=webp" : imagePath; 33 string imgAltText = Model.Item.GetRawValueString("FeatureAltText", string.Empty); 34 35 string titleFontSize = Model.Item.GetRawValueString("TitleFontSize", "h4"); 36 string titleColor = Model.Item.GetString("TitleColor", "text-inherit"); 37 string titleOpacity = Model.Item.GetString("TitleOpacity", "opacity-100"); 38 string headingLevel = Model.Item.GetString("HeadingLevel", "h2"); 39 string headingLevelStart = $"<{headingLevel} class=\"{titleFontSize} {titleColor} {titleOpacity} m-0\">"; 40 string headingLevelStop = $"</{headingLevel}>"; 41 42 string textColor = Model.Item.GetString("TextColor", "text-inherit"); 43 string textOpacity = Model.Item.GetString("TextOpacity", "opacity-100"); 44 } 45 46 <div class="h-100 @(contentPadding)@(theme) item_@Model.Item.SystemName.ToLower()"> 47 <div id="@Model.ID" class="user-select-none" style="scroll-margin-top:var(--header-height,150px)"></div> 48 @if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 49 { 50 @:<a href="@Model.Item.GetString("Link")" class="text-decoration-none d-block h-100" @target @rel> 51 } 52 53 @switch (layout) 54 { 55 case "icon-top": 56 <div class="d-flex flex-column gap-3 text-center mb-0-last-child"> 57 @if (!string.IsNullOrEmpty(Model.Item.GetString("Image")) || !imagePath.ToLower().Contains("none") && imagePath != string.Empty) 58 {<div class="@flexGrowClass"> 59 @if (Path.GetExtension(imagePath).ToLower() == ".svg") 60 { 61 <div class="icon-auto @iconColor @iconOpacity" style="height: @(iconSize)px; width: @(iconSize)px;">@ReadFile(imagePath)</div> 62 } 63 else 64 { 65 <img loading="lazy" src="@imagePath" alt="@imgAltText" title="@Model.Item.GetString("Title")" style="height: @(iconSize)px; width: @(iconSize)px;"> 66 } 67 </div> 68 } 69 70 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle") || !string.IsNullOrEmpty(Model.Item.GetString("Text"))) 71 { 72 <div class="mb-0-last-child"> 73 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) 74 { 75 @headingLevelStart 76 @Model.Item.GetString("Title") 77 @headingLevelStop 78 } 79 80 @if (!string.IsNullOrEmpty(Model.Item.GetString("Text"))) 81 { 82 <p class="@textColor @textOpacity m-0">@Model.Item.GetString("Text")</p> 83 } 84 </div> 85 } 86 </div> 87 break; 88 case "icon-left": 89 <div class="d-flex flex-row gap-3 h-100 text-start @alignment"> 90 @if (!string.IsNullOrEmpty(Model.Item.GetString("Image")) || !imagePath.ToLower().Contains("none") && imagePath != string.Empty) 91 {<div class="@flexGrowClass"> 92 @if (Path.GetExtension(imagePath).ToLower() == ".svg") 93 { 94 <div class="icon-auto @iconColor @iconOpacity" style="height: @(iconSize)px; width: @(iconSize)px;">@ReadFile(imagePath)</div> 95 } 96 else 97 { 98 <img loading="lazy" src="@imagePath" alt="@imgAltText" title="@Model.Item.GetString("Title")" style="height: @(iconSize)px; width: @(iconSize)px;"> 99 } 100 </div> 101 } 102 103 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle") || !string.IsNullOrEmpty(Model.Item.GetString("Text"))) 104 { 105 <div class="d-flex flex-column flex-grow-1"> 106 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) 107 { 108 @headingLevelStart 109 @Model.Item.GetString("Title") 110 @headingLevelStop 111 } 112 113 @if (!string.IsNullOrEmpty(Model.Item.GetString("Text"))) 114 { 115 <p class="@textColor @textOpacity m-0">@Model.Item.GetString("Text")</p> 116 } 117 </div> 118 } 119 120 </div> 121 break; 122 case "icon-right": 123 <div class="d-flex flex-row gap-3 h-100 text-end @alignment"> 124 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle") || !string.IsNullOrEmpty(Model.Item.GetString("Text"))) 125 { 126 <div class="d-flex flex-column flex-grow-1"> 127 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) 128 { 129 @headingLevelStart 130 @Model.Item.GetString("Title") 131 @headingLevelStop 132 } 133 134 @if (!string.IsNullOrEmpty(Model.Item.GetString("Text"))) 135 { 136 <p class="@textColor @textOpacity m-0">@Model.Item.GetString("Text")</p> 137 } 138 </div> 139 } 140 141 @if (!string.IsNullOrEmpty(Model.Item.GetString("Image")) || !imagePath.ToLower().Contains("none") && imagePath != string.Empty) 142 {<div class="@flexGrowClass"> 143 @if (Path.GetExtension(imagePath).ToLower() == ".svg") 144 { 145 <div class="icon-auto @iconColor @iconOpacity" style="height: @(iconSize)px; width: @(iconSize)px;">@ReadFile(imagePath)</div> 146 } 147 else 148 { 149 <img loading="lazy" src="@imagePath" alt="@imgAltText" title="@Model.Item.GetString("Title")" style="height: @(iconSize)px; width: @(iconSize)px;"> 150 } 151 </div> 152 } 153 </div> 154 break; 155 } 156 157 @if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 158 { 159 @:</a> 160 } 161 </div> 162
Error executing template "Designs/Swift/Paragraph/Swift_Feature.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_aaebe9563ef2480eaf3c7369e15ee87f.Execute() in D:\dynamicweb.net\Solutions\composeit\FruHansensKaelder\Files\Templates\Designs\Swift\Paragraph\Swift_Feature.cshtml:line 20
   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 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 2 @using System.IO 3 4 @{ 5 string layout = Model.Item.GetRawValueString("Layout", "icon-top"); 6 string contentPadding = Model.Item.GetRawValueString("ContentPadding", string.Empty); 7 contentPadding = contentPadding == "none" ? "" : contentPadding; 8 contentPadding = contentPadding == "small" ? "p-3 p-md-3" : contentPadding; 9 contentPadding = contentPadding == "large" ? "p-5 p-md-5" : contentPadding; 10 string theme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("Theme")) ? " theme " + Model.Item.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : string.Empty; 11 12 string target = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && Model.Item.GetString("Link").Contains("http") ? "target=\"_blank\"" : string.Empty; 13 string rel = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && Model.Item.GetString("Link").Contains("http") ? "rel=\"noopener\"" : string.Empty; 14 string alignment = (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) && !string.IsNullOrEmpty(Model.Item.GetString("Text")) ? "align-items-stretch" : "align-items-center"; 15 16 string iconColor = Model.Item.GetString("iconColor", "text-inherit"); 17 string iconOpacity = Model.Item.GetString("IconOpacity", "opacity-100"); 18 19 string iconSize = Model.Item.GetRawValueString("IconSize", "2"); 20 string imageSrc = !string.IsNullOrEmpty(Model.Item.GetString("Image")) ? Model.Item.GetFile("Image").Path : string.Empty; 21 string flexGrowClass = string.Empty; 22 23 switch (layout) 24 { 25 case "icon-left": 26 case "icon-right": 27 flexGrowClass = "flex-grow-0"; 28 break; 29 } 30 31 string imagePath = imageSrc != string.Empty ? imageSrc : Model.Item.GetRawValueString("Icon", string.Empty); 32 imagePath = Path.GetExtension(imagePath).ToLower() != ".svg" ? "/Admin/Public/GetImage.ashx?image=" + imagePath + "&height=" + iconSize + "&width=" + iconSize + "&Crop=0&format=webp" : imagePath; 33 string imgAltText = Model.Item.GetRawValueString("FeatureAltText", string.Empty); 34 35 string titleFontSize = Model.Item.GetRawValueString("TitleFontSize", "h4"); 36 string titleColor = Model.Item.GetString("TitleColor", "text-inherit"); 37 string titleOpacity = Model.Item.GetString("TitleOpacity", "opacity-100"); 38 string headingLevel = Model.Item.GetString("HeadingLevel", "h2"); 39 string headingLevelStart = $"<{headingLevel} class=\"{titleFontSize} {titleColor} {titleOpacity} m-0\">"; 40 string headingLevelStop = $"</{headingLevel}>"; 41 42 string textColor = Model.Item.GetString("TextColor", "text-inherit"); 43 string textOpacity = Model.Item.GetString("TextOpacity", "opacity-100"); 44 } 45 46 <div class="h-100 @(contentPadding)@(theme) item_@Model.Item.SystemName.ToLower()"> 47 <div id="@Model.ID" class="user-select-none" style="scroll-margin-top:var(--header-height,150px)"></div> 48 @if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 49 { 50 @:<a href="@Model.Item.GetString("Link")" class="text-decoration-none d-block h-100" @target @rel> 51 } 52 53 @switch (layout) 54 { 55 case "icon-top": 56 <div class="d-flex flex-column gap-3 text-center mb-0-last-child"> 57 @if (!string.IsNullOrEmpty(Model.Item.GetString("Image")) || !imagePath.ToLower().Contains("none") && imagePath != string.Empty) 58 {<div class="@flexGrowClass"> 59 @if (Path.GetExtension(imagePath).ToLower() == ".svg") 60 { 61 <div class="icon-auto @iconColor @iconOpacity" style="height: @(iconSize)px; width: @(iconSize)px;">@ReadFile(imagePath)</div> 62 } 63 else 64 { 65 <img loading="lazy" src="@imagePath" alt="@imgAltText" title="@Model.Item.GetString("Title")" style="height: @(iconSize)px; width: @(iconSize)px;"> 66 } 67 </div> 68 } 69 70 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle") || !string.IsNullOrEmpty(Model.Item.GetString("Text"))) 71 { 72 <div class="mb-0-last-child"> 73 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) 74 { 75 @headingLevelStart 76 @Model.Item.GetString("Title") 77 @headingLevelStop 78 } 79 80 @if (!string.IsNullOrEmpty(Model.Item.GetString("Text"))) 81 { 82 <p class="@textColor @textOpacity m-0">@Model.Item.GetString("Text")</p> 83 } 84 </div> 85 } 86 </div> 87 break; 88 case "icon-left": 89 <div class="d-flex flex-row gap-3 h-100 text-start @alignment"> 90 @if (!string.IsNullOrEmpty(Model.Item.GetString("Image")) || !imagePath.ToLower().Contains("none") && imagePath != string.Empty) 91 {<div class="@flexGrowClass"> 92 @if (Path.GetExtension(imagePath).ToLower() == ".svg") 93 { 94 <div class="icon-auto @iconColor @iconOpacity" style="height: @(iconSize)px; width: @(iconSize)px;">@ReadFile(imagePath)</div> 95 } 96 else 97 { 98 <img loading="lazy" src="@imagePath" alt="@imgAltText" title="@Model.Item.GetString("Title")" style="height: @(iconSize)px; width: @(iconSize)px;"> 99 } 100 </div> 101 } 102 103 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle") || !string.IsNullOrEmpty(Model.Item.GetString("Text"))) 104 { 105 <div class="d-flex flex-column flex-grow-1"> 106 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) 107 { 108 @headingLevelStart 109 @Model.Item.GetString("Title") 110 @headingLevelStop 111 } 112 113 @if (!string.IsNullOrEmpty(Model.Item.GetString("Text"))) 114 { 115 <p class="@textColor @textOpacity m-0">@Model.Item.GetString("Text")</p> 116 } 117 </div> 118 } 119 120 </div> 121 break; 122 case "icon-right": 123 <div class="d-flex flex-row gap-3 h-100 text-end @alignment"> 124 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle") || !string.IsNullOrEmpty(Model.Item.GetString("Text"))) 125 { 126 <div class="d-flex flex-column flex-grow-1"> 127 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) 128 { 129 @headingLevelStart 130 @Model.Item.GetString("Title") 131 @headingLevelStop 132 } 133 134 @if (!string.IsNullOrEmpty(Model.Item.GetString("Text"))) 135 { 136 <p class="@textColor @textOpacity m-0">@Model.Item.GetString("Text")</p> 137 } 138 </div> 139 } 140 141 @if (!string.IsNullOrEmpty(Model.Item.GetString("Image")) || !imagePath.ToLower().Contains("none") && imagePath != string.Empty) 142 {<div class="@flexGrowClass"> 143 @if (Path.GetExtension(imagePath).ToLower() == ".svg") 144 { 145 <div class="icon-auto @iconColor @iconOpacity" style="height: @(iconSize)px; width: @(iconSize)px;">@ReadFile(imagePath)</div> 146 } 147 else 148 { 149 <img loading="lazy" src="@imagePath" alt="@imgAltText" title="@Model.Item.GetString("Title")" style="height: @(iconSize)px; width: @(iconSize)px;"> 150 } 151 </div> 152 } 153 </div> 154 break; 155 } 156 157 @if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 158 { 159 @:</a> 160 } 161 </div> 162
Error executing template "Designs/Swift/Paragraph/Swift_Feature.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_aaebe9563ef2480eaf3c7369e15ee87f.Execute() in D:\dynamicweb.net\Solutions\composeit\FruHansensKaelder\Files\Templates\Designs\Swift\Paragraph\Swift_Feature.cshtml:line 20
   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 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 2 @using System.IO 3 4 @{ 5 string layout = Model.Item.GetRawValueString("Layout", "icon-top"); 6 string contentPadding = Model.Item.GetRawValueString("ContentPadding", string.Empty); 7 contentPadding = contentPadding == "none" ? "" : contentPadding; 8 contentPadding = contentPadding == "small" ? "p-3 p-md-3" : contentPadding; 9 contentPadding = contentPadding == "large" ? "p-5 p-md-5" : contentPadding; 10 string theme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("Theme")) ? " theme " + Model.Item.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : string.Empty; 11 12 string target = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && Model.Item.GetString("Link").Contains("http") ? "target=\"_blank\"" : string.Empty; 13 string rel = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && Model.Item.GetString("Link").Contains("http") ? "rel=\"noopener\"" : string.Empty; 14 string alignment = (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) && !string.IsNullOrEmpty(Model.Item.GetString("Text")) ? "align-items-stretch" : "align-items-center"; 15 16 string iconColor = Model.Item.GetString("iconColor", "text-inherit"); 17 string iconOpacity = Model.Item.GetString("IconOpacity", "opacity-100"); 18 19 string iconSize = Model.Item.GetRawValueString("IconSize", "2"); 20 string imageSrc = !string.IsNullOrEmpty(Model.Item.GetString("Image")) ? Model.Item.GetFile("Image").Path : string.Empty; 21 string flexGrowClass = string.Empty; 22 23 switch (layout) 24 { 25 case "icon-left": 26 case "icon-right": 27 flexGrowClass = "flex-grow-0"; 28 break; 29 } 30 31 string imagePath = imageSrc != string.Empty ? imageSrc : Model.Item.GetRawValueString("Icon", string.Empty); 32 imagePath = Path.GetExtension(imagePath).ToLower() != ".svg" ? "/Admin/Public/GetImage.ashx?image=" + imagePath + "&height=" + iconSize + "&width=" + iconSize + "&Crop=0&format=webp" : imagePath; 33 string imgAltText = Model.Item.GetRawValueString("FeatureAltText", string.Empty); 34 35 string titleFontSize = Model.Item.GetRawValueString("TitleFontSize", "h4"); 36 string titleColor = Model.Item.GetString("TitleColor", "text-inherit"); 37 string titleOpacity = Model.Item.GetString("TitleOpacity", "opacity-100"); 38 string headingLevel = Model.Item.GetString("HeadingLevel", "h2"); 39 string headingLevelStart = $"<{headingLevel} class=\"{titleFontSize} {titleColor} {titleOpacity} m-0\">"; 40 string headingLevelStop = $"</{headingLevel}>"; 41 42 string textColor = Model.Item.GetString("TextColor", "text-inherit"); 43 string textOpacity = Model.Item.GetString("TextOpacity", "opacity-100"); 44 } 45 46 <div class="h-100 @(contentPadding)@(theme) item_@Model.Item.SystemName.ToLower()"> 47 <div id="@Model.ID" class="user-select-none" style="scroll-margin-top:var(--header-height,150px)"></div> 48 @if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 49 { 50 @:<a href="@Model.Item.GetString("Link")" class="text-decoration-none d-block h-100" @target @rel> 51 } 52 53 @switch (layout) 54 { 55 case "icon-top": 56 <div class="d-flex flex-column gap-3 text-center mb-0-last-child"> 57 @if (!string.IsNullOrEmpty(Model.Item.GetString("Image")) || !imagePath.ToLower().Contains("none") && imagePath != string.Empty) 58 {<div class="@flexGrowClass"> 59 @if (Path.GetExtension(imagePath).ToLower() == ".svg") 60 { 61 <div class="icon-auto @iconColor @iconOpacity" style="height: @(iconSize)px; width: @(iconSize)px;">@ReadFile(imagePath)</div> 62 } 63 else 64 { 65 <img loading="lazy" src="@imagePath" alt="@imgAltText" title="@Model.Item.GetString("Title")" style="height: @(iconSize)px; width: @(iconSize)px;"> 66 } 67 </div> 68 } 69 70 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle") || !string.IsNullOrEmpty(Model.Item.GetString("Text"))) 71 { 72 <div class="mb-0-last-child"> 73 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) 74 { 75 @headingLevelStart 76 @Model.Item.GetString("Title") 77 @headingLevelStop 78 } 79 80 @if (!string.IsNullOrEmpty(Model.Item.GetString("Text"))) 81 { 82 <p class="@textColor @textOpacity m-0">@Model.Item.GetString("Text")</p> 83 } 84 </div> 85 } 86 </div> 87 break; 88 case "icon-left": 89 <div class="d-flex flex-row gap-3 h-100 text-start @alignment"> 90 @if (!string.IsNullOrEmpty(Model.Item.GetString("Image")) || !imagePath.ToLower().Contains("none") && imagePath != string.Empty) 91 {<div class="@flexGrowClass"> 92 @if (Path.GetExtension(imagePath).ToLower() == ".svg") 93 { 94 <div class="icon-auto @iconColor @iconOpacity" style="height: @(iconSize)px; width: @(iconSize)px;">@ReadFile(imagePath)</div> 95 } 96 else 97 { 98 <img loading="lazy" src="@imagePath" alt="@imgAltText" title="@Model.Item.GetString("Title")" style="height: @(iconSize)px; width: @(iconSize)px;"> 99 } 100 </div> 101 } 102 103 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle") || !string.IsNullOrEmpty(Model.Item.GetString("Text"))) 104 { 105 <div class="d-flex flex-column flex-grow-1"> 106 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) 107 { 108 @headingLevelStart 109 @Model.Item.GetString("Title") 110 @headingLevelStop 111 } 112 113 @if (!string.IsNullOrEmpty(Model.Item.GetString("Text"))) 114 { 115 <p class="@textColor @textOpacity m-0">@Model.Item.GetString("Text")</p> 116 } 117 </div> 118 } 119 120 </div> 121 break; 122 case "icon-right": 123 <div class="d-flex flex-row gap-3 h-100 text-end @alignment"> 124 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle") || !string.IsNullOrEmpty(Model.Item.GetString("Text"))) 125 { 126 <div class="d-flex flex-column flex-grow-1"> 127 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) 128 { 129 @headingLevelStart 130 @Model.Item.GetString("Title") 131 @headingLevelStop 132 } 133 134 @if (!string.IsNullOrEmpty(Model.Item.GetString("Text"))) 135 { 136 <p class="@textColor @textOpacity m-0">@Model.Item.GetString("Text")</p> 137 } 138 </div> 139 } 140 141 @if (!string.IsNullOrEmpty(Model.Item.GetString("Image")) || !imagePath.ToLower().Contains("none") && imagePath != string.Empty) 142 {<div class="@flexGrowClass"> 143 @if (Path.GetExtension(imagePath).ToLower() == ".svg") 144 { 145 <div class="icon-auto @iconColor @iconOpacity" style="height: @(iconSize)px; width: @(iconSize)px;">@ReadFile(imagePath)</div> 146 } 147 else 148 { 149 <img loading="lazy" src="@imagePath" alt="@imgAltText" title="@Model.Item.GetString("Title")" style="height: @(iconSize)px; width: @(iconSize)px;"> 150 } 151 </div> 152 } 153 </div> 154 break; 155 } 156 157 @if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 158 { 159 @:</a> 160 } 161 </div> 162

Alt i alt er vi godt tilfredse! Vi har oparbejdet en rigtig god rutine og børnene opmuntrer hinanden til at smage og blive mere madmodige."

- Tine, Skoleleder på Nordals Skolen

Hvad nu hvis det fedeste ved en skolemadsordning ikke var at slippe for madpakken?

Vi har hørt den mange gange før: “Det fedeste må da være at slippe for at lave madpakke hver dag” - og ja, både og….. For nogen er det en lettelse at slippe!

Vi ved dog, at mange forældre elsker at være kreative med madpakkerne, men vi hører også fra forældre, at det kan være en udfordring at opfylde alle de ernæringsanbefalinger, der konstant dukker op - og det kan vi virkelig godt forstå!

Derfor kan man føle sig lidt modløs, og være tilbøjelig til at synes at det nye skolemadsforsøg er en virkelig god ide, så man kan slippe for madpakkeræset - og det er vi selvfølgelig kun glade for at kunne hjælpe med! Men det er langt fra den eneste grund til at vælge en frokostordning i skolen – faktisk handler det om meget mere end bekvemmelighed! Skolemad har mange fordele:

Error executing template "Designs/Swift/Paragraph/Swift_Feature.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_aaebe9563ef2480eaf3c7369e15ee87f.Execute() in D:\dynamicweb.net\Solutions\composeit\FruHansensKaelder\Files\Templates\Designs\Swift\Paragraph\Swift_Feature.cshtml:line 20
   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 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 2 @using System.IO 3 4 @{ 5 string layout = Model.Item.GetRawValueString("Layout", "icon-top"); 6 string contentPadding = Model.Item.GetRawValueString("ContentPadding", string.Empty); 7 contentPadding = contentPadding == "none" ? "" : contentPadding; 8 contentPadding = contentPadding == "small" ? "p-3 p-md-3" : contentPadding; 9 contentPadding = contentPadding == "large" ? "p-5 p-md-5" : contentPadding; 10 string theme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("Theme")) ? " theme " + Model.Item.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : string.Empty; 11 12 string target = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && Model.Item.GetString("Link").Contains("http") ? "target=\"_blank\"" : string.Empty; 13 string rel = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && Model.Item.GetString("Link").Contains("http") ? "rel=\"noopener\"" : string.Empty; 14 string alignment = (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) && !string.IsNullOrEmpty(Model.Item.GetString("Text")) ? "align-items-stretch" : "align-items-center"; 15 16 string iconColor = Model.Item.GetString("iconColor", "text-inherit"); 17 string iconOpacity = Model.Item.GetString("IconOpacity", "opacity-100"); 18 19 string iconSize = Model.Item.GetRawValueString("IconSize", "2"); 20 string imageSrc = !string.IsNullOrEmpty(Model.Item.GetString("Image")) ? Model.Item.GetFile("Image").Path : string.Empty; 21 string flexGrowClass = string.Empty; 22 23 switch (layout) 24 { 25 case "icon-left": 26 case "icon-right": 27 flexGrowClass = "flex-grow-0"; 28 break; 29 } 30 31 string imagePath = imageSrc != string.Empty ? imageSrc : Model.Item.GetRawValueString("Icon", string.Empty); 32 imagePath = Path.GetExtension(imagePath).ToLower() != ".svg" ? "/Admin/Public/GetImage.ashx?image=" + imagePath + "&height=" + iconSize + "&width=" + iconSize + "&Crop=0&format=webp" : imagePath; 33 string imgAltText = Model.Item.GetRawValueString("FeatureAltText", string.Empty); 34 35 string titleFontSize = Model.Item.GetRawValueString("TitleFontSize", "h4"); 36 string titleColor = Model.Item.GetString("TitleColor", "text-inherit"); 37 string titleOpacity = Model.Item.GetString("TitleOpacity", "opacity-100"); 38 string headingLevel = Model.Item.GetString("HeadingLevel", "h2"); 39 string headingLevelStart = $"<{headingLevel} class=\"{titleFontSize} {titleColor} {titleOpacity} m-0\">"; 40 string headingLevelStop = $"</{headingLevel}>"; 41 42 string textColor = Model.Item.GetString("TextColor", "text-inherit"); 43 string textOpacity = Model.Item.GetString("TextOpacity", "opacity-100"); 44 } 45 46 <div class="h-100 @(contentPadding)@(theme) item_@Model.Item.SystemName.ToLower()"> 47 <div id="@Model.ID" class="user-select-none" style="scroll-margin-top:var(--header-height,150px)"></div> 48 @if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 49 { 50 @:<a href="@Model.Item.GetString("Link")" class="text-decoration-none d-block h-100" @target @rel> 51 } 52 53 @switch (layout) 54 { 55 case "icon-top": 56 <div class="d-flex flex-column gap-3 text-center mb-0-last-child"> 57 @if (!string.IsNullOrEmpty(Model.Item.GetString("Image")) || !imagePath.ToLower().Contains("none") && imagePath != string.Empty) 58 {<div class="@flexGrowClass"> 59 @if (Path.GetExtension(imagePath).ToLower() == ".svg") 60 { 61 <div class="icon-auto @iconColor @iconOpacity" style="height: @(iconSize)px; width: @(iconSize)px;">@ReadFile(imagePath)</div> 62 } 63 else 64 { 65 <img loading="lazy" src="@imagePath" alt="@imgAltText" title="@Model.Item.GetString("Title")" style="height: @(iconSize)px; width: @(iconSize)px;"> 66 } 67 </div> 68 } 69 70 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle") || !string.IsNullOrEmpty(Model.Item.GetString("Text"))) 71 { 72 <div class="mb-0-last-child"> 73 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) 74 { 75 @headingLevelStart 76 @Model.Item.GetString("Title") 77 @headingLevelStop 78 } 79 80 @if (!string.IsNullOrEmpty(Model.Item.GetString("Text"))) 81 { 82 <p class="@textColor @textOpacity m-0">@Model.Item.GetString("Text")</p> 83 } 84 </div> 85 } 86 </div> 87 break; 88 case "icon-left": 89 <div class="d-flex flex-row gap-3 h-100 text-start @alignment"> 90 @if (!string.IsNullOrEmpty(Model.Item.GetString("Image")) || !imagePath.ToLower().Contains("none") && imagePath != string.Empty) 91 {<div class="@flexGrowClass"> 92 @if (Path.GetExtension(imagePath).ToLower() == ".svg") 93 { 94 <div class="icon-auto @iconColor @iconOpacity" style="height: @(iconSize)px; width: @(iconSize)px;">@ReadFile(imagePath)</div> 95 } 96 else 97 { 98 <img loading="lazy" src="@imagePath" alt="@imgAltText" title="@Model.Item.GetString("Title")" style="height: @(iconSize)px; width: @(iconSize)px;"> 99 } 100 </div> 101 } 102 103 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle") || !string.IsNullOrEmpty(Model.Item.GetString("Text"))) 104 { 105 <div class="d-flex flex-column flex-grow-1"> 106 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) 107 { 108 @headingLevelStart 109 @Model.Item.GetString("Title") 110 @headingLevelStop 111 } 112 113 @if (!string.IsNullOrEmpty(Model.Item.GetString("Text"))) 114 { 115 <p class="@textColor @textOpacity m-0">@Model.Item.GetString("Text")</p> 116 } 117 </div> 118 } 119 120 </div> 121 break; 122 case "icon-right": 123 <div class="d-flex flex-row gap-3 h-100 text-end @alignment"> 124 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle") || !string.IsNullOrEmpty(Model.Item.GetString("Text"))) 125 { 126 <div class="d-flex flex-column flex-grow-1"> 127 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) 128 { 129 @headingLevelStart 130 @Model.Item.GetString("Title") 131 @headingLevelStop 132 } 133 134 @if (!string.IsNullOrEmpty(Model.Item.GetString("Text"))) 135 { 136 <p class="@textColor @textOpacity m-0">@Model.Item.GetString("Text")</p> 137 } 138 </div> 139 } 140 141 @if (!string.IsNullOrEmpty(Model.Item.GetString("Image")) || !imagePath.ToLower().Contains("none") && imagePath != string.Empty) 142 {<div class="@flexGrowClass"> 143 @if (Path.GetExtension(imagePath).ToLower() == ".svg") 144 { 145 <div class="icon-auto @iconColor @iconOpacity" style="height: @(iconSize)px; width: @(iconSize)px;">@ReadFile(imagePath)</div> 146 } 147 else 148 { 149 <img loading="lazy" src="@imagePath" alt="@imgAltText" title="@Model.Item.GetString("Title")" style="height: @(iconSize)px; width: @(iconSize)px;"> 150 } 151 </div> 152 } 153 </div> 154 break; 155 } 156 157 @if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 158 { 159 @:</a> 160 } 161 </div> 162
Error executing template "Designs/Swift/Paragraph/Swift_Feature.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_aaebe9563ef2480eaf3c7369e15ee87f.Execute() in D:\dynamicweb.net\Solutions\composeit\FruHansensKaelder\Files\Templates\Designs\Swift\Paragraph\Swift_Feature.cshtml:line 20
   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 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 2 @using System.IO 3 4 @{ 5 string layout = Model.Item.GetRawValueString("Layout", "icon-top"); 6 string contentPadding = Model.Item.GetRawValueString("ContentPadding", string.Empty); 7 contentPadding = contentPadding == "none" ? "" : contentPadding; 8 contentPadding = contentPadding == "small" ? "p-3 p-md-3" : contentPadding; 9 contentPadding = contentPadding == "large" ? "p-5 p-md-5" : contentPadding; 10 string theme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("Theme")) ? " theme " + Model.Item.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : string.Empty; 11 12 string target = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && Model.Item.GetString("Link").Contains("http") ? "target=\"_blank\"" : string.Empty; 13 string rel = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && Model.Item.GetString("Link").Contains("http") ? "rel=\"noopener\"" : string.Empty; 14 string alignment = (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) && !string.IsNullOrEmpty(Model.Item.GetString("Text")) ? "align-items-stretch" : "align-items-center"; 15 16 string iconColor = Model.Item.GetString("iconColor", "text-inherit"); 17 string iconOpacity = Model.Item.GetString("IconOpacity", "opacity-100"); 18 19 string iconSize = Model.Item.GetRawValueString("IconSize", "2"); 20 string imageSrc = !string.IsNullOrEmpty(Model.Item.GetString("Image")) ? Model.Item.GetFile("Image").Path : string.Empty; 21 string flexGrowClass = string.Empty; 22 23 switch (layout) 24 { 25 case "icon-left": 26 case "icon-right": 27 flexGrowClass = "flex-grow-0"; 28 break; 29 } 30 31 string imagePath = imageSrc != string.Empty ? imageSrc : Model.Item.GetRawValueString("Icon", string.Empty); 32 imagePath = Path.GetExtension(imagePath).ToLower() != ".svg" ? "/Admin/Public/GetImage.ashx?image=" + imagePath + "&height=" + iconSize + "&width=" + iconSize + "&Crop=0&format=webp" : imagePath; 33 string imgAltText = Model.Item.GetRawValueString("FeatureAltText", string.Empty); 34 35 string titleFontSize = Model.Item.GetRawValueString("TitleFontSize", "h4"); 36 string titleColor = Model.Item.GetString("TitleColor", "text-inherit"); 37 string titleOpacity = Model.Item.GetString("TitleOpacity", "opacity-100"); 38 string headingLevel = Model.Item.GetString("HeadingLevel", "h2"); 39 string headingLevelStart = $"<{headingLevel} class=\"{titleFontSize} {titleColor} {titleOpacity} m-0\">"; 40 string headingLevelStop = $"</{headingLevel}>"; 41 42 string textColor = Model.Item.GetString("TextColor", "text-inherit"); 43 string textOpacity = Model.Item.GetString("TextOpacity", "opacity-100"); 44 } 45 46 <div class="h-100 @(contentPadding)@(theme) item_@Model.Item.SystemName.ToLower()"> 47 <div id="@Model.ID" class="user-select-none" style="scroll-margin-top:var(--header-height,150px)"></div> 48 @if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 49 { 50 @:<a href="@Model.Item.GetString("Link")" class="text-decoration-none d-block h-100" @target @rel> 51 } 52 53 @switch (layout) 54 { 55 case "icon-top": 56 <div class="d-flex flex-column gap-3 text-center mb-0-last-child"> 57 @if (!string.IsNullOrEmpty(Model.Item.GetString("Image")) || !imagePath.ToLower().Contains("none") && imagePath != string.Empty) 58 {<div class="@flexGrowClass"> 59 @if (Path.GetExtension(imagePath).ToLower() == ".svg") 60 { 61 <div class="icon-auto @iconColor @iconOpacity" style="height: @(iconSize)px; width: @(iconSize)px;">@ReadFile(imagePath)</div> 62 } 63 else 64 { 65 <img loading="lazy" src="@imagePath" alt="@imgAltText" title="@Model.Item.GetString("Title")" style="height: @(iconSize)px; width: @(iconSize)px;"> 66 } 67 </div> 68 } 69 70 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle") || !string.IsNullOrEmpty(Model.Item.GetString("Text"))) 71 { 72 <div class="mb-0-last-child"> 73 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) 74 { 75 @headingLevelStart 76 @Model.Item.GetString("Title") 77 @headingLevelStop 78 } 79 80 @if (!string.IsNullOrEmpty(Model.Item.GetString("Text"))) 81 { 82 <p class="@textColor @textOpacity m-0">@Model.Item.GetString("Text")</p> 83 } 84 </div> 85 } 86 </div> 87 break; 88 case "icon-left": 89 <div class="d-flex flex-row gap-3 h-100 text-start @alignment"> 90 @if (!string.IsNullOrEmpty(Model.Item.GetString("Image")) || !imagePath.ToLower().Contains("none") && imagePath != string.Empty) 91 {<div class="@flexGrowClass"> 92 @if (Path.GetExtension(imagePath).ToLower() == ".svg") 93 { 94 <div class="icon-auto @iconColor @iconOpacity" style="height: @(iconSize)px; width: @(iconSize)px;">@ReadFile(imagePath)</div> 95 } 96 else 97 { 98 <img loading="lazy" src="@imagePath" alt="@imgAltText" title="@Model.Item.GetString("Title")" style="height: @(iconSize)px; width: @(iconSize)px;"> 99 } 100 </div> 101 } 102 103 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle") || !string.IsNullOrEmpty(Model.Item.GetString("Text"))) 104 { 105 <div class="d-flex flex-column flex-grow-1"> 106 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) 107 { 108 @headingLevelStart 109 @Model.Item.GetString("Title") 110 @headingLevelStop 111 } 112 113 @if (!string.IsNullOrEmpty(Model.Item.GetString("Text"))) 114 { 115 <p class="@textColor @textOpacity m-0">@Model.Item.GetString("Text")</p> 116 } 117 </div> 118 } 119 120 </div> 121 break; 122 case "icon-right": 123 <div class="d-flex flex-row gap-3 h-100 text-end @alignment"> 124 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle") || !string.IsNullOrEmpty(Model.Item.GetString("Text"))) 125 { 126 <div class="d-flex flex-column flex-grow-1"> 127 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) 128 { 129 @headingLevelStart 130 @Model.Item.GetString("Title") 131 @headingLevelStop 132 } 133 134 @if (!string.IsNullOrEmpty(Model.Item.GetString("Text"))) 135 { 136 <p class="@textColor @textOpacity m-0">@Model.Item.GetString("Text")</p> 137 } 138 </div> 139 } 140 141 @if (!string.IsNullOrEmpty(Model.Item.GetString("Image")) || !imagePath.ToLower().Contains("none") && imagePath != string.Empty) 142 {<div class="@flexGrowClass"> 143 @if (Path.GetExtension(imagePath).ToLower() == ".svg") 144 { 145 <div class="icon-auto @iconColor @iconOpacity" style="height: @(iconSize)px; width: @(iconSize)px;">@ReadFile(imagePath)</div> 146 } 147 else 148 { 149 <img loading="lazy" src="@imagePath" alt="@imgAltText" title="@Model.Item.GetString("Title")" style="height: @(iconSize)px; width: @(iconSize)px;"> 150 } 151 </div> 152 } 153 </div> 154 break; 155 } 156 157 @if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 158 { 159 @:</a> 160 } 161 </div> 162
Error executing template "Designs/Swift/Paragraph/Swift_Feature.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_aaebe9563ef2480eaf3c7369e15ee87f.Execute() in D:\dynamicweb.net\Solutions\composeit\FruHansensKaelder\Files\Templates\Designs\Swift\Paragraph\Swift_Feature.cshtml:line 20
   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 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 2 @using System.IO 3 4 @{ 5 string layout = Model.Item.GetRawValueString("Layout", "icon-top"); 6 string contentPadding = Model.Item.GetRawValueString("ContentPadding", string.Empty); 7 contentPadding = contentPadding == "none" ? "" : contentPadding; 8 contentPadding = contentPadding == "small" ? "p-3 p-md-3" : contentPadding; 9 contentPadding = contentPadding == "large" ? "p-5 p-md-5" : contentPadding; 10 string theme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("Theme")) ? " theme " + Model.Item.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : string.Empty; 11 12 string target = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && Model.Item.GetString("Link").Contains("http") ? "target=\"_blank\"" : string.Empty; 13 string rel = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && Model.Item.GetString("Link").Contains("http") ? "rel=\"noopener\"" : string.Empty; 14 string alignment = (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) && !string.IsNullOrEmpty(Model.Item.GetString("Text")) ? "align-items-stretch" : "align-items-center"; 15 16 string iconColor = Model.Item.GetString("iconColor", "text-inherit"); 17 string iconOpacity = Model.Item.GetString("IconOpacity", "opacity-100"); 18 19 string iconSize = Model.Item.GetRawValueString("IconSize", "2"); 20 string imageSrc = !string.IsNullOrEmpty(Model.Item.GetString("Image")) ? Model.Item.GetFile("Image").Path : string.Empty; 21 string flexGrowClass = string.Empty; 22 23 switch (layout) 24 { 25 case "icon-left": 26 case "icon-right": 27 flexGrowClass = "flex-grow-0"; 28 break; 29 } 30 31 string imagePath = imageSrc != string.Empty ? imageSrc : Model.Item.GetRawValueString("Icon", string.Empty); 32 imagePath = Path.GetExtension(imagePath).ToLower() != ".svg" ? "/Admin/Public/GetImage.ashx?image=" + imagePath + "&height=" + iconSize + "&width=" + iconSize + "&Crop=0&format=webp" : imagePath; 33 string imgAltText = Model.Item.GetRawValueString("FeatureAltText", string.Empty); 34 35 string titleFontSize = Model.Item.GetRawValueString("TitleFontSize", "h4"); 36 string titleColor = Model.Item.GetString("TitleColor", "text-inherit"); 37 string titleOpacity = Model.Item.GetString("TitleOpacity", "opacity-100"); 38 string headingLevel = Model.Item.GetString("HeadingLevel", "h2"); 39 string headingLevelStart = $"<{headingLevel} class=\"{titleFontSize} {titleColor} {titleOpacity} m-0\">"; 40 string headingLevelStop = $"</{headingLevel}>"; 41 42 string textColor = Model.Item.GetString("TextColor", "text-inherit"); 43 string textOpacity = Model.Item.GetString("TextOpacity", "opacity-100"); 44 } 45 46 <div class="h-100 @(contentPadding)@(theme) item_@Model.Item.SystemName.ToLower()"> 47 <div id="@Model.ID" class="user-select-none" style="scroll-margin-top:var(--header-height,150px)"></div> 48 @if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 49 { 50 @:<a href="@Model.Item.GetString("Link")" class="text-decoration-none d-block h-100" @target @rel> 51 } 52 53 @switch (layout) 54 { 55 case "icon-top": 56 <div class="d-flex flex-column gap-3 text-center mb-0-last-child"> 57 @if (!string.IsNullOrEmpty(Model.Item.GetString("Image")) || !imagePath.ToLower().Contains("none") && imagePath != string.Empty) 58 {<div class="@flexGrowClass"> 59 @if (Path.GetExtension(imagePath).ToLower() == ".svg") 60 { 61 <div class="icon-auto @iconColor @iconOpacity" style="height: @(iconSize)px; width: @(iconSize)px;">@ReadFile(imagePath)</div> 62 } 63 else 64 { 65 <img loading="lazy" src="@imagePath" alt="@imgAltText" title="@Model.Item.GetString("Title")" style="height: @(iconSize)px; width: @(iconSize)px;"> 66 } 67 </div> 68 } 69 70 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle") || !string.IsNullOrEmpty(Model.Item.GetString("Text"))) 71 { 72 <div class="mb-0-last-child"> 73 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) 74 { 75 @headingLevelStart 76 @Model.Item.GetString("Title") 77 @headingLevelStop 78 } 79 80 @if (!string.IsNullOrEmpty(Model.Item.GetString("Text"))) 81 { 82 <p class="@textColor @textOpacity m-0">@Model.Item.GetString("Text")</p> 83 } 84 </div> 85 } 86 </div> 87 break; 88 case "icon-left": 89 <div class="d-flex flex-row gap-3 h-100 text-start @alignment"> 90 @if (!string.IsNullOrEmpty(Model.Item.GetString("Image")) || !imagePath.ToLower().Contains("none") && imagePath != string.Empty) 91 {<div class="@flexGrowClass"> 92 @if (Path.GetExtension(imagePath).ToLower() == ".svg") 93 { 94 <div class="icon-auto @iconColor @iconOpacity" style="height: @(iconSize)px; width: @(iconSize)px;">@ReadFile(imagePath)</div> 95 } 96 else 97 { 98 <img loading="lazy" src="@imagePath" alt="@imgAltText" title="@Model.Item.GetString("Title")" style="height: @(iconSize)px; width: @(iconSize)px;"> 99 } 100 </div> 101 } 102 103 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle") || !string.IsNullOrEmpty(Model.Item.GetString("Text"))) 104 { 105 <div class="d-flex flex-column flex-grow-1"> 106 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) 107 { 108 @headingLevelStart 109 @Model.Item.GetString("Title") 110 @headingLevelStop 111 } 112 113 @if (!string.IsNullOrEmpty(Model.Item.GetString("Text"))) 114 { 115 <p class="@textColor @textOpacity m-0">@Model.Item.GetString("Text")</p> 116 } 117 </div> 118 } 119 120 </div> 121 break; 122 case "icon-right": 123 <div class="d-flex flex-row gap-3 h-100 text-end @alignment"> 124 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle") || !string.IsNullOrEmpty(Model.Item.GetString("Text"))) 125 { 126 <div class="d-flex flex-column flex-grow-1"> 127 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) 128 { 129 @headingLevelStart 130 @Model.Item.GetString("Title") 131 @headingLevelStop 132 } 133 134 @if (!string.IsNullOrEmpty(Model.Item.GetString("Text"))) 135 { 136 <p class="@textColor @textOpacity m-0">@Model.Item.GetString("Text")</p> 137 } 138 </div> 139 } 140 141 @if (!string.IsNullOrEmpty(Model.Item.GetString("Image")) || !imagePath.ToLower().Contains("none") && imagePath != string.Empty) 142 {<div class="@flexGrowClass"> 143 @if (Path.GetExtension(imagePath).ToLower() == ".svg") 144 { 145 <div class="icon-auto @iconColor @iconOpacity" style="height: @(iconSize)px; width: @(iconSize)px;">@ReadFile(imagePath)</div> 146 } 147 else 148 { 149 <img loading="lazy" src="@imagePath" alt="@imgAltText" title="@Model.Item.GetString("Title")" style="height: @(iconSize)px; width: @(iconSize)px;"> 150 } 151 </div> 152 } 153 </div> 154 break; 155 } 156 157 @if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 158 { 159 @:</a> 160 } 161 </div> 162

Hvordan kan en skoledag med mad fra Fru Hansens Kælder se ud?

På nogle skoler lander der hver dag en stak sandwiches udefra – pakket og klar til dem, der har bestilt. Andre steder strømmer elever til skoleboden i pausen, hvor de kan købe noget at spise, inden klokken ringer ind. Og så er der dem, der sætter sig med deres egen madpakke, pakket hjemmefra i morgentimerne.

Men hverdagen kan også se noget anderledes ud. Det kan også være en frokostpause, hvor alle sætter sig til bords samtidig og hvor ingen skal finde penge frem til skoleboden eller håbe, at madpakken stadig er frisk efter timer i tasken. I stedet dufter der af varm mad, når dagens ret bæres ind. Skåle sendes rundt, og alle kan tage for sig. Måske er det en gammel kending, måske en ny smag, der kræver lidt mod – men heldigvis sidder man ikke alene med oplevelsen. Man ser sidemanden smage, griner lidt af den sjove reaktion og bliver måske selv nysgerrig nok til at tage en bid.

Frokost handler nemlig om mere end at blive mæt. Det er en pause, hvor man samles, snakker og deler oplevelser – også dem, der ligger på tallerkenen. Når vi spiser sammen, lærer vi sammen. Og så smager maden altså bare bedre i godt selskab. 

Skolens rammer definerer spisesituationen

Vi ved, at skolemad ikke bare handler om, hvad der ligger på tallerkenen. Det handler også om rammer, vaner, logistik og alt det midt imellem. Derfor er det også vildt spændende at være en del af den forsøgsordning som regeringen har fremsat, hvor vi sammen med nogle modige skoler skal finde ud af, hvordan det kan lykkes i praksis – både nu og på lang sigt. 

Vi ved, at spisesituationen ser forskellig ud fra skole til skole. Nogle har kantine, andre spiser i klasselokaler eller fællesområder. Der findes ikke én model, der passer til alle, og derfor har vi ingen færdige svar på forhånd. I stedet starter vi altid med at lære jeres skole, jeres ønsker og jeres muligheder at kende. Først dér kan vi finde den bedste løsning, der både understøtter et godt måltidsfællesskab og fungerer i praksis – og med forsøgsordningens muligheder, er det nu at vi sammen kan skabe noget, der virkelig gør en forskel.

 

Skolemad i undervisningen

Kan maden bruges som afsæt i undervisningen?

Matematik

I matematik giver det mening at arbejde med fx omregning, måleenheder og vægt.

Naturfag

Naturfag åbner op for emner som fødevarekæder, næringsstoffer og kroppens processer, fx fordøjelsen. Man kan også tage fat på emner som økologi, bæredygtighed og lokal produktion.

Dansk

I dansk kan eleverne arbejde med at skrive og forstå opskrifter eller bruge sproget til at lave sproglige beskrivelser.