Error executing template "/Designs/Swift/Grid/Page/RowTemplates/Dalgas_MicrosoftCrmForm.cshtml" System.IO.IOException: There is not enough space on the disk. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.WriteCore(Byte[] buffer, Int32 offset, Int32 count) at System.IO.FileStream.FlushWrite(Boolean calledFromFinalizer) at System.IO.FileStream.Dispose(Boolean disposing) at System.IO.Stream.Close() at System.IO.StreamWriter.Dispose(Boolean disposing) at System.IO.TextWriter.Dispose() at System.IO.File.InternalWriteAllText(String path, String contents, Encoding encoding, Boolean checkHost) at RazorEngine.Roslyn.CSharp.RoslynCompilerServiceBase.CompileType(TypeContext context) at RazorEngine.Templating.RazorEngineCore.CreateTemplateType(ITemplateSource razorTemplate, Type modelType) at RazorEngine.Templating.RazorEngineCore.Compile(ITemplateKey key, Type modelType) at RazorEngine.Templating.RazorEngineService.CompileAndCacheInternal(ITemplateKey key, Type modelType) at RazorEngine.Templating.RazorEngineService.GetCompiledTemplate(ITemplateKey key, Type modelType, Boolean compileOnCacheMiss) at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag) at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer) at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter) at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template) at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template) at Dynamicweb.Rendering.Template.RenderRazorTemplate()
1 @using System 2 @using System.Collections.Generic 3 @using System.Linq 4 @using Dynamicweb.Content 5 @using Dynamicweb.Frontend 6 @using Dalgas.Custom.Services 7 @using Dalgas.Custom.ViewModels.UI 8 @using Dynamicweb.Core.Json 9 @using Dynamicweb.Ecommerce.ProductCatalog 10 @using Dynamicweb.Indexing.Querying 11 @using Dynamicweb.Indexing.Querying.Faceting 12 @using Dynamicweb.Indexing.Querying.Sorting 13 @using Dynamicweb.Modules 14 @using ParagraphService = Dalgas.Custom.Services.ParagraphService 15 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.GridRowViewModel> 16 17 @using System 18 @using System.Collections.Generic 19 @using System.Linq 20 @using Dalgas.Custom.ViewModels.UI 21 @using Dynamicweb.Content 22 @using Dynamicweb.Ecommerce.ProductCatalog 23 @using Dynamicweb.Frontend 24 @using ParagraphService = Dalgas.Custom.Services.ParagraphService 25 26 @*TODO: Move these functions onto the model *@ 27 28 @functions 29 { 30 31 public string GetSectionClassList(GridRowViewModel model, string overwriteTheme = "") 32 { 33 var returnValues = new List<string> 34 { 35 $"item_{model.Item.SystemName.ToLower()}" 36 }; 37 38 if (Services.Grids.GetGridRowById(model.Id).Sort == 1) 39 { 40 returnValues.Add("dalgas-section-first-on-page"); 41 } 42 43 var sectionBackgroundTheme = model.Item.GetItem("ColorScheme")?.GetString("ColorScheme") ?? string.Empty; 44 45 if (!string.IsNullOrEmpty(overwriteTheme)) 46 { 47 sectionBackgroundTheme = overwriteTheme; 48 } 49 50 // Add theme class if it exists 51 if (!string.IsNullOrWhiteSpace(sectionBackgroundTheme)) 52 { 53 if (sectionBackgroundTheme.Contains("default")) 54 { 55 returnValues.Add("theme theme-light"); 56 } 57 else 58 { 59 returnValues.Add($"theme {sectionBackgroundTheme.Replace(" ", "").Trim().ToLower()}"); 60 } 61 } 62 63 // Determine if top padding should be removed 64 65 string removeTopPadding = model.Item.GetItem("ColorScheme")?.GetString("RemoveTopPadding"); 66 67 returnValues.Add("pb-6"); 68 if (removeTopPadding != "enable") 69 { 70 returnValues.Add("pt-6"); 71 } 72 73 return string.Join(" ", returnValues); 74 } 75 76 } 77 78 79 @{ 80 IEnumerable<HeadingViewModel> headings = ParagraphService.Instance.GetHeadingsByItems(Model.Item?.GetItem("Paragraph_Text")?.GetItems("Headings")); 81 string text = Model.Item.GetItem("Paragraph_Text")?.GetString("Text"); 82 string lead = Model.Item.GetItem("Paragraph_Text")?.GetString("Lead"); 83 IEnumerable<ButtonViewModel> buttons = ParagraphService.Instance.GetButtonsByItems(Model.Item?.GetItem("Paragraph_Text")?.GetItems("Buttons")); 84 85 bool hasImage = Model.Item.GetItem("Paragraph_Image")?.GetFile("Image") != null; 86 bool hasText = !string.IsNullOrEmpty(Model.Item?.GetItem("Paragraph_Text")?.GetString("Text")); 87 bool hasLead = !string.IsNullOrEmpty(Model.Item?.GetItem("Paragraph_Text")?.GetString("Lead")); 88 bool hasHeading = headings.Any(); 89 bool hasButton = buttons.Any(); 90 91 var theme = Model.Item.GetItem("ColorScheme")?.GetString("ColorScheme"); 92 var fifthElementTheme = "fifth-element-color-" + Model.Item?.GetItem("ColorScheme")?.GetString("FifthElementColor"); 93 94 var sectionClassList = GetSectionClassList(Model); 95 96 var image = string.Empty; 97 var imageParameters = new Dictionary<string, object>(); 98 99 string layout = string.Empty; 100 Boolean enableFifthElement = false; 101 if (Model?.Item != null) 102 { 103 var paragraphLayout = Model.Item.GetItem("Paragraph_Layout"); 104 105 if (paragraphLayout != null) 106 { 107 layout = paragraphLayout.GetString("Layout"); 108 109 enableFifthElement = !string.IsNullOrEmpty(paragraphLayout.GetString("Layout_FifthElement")); 110 } 111 } 112 113 if (!string.IsNullOrEmpty(Model.Item?.GetItem("Paragraph_Image")?.GetFile("Image")?.Path)) 114 { 115 image = Model.Item.GetItem("Paragraph_Image").GetFile("Image").Path; 116 imageParameters.Add("alt", Model.Item.GetItem("Paragraph_Image")?.GetString("ImageAltText")); 117 int xPos = Model.Item.GetItem("Paragraph_Image").GetFile("Image")?.FocalPositionFromLeft ?? 50; 118 int yPos = Model.Item.GetItem("Paragraph_Image").GetFile("Image")?.FocalPositionFromTop ?? 50; 119 string cssPosition = $"{xPos}% {yPos}%"; 120 imageParameters.Add("style", "object-position:" + cssPosition); 121 } 122 123 LinkViewModel imageLink = new LinkViewModel(); 124 if (Model.Item?.GetItem("Paragraph_Image")?.GetItem("Link") != null && !string.IsNullOrEmpty(Model?.Item?.GetItem("Paragraph_Image")?.GetItem("Link").GetString("ButtonLink"))) 125 { 126 imageLink = ParagraphService.Instance.GetLinkByItem(Model?.Item?.GetItem("Paragraph_Image")?.GetItem("Link")); 127 } 128 129 string fifthElementIconPath = "/Files/Templates/Designs/Swift/Assets/Images/DalgasFifthElements/"; 130 } 131 132 133 @{ 134 string formBlockId = Model.Item.GetString("FormId"); 135 string formContainerId = Model.Item.GetString("ContainerId"); 136 } 137 138 <section id="section-@Model.Id" class="@sectionClassList item_dalgas_textimage_horizontal" data-swift-gridrow> 139 <div class=""> 140 141 @if (!string.IsNullOrEmpty(formBlockId) && !string.IsNullOrEmpty(formContainerId)) 142 { 143 <div class="container-xl"> 144 <div class="row"> 145 <div class="col-12"> 146 <div class="row"> 147 148 <div class="js-content-container content-container col-12 col-md-1"> 149 150 <figure class="ratio ratio-16x9"> 151 <div class="fifth-element size-2 @fifthElementTheme"> 152 153 <div class="fifth-element-inline-container "> 154 <div class=""> 155 <span>@ReadFile(fifthElementIconPath + "lotus.svg")</span> 156 <span>@ReadFile(fifthElementIconPath + "sun.svg")</span> 157 </div> 158 <div> 159 <span>@ReadFile(fifthElementIconPath + "sun.svg")</span> 160 </div> 161 </div> 162 </div> 163 </figure> 164 </div> 165 166 167 <div class="js-remove-microsoft-form-styling microsoft-form-container offset-lg-1 ms-auto mx-lg-auto col-md-8 col-lg-4 justify-content-between d-flex flex-column"> 168 169 <script src="https://cxppusa1formui01cdnsa01-endpoint.azureedge.net/eur/FormLoader/FormLoader.bundle.js" crossorigin="anonymous" defer></script> 170 <div data-cached-form-url="https://assets-eur.mkt.dynamics.com/@formBlockId/digitalassets/forms/@formContainerId" data-form-api-url="https://public-eur.mkt.dynamics.com/api/v1.0/orgs/@formBlockId/landingpageforms" data-form-id="@formContainerId"></div> 171 172 </div> 173 </div> 174 </div> 175 </div> 176 </div> 177 } 178 else 179 { 180 if (Pageview.IsVisualEditorMode) 181 { 182 <div class="container-xl alert alert-danger" role="alert"> 183 This <strong>@Model.Item.SystemName</strong> is empty 184 </div> 185 } 186 } 187 </div> 188 <div class="fifth-element-section-container"> 189 <div class="fifth-element size-2 bottom-0 ob-50 right-0 @fifthElementTheme"> 190 @ReadFile(fifthElementIconPath + "snow.svg") 191 </div> 192 </div> 193 </section> 194