OUR VISION
DLF offers industry leading, proprietary seed solutions that connect science, innovation and application in support of efficient, sustainable cultivation of our planet
Our global values
Our global values were developed in 2021 with the involvement of all leaders and employees in DLF globally. They provide a common foundation for DLF, which has been and continues to be a journey of growth and globalization.
The values say:
- What is important to us as a business and as an organization.
- What we can expect from each other
- What others can expect from us
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_60b964716f74465eb821273758fd8922.<RenderIconAndImage>b__0_0(TextWriter __razor_helper_writer) in E:\Solutions\dlf.test002.webtester.dk\Files\Templates\Designs\Swift\Paragraph\Swift_Feature.cshtml:line 103 at CompiledRazorTemplates.Dynamic.RazorEngine_60b964716f74465eb821273758fd8922.Execute() in E:\Solutions\dlf.test002.webtester.dk\Files\Templates\Designs\Swift\Paragraph\Swift_Feature.cshtml:line 24 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", ""); 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() : ""; 11 } 12 13 <div class="h-100 @(contentPadding)@(theme) item_@Model.Item.SystemName.ToLower()"> 14 @switch (layout) 15 { 16 case "icon-top": 17 if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 18 { 19 @:<a href="@Model.Item.GetString("Link")" class="text-decoration-none d-block h-100"> 20 } 21 22 <div class="d-flex flex-column gap-3 text-center mb-0-last-child"> 23 <div> 24 @RenderIconAndImage() 25 </div> 26 27 @if ( 28 !string.IsNullOrEmpty(Model.Item.GetString("Title")) && 29 !Model.Item.GetBoolean("HideTitle") || 30 !string.IsNullOrEmpty(Model.Item.GetString("Text")) 31 ) 32 { 33 <div class="mb-0-last-child"> 34 @RenderTitle() 35 @RenderBody() 36 </div> 37 } 38 39 </div> 40 41 if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 42 { 43 @:</a> 44 } 45 break; 46 case "icon-left": 47 if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 48 { 49 @:<a href="@Model.Item.GetString("Link")" class="text-decoration-none d-block h-100"> 50 } 51 52 <div class="d-flex flex-row align-items-stretch gap-3 h-100 text-start"> 53 <div class="flex-grow-0"> 54 @RenderIconAndImage() 55 </div> 56 57 @if ( 58 !string.IsNullOrEmpty(Model.Item.GetString("Title")) && 59 !Model.Item.GetBoolean("HideTitle") || 60 !string.IsNullOrEmpty(Model.Item.GetString("Text")) 61 ) 62 { 63 <div class="d-flex flex-column flex-grow-1 gap-3"> 64 @RenderTitle() 65 @RenderBody() 66 </div> 67 } 68 69 </div> 70 71 if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 72 { 73 @:</a> 74 } 75 break; 76 case "icon-right": 77 if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 78 { 79 @:<a href="@Model.Item.GetString("Link")" class="text-decoration-none d-block h-100"> 80 } 81 82 <div class="d-flex flex-row align-items-stretch gap-3 h-100 text-end"> 83 <div class="d-flex flex-column flex-grow-1 gap-3"> 84 @RenderTitle() 85 @RenderBody() 86 </div> 87 88 <div class="flex-grow-0"> 89 @RenderIconAndImage() 90 </div> 91 </div> 92 if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 93 { 94 @:</a> 95 } 96 break; 97 } 98 </div> 99 100 @helper RenderIconAndImage() 101 { 102 string iconSize = Model.Item.GetRawValueString("IconSize", "2"); 103 string imageSrc = !string.IsNullOrEmpty(Model.Item.GetString("Image")) ? Model.Item.GetFile("Image").Path : ""; 104 105 if (!string.IsNullOrEmpty(Model.Item.GetString("Image"))) 106 { 107 @RenderIcon(imageSrc, iconSize) 108 } 109 else 110 { 111 string imagePath = Model.Item.GetRawValueString("Icon", ""); 112 113 if (!imagePath.ToLower().Contains("none") && imagePath != "") 114 { 115 @RenderIcon(imagePath, iconSize) 116 } 117 } 118 } 119 120 @helper RenderIcon(string imagePath, string iconSize) 121 { 122 if (Path.GetExtension(imagePath).ToLower() == ".svg") 123 { 124 <div class="icon-auto" style="height: @(iconSize)px; width: @(iconSize)px;"> 125 @ReadFile(imagePath) 126 </div> 127 } 128 else 129 { 130 imagePath = "/Admin/Public/GetImage.ashx?image=" + imagePath + "&height=" + iconSize + "&width=" + iconSize + "&Crop=0&Format=WebP&Quality=100"; 131 string imgAltText = Model.Item.GetRawValueString("FeatureAltText", string.Empty); 132 133 <img loading="lazy" src="@imagePath" alt="@imgAltText" title="@Model.Item.GetString("Title")" style="height: @(iconSize)px; width: @(iconSize)px;"> 134 } 135 } 136 137 @helper RenderTitle() 138 { 139 string titleFontSize = Model.Item.GetRawValueString("TitleFontSize", "h4"); 140 string headingLevel = Model.Item.GetString("HeadingLevel", "h2"); 141 string headingLevelStart = $"<{headingLevel} class=\"{titleFontSize} m-0\">"; 142 string headingLevelStop = $"</{headingLevel}>"; 143 144 if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) 145 { 146 @headingLevelStart 147 @Model.Item.GetString("Title") 148 @headingLevelStop 149 } 150 } 151 152 @helper RenderBody() 153 { 154 if (!string.IsNullOrEmpty(Model.Item.GetString("Text"))) 155 { 156 <p class="m-0">@Model.Item.GetString("Text")</p> 157 } 158 } 159
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_60b964716f74465eb821273758fd8922.<RenderIconAndImage>b__0_0(TextWriter __razor_helper_writer) in E:\Solutions\dlf.test002.webtester.dk\Files\Templates\Designs\Swift\Paragraph\Swift_Feature.cshtml:line 103 at CompiledRazorTemplates.Dynamic.RazorEngine_60b964716f74465eb821273758fd8922.Execute() in E:\Solutions\dlf.test002.webtester.dk\Files\Templates\Designs\Swift\Paragraph\Swift_Feature.cshtml:line 24 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", ""); 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() : ""; 11 } 12 13 <div class="h-100 @(contentPadding)@(theme) item_@Model.Item.SystemName.ToLower()"> 14 @switch (layout) 15 { 16 case "icon-top": 17 if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 18 { 19 @:<a href="@Model.Item.GetString("Link")" class="text-decoration-none d-block h-100"> 20 } 21 22 <div class="d-flex flex-column gap-3 text-center mb-0-last-child"> 23 <div> 24 @RenderIconAndImage() 25 </div> 26 27 @if ( 28 !string.IsNullOrEmpty(Model.Item.GetString("Title")) && 29 !Model.Item.GetBoolean("HideTitle") || 30 !string.IsNullOrEmpty(Model.Item.GetString("Text")) 31 ) 32 { 33 <div class="mb-0-last-child"> 34 @RenderTitle() 35 @RenderBody() 36 </div> 37 } 38 39 </div> 40 41 if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 42 { 43 @:</a> 44 } 45 break; 46 case "icon-left": 47 if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 48 { 49 @:<a href="@Model.Item.GetString("Link")" class="text-decoration-none d-block h-100"> 50 } 51 52 <div class="d-flex flex-row align-items-stretch gap-3 h-100 text-start"> 53 <div class="flex-grow-0"> 54 @RenderIconAndImage() 55 </div> 56 57 @if ( 58 !string.IsNullOrEmpty(Model.Item.GetString("Title")) && 59 !Model.Item.GetBoolean("HideTitle") || 60 !string.IsNullOrEmpty(Model.Item.GetString("Text")) 61 ) 62 { 63 <div class="d-flex flex-column flex-grow-1 gap-3"> 64 @RenderTitle() 65 @RenderBody() 66 </div> 67 } 68 69 </div> 70 71 if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 72 { 73 @:</a> 74 } 75 break; 76 case "icon-right": 77 if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 78 { 79 @:<a href="@Model.Item.GetString("Link")" class="text-decoration-none d-block h-100"> 80 } 81 82 <div class="d-flex flex-row align-items-stretch gap-3 h-100 text-end"> 83 <div class="d-flex flex-column flex-grow-1 gap-3"> 84 @RenderTitle() 85 @RenderBody() 86 </div> 87 88 <div class="flex-grow-0"> 89 @RenderIconAndImage() 90 </div> 91 </div> 92 if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 93 { 94 @:</a> 95 } 96 break; 97 } 98 </div> 99 100 @helper RenderIconAndImage() 101 { 102 string iconSize = Model.Item.GetRawValueString("IconSize", "2"); 103 string imageSrc = !string.IsNullOrEmpty(Model.Item.GetString("Image")) ? Model.Item.GetFile("Image").Path : ""; 104 105 if (!string.IsNullOrEmpty(Model.Item.GetString("Image"))) 106 { 107 @RenderIcon(imageSrc, iconSize) 108 } 109 else 110 { 111 string imagePath = Model.Item.GetRawValueString("Icon", ""); 112 113 if (!imagePath.ToLower().Contains("none") && imagePath != "") 114 { 115 @RenderIcon(imagePath, iconSize) 116 } 117 } 118 } 119 120 @helper RenderIcon(string imagePath, string iconSize) 121 { 122 if (Path.GetExtension(imagePath).ToLower() == ".svg") 123 { 124 <div class="icon-auto" style="height: @(iconSize)px; width: @(iconSize)px;"> 125 @ReadFile(imagePath) 126 </div> 127 } 128 else 129 { 130 imagePath = "/Admin/Public/GetImage.ashx?image=" + imagePath + "&height=" + iconSize + "&width=" + iconSize + "&Crop=0&Format=WebP&Quality=100"; 131 string imgAltText = Model.Item.GetRawValueString("FeatureAltText", string.Empty); 132 133 <img loading="lazy" src="@imagePath" alt="@imgAltText" title="@Model.Item.GetString("Title")" style="height: @(iconSize)px; width: @(iconSize)px;"> 134 } 135 } 136 137 @helper RenderTitle() 138 { 139 string titleFontSize = Model.Item.GetRawValueString("TitleFontSize", "h4"); 140 string headingLevel = Model.Item.GetString("HeadingLevel", "h2"); 141 string headingLevelStart = $"<{headingLevel} class=\"{titleFontSize} m-0\">"; 142 string headingLevelStop = $"</{headingLevel}>"; 143 144 if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) 145 { 146 @headingLevelStart 147 @Model.Item.GetString("Title") 148 @headingLevelStop 149 } 150 } 151 152 @helper RenderBody() 153 { 154 if (!string.IsNullOrEmpty(Model.Item.GetString("Text"))) 155 { 156 <p class="m-0">@Model.Item.GetString("Text")</p> 157 } 158 } 159
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_60b964716f74465eb821273758fd8922.<RenderIconAndImage>b__0_0(TextWriter __razor_helper_writer) in E:\Solutions\dlf.test002.webtester.dk\Files\Templates\Designs\Swift\Paragraph\Swift_Feature.cshtml:line 103 at CompiledRazorTemplates.Dynamic.RazorEngine_60b964716f74465eb821273758fd8922.Execute() in E:\Solutions\dlf.test002.webtester.dk\Files\Templates\Designs\Swift\Paragraph\Swift_Feature.cshtml:line 24 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", ""); 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() : ""; 11 } 12 13 <div class="h-100 @(contentPadding)@(theme) item_@Model.Item.SystemName.ToLower()"> 14 @switch (layout) 15 { 16 case "icon-top": 17 if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 18 { 19 @:<a href="@Model.Item.GetString("Link")" class="text-decoration-none d-block h-100"> 20 } 21 22 <div class="d-flex flex-column gap-3 text-center mb-0-last-child"> 23 <div> 24 @RenderIconAndImage() 25 </div> 26 27 @if ( 28 !string.IsNullOrEmpty(Model.Item.GetString("Title")) && 29 !Model.Item.GetBoolean("HideTitle") || 30 !string.IsNullOrEmpty(Model.Item.GetString("Text")) 31 ) 32 { 33 <div class="mb-0-last-child"> 34 @RenderTitle() 35 @RenderBody() 36 </div> 37 } 38 39 </div> 40 41 if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 42 { 43 @:</a> 44 } 45 break; 46 case "icon-left": 47 if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 48 { 49 @:<a href="@Model.Item.GetString("Link")" class="text-decoration-none d-block h-100"> 50 } 51 52 <div class="d-flex flex-row align-items-stretch gap-3 h-100 text-start"> 53 <div class="flex-grow-0"> 54 @RenderIconAndImage() 55 </div> 56 57 @if ( 58 !string.IsNullOrEmpty(Model.Item.GetString("Title")) && 59 !Model.Item.GetBoolean("HideTitle") || 60 !string.IsNullOrEmpty(Model.Item.GetString("Text")) 61 ) 62 { 63 <div class="d-flex flex-column flex-grow-1 gap-3"> 64 @RenderTitle() 65 @RenderBody() 66 </div> 67 } 68 69 </div> 70 71 if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 72 { 73 @:</a> 74 } 75 break; 76 case "icon-right": 77 if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 78 { 79 @:<a href="@Model.Item.GetString("Link")" class="text-decoration-none d-block h-100"> 80 } 81 82 <div class="d-flex flex-row align-items-stretch gap-3 h-100 text-end"> 83 <div class="d-flex flex-column flex-grow-1 gap-3"> 84 @RenderTitle() 85 @RenderBody() 86 </div> 87 88 <div class="flex-grow-0"> 89 @RenderIconAndImage() 90 </div> 91 </div> 92 if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 93 { 94 @:</a> 95 } 96 break; 97 } 98 </div> 99 100 @helper RenderIconAndImage() 101 { 102 string iconSize = Model.Item.GetRawValueString("IconSize", "2"); 103 string imageSrc = !string.IsNullOrEmpty(Model.Item.GetString("Image")) ? Model.Item.GetFile("Image").Path : ""; 104 105 if (!string.IsNullOrEmpty(Model.Item.GetString("Image"))) 106 { 107 @RenderIcon(imageSrc, iconSize) 108 } 109 else 110 { 111 string imagePath = Model.Item.GetRawValueString("Icon", ""); 112 113 if (!imagePath.ToLower().Contains("none") && imagePath != "") 114 { 115 @RenderIcon(imagePath, iconSize) 116 } 117 } 118 } 119 120 @helper RenderIcon(string imagePath, string iconSize) 121 { 122 if (Path.GetExtension(imagePath).ToLower() == ".svg") 123 { 124 <div class="icon-auto" style="height: @(iconSize)px; width: @(iconSize)px;"> 125 @ReadFile(imagePath) 126 </div> 127 } 128 else 129 { 130 imagePath = "/Admin/Public/GetImage.ashx?image=" + imagePath + "&height=" + iconSize + "&width=" + iconSize + "&Crop=0&Format=WebP&Quality=100"; 131 string imgAltText = Model.Item.GetRawValueString("FeatureAltText", string.Empty); 132 133 <img loading="lazy" src="@imagePath" alt="@imgAltText" title="@Model.Item.GetString("Title")" style="height: @(iconSize)px; width: @(iconSize)px;"> 134 } 135 } 136 137 @helper RenderTitle() 138 { 139 string titleFontSize = Model.Item.GetRawValueString("TitleFontSize", "h4"); 140 string headingLevel = Model.Item.GetString("HeadingLevel", "h2"); 141 string headingLevelStart = $"<{headingLevel} class=\"{titleFontSize} m-0\">"; 142 string headingLevelStop = $"</{headingLevel}>"; 143 144 if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) 145 { 146 @headingLevelStart 147 @Model.Item.GetString("Title") 148 @headingLevelStop 149 } 150 } 151 152 @helper RenderBody() 153 { 154 if (!string.IsNullOrEmpty(Model.Item.GetString("Text"))) 155 { 156 <p class="m-0">@Model.Item.GetString("Text")</p> 157 } 158 } 159
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_60b964716f74465eb821273758fd8922.<RenderIconAndImage>b__0_0(TextWriter __razor_helper_writer) in E:\Solutions\dlf.test002.webtester.dk\Files\Templates\Designs\Swift\Paragraph\Swift_Feature.cshtml:line 103 at CompiledRazorTemplates.Dynamic.RazorEngine_60b964716f74465eb821273758fd8922.Execute() in E:\Solutions\dlf.test002.webtester.dk\Files\Templates\Designs\Swift\Paragraph\Swift_Feature.cshtml:line 24 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", ""); 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() : ""; 11 } 12 13 <div class="h-100 @(contentPadding)@(theme) item_@Model.Item.SystemName.ToLower()"> 14 @switch (layout) 15 { 16 case "icon-top": 17 if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 18 { 19 @:<a href="@Model.Item.GetString("Link")" class="text-decoration-none d-block h-100"> 20 } 21 22 <div class="d-flex flex-column gap-3 text-center mb-0-last-child"> 23 <div> 24 @RenderIconAndImage() 25 </div> 26 27 @if ( 28 !string.IsNullOrEmpty(Model.Item.GetString("Title")) && 29 !Model.Item.GetBoolean("HideTitle") || 30 !string.IsNullOrEmpty(Model.Item.GetString("Text")) 31 ) 32 { 33 <div class="mb-0-last-child"> 34 @RenderTitle() 35 @RenderBody() 36 </div> 37 } 38 39 </div> 40 41 if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 42 { 43 @:</a> 44 } 45 break; 46 case "icon-left": 47 if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 48 { 49 @:<a href="@Model.Item.GetString("Link")" class="text-decoration-none d-block h-100"> 50 } 51 52 <div class="d-flex flex-row align-items-stretch gap-3 h-100 text-start"> 53 <div class="flex-grow-0"> 54 @RenderIconAndImage() 55 </div> 56 57 @if ( 58 !string.IsNullOrEmpty(Model.Item.GetString("Title")) && 59 !Model.Item.GetBoolean("HideTitle") || 60 !string.IsNullOrEmpty(Model.Item.GetString("Text")) 61 ) 62 { 63 <div class="d-flex flex-column flex-grow-1 gap-3"> 64 @RenderTitle() 65 @RenderBody() 66 </div> 67 } 68 69 </div> 70 71 if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 72 { 73 @:</a> 74 } 75 break; 76 case "icon-right": 77 if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 78 { 79 @:<a href="@Model.Item.GetString("Link")" class="text-decoration-none d-block h-100"> 80 } 81 82 <div class="d-flex flex-row align-items-stretch gap-3 h-100 text-end"> 83 <div class="d-flex flex-column flex-grow-1 gap-3"> 84 @RenderTitle() 85 @RenderBody() 86 </div> 87 88 <div class="flex-grow-0"> 89 @RenderIconAndImage() 90 </div> 91 </div> 92 if (!string.IsNullOrEmpty(Model.Item.GetString("Link"))) 93 { 94 @:</a> 95 } 96 break; 97 } 98 </div> 99 100 @helper RenderIconAndImage() 101 { 102 string iconSize = Model.Item.GetRawValueString("IconSize", "2"); 103 string imageSrc = !string.IsNullOrEmpty(Model.Item.GetString("Image")) ? Model.Item.GetFile("Image").Path : ""; 104 105 if (!string.IsNullOrEmpty(Model.Item.GetString("Image"))) 106 { 107 @RenderIcon(imageSrc, iconSize) 108 } 109 else 110 { 111 string imagePath = Model.Item.GetRawValueString("Icon", ""); 112 113 if (!imagePath.ToLower().Contains("none") && imagePath != "") 114 { 115 @RenderIcon(imagePath, iconSize) 116 } 117 } 118 } 119 120 @helper RenderIcon(string imagePath, string iconSize) 121 { 122 if (Path.GetExtension(imagePath).ToLower() == ".svg") 123 { 124 <div class="icon-auto" style="height: @(iconSize)px; width: @(iconSize)px;"> 125 @ReadFile(imagePath) 126 </div> 127 } 128 else 129 { 130 imagePath = "/Admin/Public/GetImage.ashx?image=" + imagePath + "&height=" + iconSize + "&width=" + iconSize + "&Crop=0&Format=WebP&Quality=100"; 131 string imgAltText = Model.Item.GetRawValueString("FeatureAltText", string.Empty); 132 133 <img loading="lazy" src="@imagePath" alt="@imgAltText" title="@Model.Item.GetString("Title")" style="height: @(iconSize)px; width: @(iconSize)px;"> 134 } 135 } 136 137 @helper RenderTitle() 138 { 139 string titleFontSize = Model.Item.GetRawValueString("TitleFontSize", "h4"); 140 string headingLevel = Model.Item.GetString("HeadingLevel", "h2"); 141 string headingLevelStart = $"<{headingLevel} class=\"{titleFontSize} m-0\">"; 142 string headingLevelStop = $"</{headingLevel}>"; 143 144 if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) 145 { 146 @headingLevelStart 147 @Model.Item.GetString("Title") 148 @headingLevelStop 149 } 150 } 151 152 @helper RenderBody() 153 { 154 if (!string.IsNullOrEmpty(Model.Item.GetString("Text"))) 155 { 156 <p class="m-0">@Model.Item.GetString("Text")</p> 157 } 158 } 159