Cravat CROATA

010200-004130
$85.00 InStock
Error executing template "/Designs/Swift/Paragraph/DS_ProductSpecification.cshtml"
System.IO.IOException: The process cannot access the file 'C:\inetpub\wwwroot\DWProd_2025\Solutions\Swift_v1.21.0\Files\Templates\Designs\Swift\Translations.xml' because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at Dynamicweb.Rendering.Translation.Source.WriteDocument(XmlDocument document)
   at Dynamicweb.Rendering.Translation.Source.Save()
   at Dynamicweb.Rendering.Translation.Source.UpdateTranslationSource(Source source, IEnumerable`1 newKeys, String designName, IEnumerable`1 cultures)
   at Dynamicweb.Rendering.Template.TranslateText(String text, String defaultValue, String cultureName)
   at Dynamicweb.Rendering.TemplateBase`1.Translate(String text)
   at CompiledRazorTemplates.Dynamic.RazorEngine_b63b0db2bab043f69474d1208df8bfbb.Execute() in C:\inetpub\wwwroot\DWProd_2025\Solutions\Swift_v1.21.0\Files\Templates\Designs\Swift\Paragraph\DS_ProductSpecification.cshtml:line 117
   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 Dynamicweb.Ecommerce.ProductCatalog 3 4 @{ 5 ProductViewModel product = null; 6 if (Dynamicweb.Context.Current.Items.Contains("ProductDetails")) 7 { 8 product = (ProductViewModel)Dynamicweb.Context.Current.Items["ProductDetails"]; 9 } 10 else if (Pageview.Item["DummyProduct"] != null) 11 { 12 var pageViewModel = Dynamicweb.Frontend.ContentViewModelFactory.CreatePageInfoViewModel(Pageview.Page); 13 ProductListViewModel productList = pageViewModel.Item.GetValue("DummyProduct") != null ? pageViewModel.Item.GetValue("DummyProduct") as ProductListViewModel : new ProductListViewModel(); 14 15 if (productList?.Products is object) 16 { 17 product = productList.Products[0]; 18 } 19 } 20 } 21 22 @if (product is object) { 23 IEnumerable<string> selectedDisplayGroupIds = Model.Item.GetRawValueString("DisplayGroups").Split(',').ToList(); 24 List<CategoryFieldViewModel> displayGroups = new List<CategoryFieldViewModel>(); 25 26 foreach (var selection in selectedDisplayGroupIds) 27 { 28 foreach (CategoryFieldViewModel group in product.FieldDisplayGroups.Values) 29 { 30 if (selection == group.Id) 31 { 32 int fieldsWithNoValueOrZero = 0; 33 34 foreach (var field in group.Fields) 35 { 36 if (string.IsNullOrEmpty(field.Value.Value.ToString())) 37 { 38 fieldsWithNoValueOrZero++; 39 } 40 } 41 42 if (fieldsWithNoValueOrZero != group.Fields.Count) 43 { 44 displayGroups.Add(group); 45 } 46 } 47 } 48 } 49 50 bool showProductFields = Model.Item.GetBoolean("ProductFields"); 51 52 bool hideTitle = Model.Item.GetBoolean("HideTitle"); 53 54 string theme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("Theme")) ? " theme " + Model.Item.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : ""; 55 56 string titleFontSize = Model.Item.GetRawValueString("TitleFontSize", "display-4"); 57 58 string contentPadding = Model.Item.GetRawValueString("ContentPadding", ""); 59 contentPadding = contentPadding == "none" ? string.Empty : contentPadding; 60 contentPadding = contentPadding == "small" ? " p-2 p-md-3" : contentPadding; 61 contentPadding = contentPadding == "large" ? " p-4 p-md-5" : contentPadding; 62 63 string layout = Model.Item.GetRawValueString("Layout", "list"); 64 string size = Model.Item.GetRawValueString("Size", "full"); 65 string gaps = size == "full" ? " gap-4" : " gap-2"; 66 67 68 if (Pageview.IsVisualEditorMode && displayGroups.Count() == 0) 69 { 70 product.ProductFields.Clear(); 71 product.ProductFields.Add(Translate("Width"), new FieldValueViewModel { Name = Translate("Width"), Value = "99cm" }); 72 product.ProductFields.Add(Translate("Height"), new FieldValueViewModel { Name = Translate("Height"), Value = "195cm" }); 73 showProductFields = true; 74 } 75 76 if (layout == "commas") 77 { 78 gaps = size == "full" ? " gap-4" : " gap-2"; 79 80 } 81 82 <div class="h-100@(gaps)@(theme)@(contentPadding) item_@Model.Item.SystemName.ToLower()"> 83 <div> 84 @if ((product.ProductFields != null && Model.Item.GetBoolean("ProductFields")) || (product.ProductCategories != null && Model.Item.GetBoolean("CategoryFields")) || (displayGroups.Count != 0)) { 85 if (!hideTitle) 86 { 87 <h2 class="g-col-12 @titleFontSize">@Model.Item.GetString("Title")</h2> 88 } 89 } 90 91 @if (displayGroups.Count != 0) 92 { 93 int br = 0; 94 string show = " none"; 95 if (layout != "accordion") 96 { 97 foreach (var group in displayGroups) 98 { 99 bool hideHeader = Model.Item.GetBoolean("HideGroupHeaders"); 100 101 if (!hideHeader) { 102 show = " none"; 103 if (br == 0) 104 { 105 show = " ShowList"; 106 br++; 107 } 108 <h4 class="g-col-12 h4 mb-0 productdetailAtributesHeading" onclick="document.getElementsByClassName('@group.Name')[0].classList.toggle('ShowList');">+ @Translate(group.Name) </h4> 109 } 110 111 { <div class="@group.Name @show">@RenderFieldsFromList(group.Fields, layout)</div> } 112 113 114 115 } 116 <div class="g-col-12"> 117 <a href="/Default.aspx?Id=@GetPageIdByNavigationTag("TermsAndConditions") ?1" class=" productdetailAtributesHeading">+ @Translate("DOSTAVA")</a> <br> 118 <a href="/Default.aspx?Id=@GetPageIdByNavigationTag("TermsAndConditions") ?3" class=" productdetailAtributesHeading">+ @Translate("PLAĆANJE")</a> <br> 119 <a href="/Default.aspx?Id=@GetPageIdByNavigationTag("TermsAndConditions") ?2" class=" productdetailAtributesHeading">+ @Translate("POVRATI I ZAMJENE")</a> 120 </div> 121 } 122 else 123 { 124 <div class="g-col-12"> 125 <div class="accordion accordion-flush w-100" id="Specifications_@Model.ID"> 126 @foreach (var group in displayGroups) 127 { 128 <div class="accordion-item"> 129 <h2 class="accordion-header" id="SpecificationHeading_@group.Id"> 130 <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#SpecificationItem_@group.Id" aria-expanded="false" aria-controls="SpecificationItem_@group.Id"> 131 @group.Name 132 </button> 133 </h2> 134 <div id="SpecificationItem_@group.Id" class="accordion-collapse collapse" aria-labelledby="SpecificationHeading_@group.Id" data-bs-parent="#Specifications_@Model.ID"> 135 <div class="accordion-body"> 136 @{ @RenderFieldsFromList(group.Fields, "list") } 137 </div> 138 </div> 139 </div> 140 } 141 </div> 142 </div> 143 } 144 } 145 146 @if (product.ProductFields != null && showProductFields) 147 { 148 if (product.ProductFields.Count > 0) 149 { 150 if (layout != "accordion") 151 { 152 {@RenderFieldsFromList(product.ProductFields, layout) } 153 } 154 else 155 { 156 <div class="g-col-12"> 157 <div class="accordion accordion-flush w-100" id="Specifications_@Model.ID"> 158 <div class="accordion-item"> 159 <h2 class="accordion-header" id="SpecificationHeading_@Model.ID"> 160 <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#SpecificationItem_@Model.ID" aria-expanded="false" aria-controls="SpecificationItem_@Model.ID"> 161 @Translate("Specifications") 162 </button> 163 </h2> 164 <div id="SpecificationItem_@Model.ID" class="accordion-collapse" aria-labelledby="SpecificationHeading_@Model.ID" data-bs-parent="#Specifications_@Model.ID"> 165 <div class="accordion-body"> 166 @{ @RenderFieldsFromList(product.ProductFields, "List") } 167 </div> 168 </div> 169 </div> 170 </div> 171 </div> 172 } 173 } 174 } 175 176 @if (product.ProductCategories != null && Model.Item.GetBoolean("CategoryFields")) 177 { 178 if (product.ProductCategories.Count > 0) 179 { 180 if (layout != "accordion") 181 { 182 foreach (var group in product.ProductCategories) 183 { 184 CategoryFieldViewModel category = group.Value; 185 bool hideHeader = Model.Item.GetBoolean("HideGroupHeaders"); 186 187 if (!hideHeader) { 188 <h4 class="g-col-12 h4 mb-0">@group.Value.Name</h4> 189 } 190 191 { @RenderFieldsFromList(category.Fields, layout) } 192 } 193 } 194 else 195 { 196 <div class="g-col-12"> 197 <div class="accordion accordion-flush w-100" id="Specifications_@Model.ID"> 198 @foreach (var group in product.ProductCategories) 199 { 200 CategoryFieldViewModel category = group.Value; 201 202 <div class="accordion-item"> 203 <h2 class="accordion-header" id="SpecificationHeading_@group.Value.Id"> 204 <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#SpecificationItem_@group.Value.Id" aria-expanded="false" aria-controls="SpecificationItem_@group.Value.Id"> 205 @group.Value.Name 206 </button> 207 </h2> 208 <div id="SpecificationItem_@group.Value.Id" class="accordion-collapse" aria-labelledby="SpecificationHeading_@group.Value.Id" data-bs-parent="#Specifications_@Model.ID"> 209 <div class="accordion-body"> 210 @{ @RenderFieldsFromList(category.Fields, "list") } 211 </div> 212 </div> 213 </div> 214 } 215 </div> 216 </div> 217 } 218 } 219 } 220 </div> 221 </div> 222 } 223 else if (Pageview.IsVisualEditorMode) 224 { 225 <div class="alert alert-warning m-0">@Translate("No products available")</div> 226 } 227 228 @helper RenderFieldsFromList(Dictionary<string, FieldValueViewModel> fields, string layout) 229 { 230 string size = Model.Item.GetRawValueString("Size", "full"); 231 string gaps = size != "full" ? " gap-1" : string.Empty; 232 bool hideFieldLabels = Model.Item.GetBoolean("HideFieldLabels"); 233 bool hideFieldsWithZeroValue = Model.Item.GetBoolean("HideFieldsWithZeroValue"); 234 235 if (layout == "columns") { 236 <div class="g-col-12"> 237 <div class="grid@(gaps)"> 238 @foreach (var field in fields) 239 { 240 {@RenderField(field.Value, layout)} 241 } 242 </div> 243 </div> 244 } 245 if (layout == "list") { 246 <div class="g-col-12"> 247 <dl class="Popis"> 248 @foreach (var field in fields) 249 { 250 {@RenderField(field.Value, layout)} 251 } 252 </dl> 253 </div> 254 } 255 if (layout == "table") 256 { 257 string tableSize = size == "full" ? "" : " table-sm"; 258 <div class="g-col-12"> 259 <table class="table table-striped@(tableSize)"> 260 @foreach (var field in fields) 261 { 262 {@RenderField(field.Value, layout)} 263 } 264 </table> 265 </div> 266 } 267 if (layout == "bullets") 268 { 269 string listSize = size == "full" ? "" : "m-0 p-0 lh-1 fs-7 opacity-75"; 270 string listStyle = size == "full" ? "" : "style=\"list-style-position: inside\""; 271 <div class="g-col-12"> 272 <ul class="@listSize" @listStyle> 273 @foreach (var field in fields) 274 { 275 {@RenderField(field.Value, layout)} 276 } 277 </ul> 278 </div> 279 } 280 if (layout == "commas") 281 { 282 List<string> featuresList = new List<string>(); 283 284 foreach (var field in fields) 285 { 286 string firstListItemValue = string.Empty; //Hack to support field type providers with a single value 287 288 if (field.Value?.Value != null) 289 { 290 if (field.Value.Value.GetType() == typeof(System.Collections.Generic.List<FieldOptionValueViewModel>)) 291 { 292 System.Collections.Generic.List<FieldOptionValueViewModel> values = field.Value.Value as System.Collections.Generic.List<FieldOptionValueViewModel>; 293 294 //Hack to support field type providers with a single value 295 if (values.FirstOrDefault() != null) 296 { 297 firstListItemValue = values.FirstOrDefault().Value; 298 } 299 } 300 } 301 302 if (!hideFieldsWithZeroValue || (firstListItemValue != "0" && firstListItemValue != "0.0" && field.Value.Value.ToString() != "0" && field.Value.Value.ToString() != "0.0")) 303 { 304 if (field.Value.Value is object && !string.IsNullOrEmpty(field.Value.Value.ToString())) 305 { 306 if (field.Value.Value.GetType() == typeof(System.Collections.Generic.List<FieldOptionValueViewModel>)) 307 { 308 List<string> options = new List<string>(); 309 foreach (FieldOptionValueViewModel option in field.Value.Value as System.Collections.Generic.List<FieldOptionValueViewModel>) 310 { 311 if (!string.IsNullOrWhiteSpace(option.Value)) 312 { 313 if (option.Value.ToString().Contains("#") && (Translate(field.Value.Name) == Translate("Color") || Translate(field.Value.Name) == Translate("Colour"))) 314 { 315 string colorSpan = "<span class=\"colorbox-sm\" style=\"background-color: " + option.Value + "\"></span>"; 316 options.Add(colorSpan); 317 } 318 else if (!string.IsNullOrEmpty(option.Value)) 319 { 320 options.Add(option.Name); 321 } 322 } 323 } 324 string optionsString = (string.Join(", ", options.Select(x => x.ToString()).ToArray())); 325 if ((Translate(field.Value.Name) == Translate("Color") || Translate(field.Value.Name) == Translate("Colour"))) 326 { 327 optionsString = (string.Join(" ", options.Select(x => x.ToString()).ToArray())); 328 } 329 330 if (!string.IsNullOrEmpty(optionsString)) 331 { 332 if (!hideFieldLabels) 333 { 334 featuresList.Add(field.Value.Name + ": " + optionsString); 335 } 336 else 337 { 338 featuresList.Add(optionsString); 339 } 340 } 341 } 342 else 343 { 344 if (!string.IsNullOrWhiteSpace(field.Value.Value.ToString())) 345 { 346 if (field.Value.Value.ToString().Contains("#") && (Translate(field.Value.Name) == Translate("Color") || Translate(field.Value.Name) == Translate("Colour"))) 347 { 348 string colorSpan = "<span class=\"colorbox-sm\" style=\"background-color: " + field.Value.Value + "\"></span>"; 349 350 if (!hideFieldLabels) 351 { 352 featuresList.Add(field.Value.Name + ": " + colorSpan); 353 } 354 else 355 { 356 featuresList.Add(colorSpan); 357 } 358 } 359 else 360 { 361 if (!hideFieldLabels) 362 { 363 featuresList.Add(field.Value.Name + ": " + field.Value.Value.ToString()); 364 } 365 else 366 { 367 featuresList.Add(field.Value.Value.ToString()); 368 } 369 } 370 } 371 } 372 } 373 } 374 } 375 376 string featuresString = (string.Join(", ", featuresList.Select(x => x.ToString()).ToArray())); 377 378 <div class="g-col-12 opacity-75 fs-7">@featuresString</div> 379 } 380 } 381 382 @helper RenderField(FieldValueViewModel field, string layout) 383 { 384 string size = Model.Item.GetRawValueString("Size", "full"); 385 string fieldValue = field?.Value != null ? field.Value.ToString() : ""; 386 bool hideFieldLabels = Model.Item.GetBoolean("HideFieldLabels"); 387 bool noValues = false; 388 string firstListItemValue = string.Empty; //Hack to support field type providers with a single value 389 bool hideFieldsWithZeroValue = Model.Item.GetBoolean("HideFieldsWithZeroValue"); 390 391 if (!string.IsNullOrEmpty(fieldValue)) 392 { 393 if (field.Value.GetType() == typeof(System.Collections.Generic.List<FieldOptionValueViewModel>)) 394 { 395 System.Collections.Generic.List<FieldOptionValueViewModel> values = field.Value as System.Collections.Generic.List<FieldOptionValueViewModel>; 396 noValues = values.Count > 0 ? false : true; 397 398 //Hack to support field type providers with a single value 399 if (values.FirstOrDefault() != null) 400 { 401 firstListItemValue = values.FirstOrDefault().Value; 402 } 403 } 404 } 405 406 if (!string.IsNullOrEmpty(fieldValue) && noValues == false) 407 { 408 if (!hideFieldsWithZeroValue || (firstListItemValue != "0" && firstListItemValue != "0.0" && field.Value.ToString() != "0" && field.Value.ToString() != "0.0")) 409 { 410 if (layout == "columns") 411 { 412 413 <div class="grid g-col-6 g-col-lg-4 gap-1"> 414 @if (!hideFieldLabels) 415 { 416 <dt class="g-col-12 g-col-lg-4">@field.Name</dt> 417 } 418 <dd class="g-col-12 g-col-lg-8 mb-0 text-break"> 419 @{ @RenderFieldValue(field) } 420 </dd> 421 </div> 422 } 423 if (layout == "list") 424 { 425 if (!hideFieldLabels) 426 { 427 <div class="g-col-4 productField">@field.Name: @{ @RenderFieldValue(field) }</div> 428 } 429 } 430 if (layout == "table") 431 { 432 <tr> 433 @if (!hideFieldLabels) 434 { 435 <th class="w-25 w-lg-50" scope="row">@field.Name</th> 436 } 437 <td class="text-break"> 438 @{ @RenderFieldValue(field) } 439 </td> 440 </tr> 441 } 442 if (layout == "bullets") 443 { 444 <li> 445 @if (!hideFieldLabels) 446 { 447 <strong>@field.Name</strong> 448 } 449 <span> 450 @{ @RenderFieldValue(field) } 451 </span> 452 </li> 453 } 454 } 455 } 456 } 457 458 @helper RenderFieldValue(FieldValueViewModel field) 459 { 460 string fieldValue = field?.Value != null ? field.Value.ToString() : ""; 461 462 bool isLink = field?.Type == "Link"; 463 bool isColor = false; 464 bool isBrandName = field?.SystemName == "Brand_name"; 465 466 fieldValue = fieldValue == "False" ? Translate("No") : fieldValue; 467 fieldValue = fieldValue == "True" ? Translate("Yes") : fieldValue; 468 469 470 if (field.Value.GetType() == typeof(System.Collections.Generic.List<Dynamicweb.Ecommerce.ProductCatalog.FieldOptionValueViewModel>)) 471 { 472 int valueCount = 0; 473 System.Collections.Generic.List<FieldOptionValueViewModel> values = field.Value as System.Collections.Generic.List<FieldOptionValueViewModel>; 474 int totalValues = values.Count; 475 476 foreach (FieldOptionValueViewModel option in values) 477 { 478 if (!string.IsNullOrEmpty(option.Value)) 479 { 480 if (option.Value.Substring(0, 1) == "#") 481 { 482 isColor = true; 483 } 484 } 485 486 if (!isColor) 487 { 488 @option.Name 489 } 490 else 491 { 492 <span class="colorbox-sm" style="background-color: @option.Value" title="@option.Name"></span> 493 } 494 495 if (valueCount != totalValues && valueCount < (totalValues - 1)) 496 { 497 if (isColor) 498 { 499 <text> </text> 500 } 501 else 502 { 503 <text>, </text> 504 } 505 } 506 valueCount++; 507 } 508 } 509 else 510 { 511 if (fieldValue.Substring(0, 1) == "#") 512 { 513 isColor = true; 514 } 515 516 if (!isColor) 517 { 518 if (isLink) 519 { 520 string linktTitle = !fieldValue.Contains("aspx") ? fieldValue : Translate("Go to link"); 521 string target = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && fieldValue.Contains("http") ? "target=\"_blank\"" : string.Empty; 522 string rel = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && fieldValue.Contains("http") ? "rel=\"noopener\"" : string.Empty; 523 524 <a href="@field.Value" title="@field.Name" @target @rel>@linktTitle</a> 525 } 526 else if (isBrandName) 527 { 528 <span itemprop="brand" itemtype="https://schema.org/Brand" itemscope> 529 <span itemprop="name">@fieldValue</span> 530 </span> 531 } 532 else 533 { 534 @fieldValue 535 } 536 537 } 538 else 539 { 540 <span class="colorbox-sm" style="background-color: @fieldValue" title="@fieldValue"></span> 541 } 542 } 543 } 544
By clicking 'Accept All' you consent that we may collect information about you for various purposes, including: Functionality, Statistics and Marketing