| Name |
Error compiling template "Designs/Swift/Components/Specifications/Shared/FieldValue.cshtml"
Line 56: 'else' cannot start a statement.
Line 56: Syntax error, '(' expected
Line 56: Invalid expression term 'else'
Line 56: ) expected
Line 56: Invalid expression term 'else'
Line 56: ; expected
Line 48: The name 'total' does not exist in the current context
1 // <auto-generated/>
2 #pragma warning disable 1591
3 namespace CompiledRazorTemplates.Dynamic
4 {
5 #line hidden
6 using System.Threading.Tasks;
7 using System;
8 using System.Collections.Generic;
9 using System.Linq;
10 using Dynamicweb.Frontend;
11 using Dynamicweb.Ecommerce.ProductCatalog;
12 internal class RazorEngine_579491de91234e6c961db50e02487e89 : Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Ecommerce.ProductCatalog.FieldValueViewModel>
13 {
14 #pragma warning disable 1998
15 public async override global::System.Threading.Tasks.Task ExecuteAsync()
16 {
17 WriteLiteral("\r\n");
18
19 var hideUnitsOfMeasure = false;
20 var index = 0;
21 var isProductDetail = Pageview.CurrentParagraph.Page.NavigationTag == "ProductDetailPage";
22
23 if (Model.Value is List<FieldOptionValueViewModel> listValues)
24 {
25 WriteLiteral("\t<span>\r\n");
26 foreach (var field in listValues)
27 {
28 if (field.IsColor() && field.GetColor() is ColorViewModel colorModel)
29 {
30 string hexColor = colorModel.Hex;
31
32 WriteLiteral(" <span class=\"colorbox-sm\"");
33 BeginWriteAttribute("style", " style=\"", 632, "\"", 667, 2);
34 WriteAttributeValue("", 640, "background-color:", 640, 17, true);
35 WriteAttributeValue(" ", 657, hexColor, 658, 9, false);
36 EndWriteAttribute();
37 BeginWriteAttribute("title", " title=\"", 668, "\"", 685, 1);
38 WriteAttributeValue("", 676, hexColor, 676, 9, false);
39 EndWriteAttribute();
40 WriteLiteral("></span>\r\n");
41 }
42 else
43 {
44 Write(field.Name.Trim());
45
46 }
47
48 if (isProductDetail && index < total - 1)
49 {
50 Write(", ");
51
52 }
53
54 index++;
55 }
56 WriteLiteral(" </span>\r\n");
57 else
58 {
59 if (Model.IsLink() && Model.GetLink() is LinkViewModel linkModel)
60 {
61 WriteLiteral("\t\t\t<span>\r\n\t\t\t\t<a");
62 BeginWriteAttribute("href", " href=\"", 1013, "\"", 1034, 1);
63 WriteAttributeValue("", 1020, linkModel.Url, 1020, 14, false);
64 EndWriteAttribute();
65 WriteLiteral(">");
66 Write(linkModel.Url);
67 WriteLiteral("</a>\r\n\t\t\t</span>\r\n");
68 }
69 else if (Model.IsColor() && Model.GetColor() is ColorViewModel colorModel)
70 {
71 string hexColor = colorModel.Hex;
72
73 WriteLiteral("\t\t\t<span class=\"colorbox-sm\"");
74 BeginWriteAttribute("style", " style=\"", 1224, "\"", 1259, 2);
75 WriteAttributeValue("", 1232, "background-color:", 1232, 17, true);
76 WriteAttributeValue(" ", 1249, hexColor, 1250, 9, false);
77 EndWriteAttribute();
78 BeginWriteAttribute("title", " title=\"", 1260, "\"", 1277, 1);
79 WriteAttributeValue("", 1268, hexColor, 1268, 9, false);
80 EndWriteAttribute();
81 WriteLiteral("></span>\r\n");
82 }
83 else if (Model.IsFile() && Model.GetFile() is FileViewModel fileModel)
84 {
85 var file = fileModel;
86
87 WriteLiteral("\t\t\t<a");
88 BeginWriteAttribute("href", " href=\"", 1405, "\"", 1422, 1);
89 WriteAttributeValue("", 1412, file.Path, 1412, 10, false);
90 EndWriteAttribute();
91 WriteLiteral(" download>");
92 Write(file.Name);
93 WriteLiteral("</a>\r\n");
94 }
95 else
96 {
97 var value = hideUnitsOfMeasure ? Model.Value : Model.GetValueWithUnits();
98 value = value.ToString().ToLower() == "true" ? Translate("Yes") : value;
99 value = value.ToString().ToLower() == "false" ? Translate("No") : value;
100
101 WriteLiteral("\t\t\t<span>");
102 Write(value);
103 WriteLiteral("</span>\r\n");
104 }
105 }
106 }
107 }
108 #pragma warning restore 1998
109 }
110 }
111 #pragma warning restore 1591
112
1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Ecommerce.ProductCatalog.FieldValueViewModel>
2 @using Dynamicweb.Frontend
3 @using Dynamicweb.Ecommerce.ProductCatalog
4
5 @{
6 var hideUnitsOfMeasure = false;
7 var index = 0;
8 var isProductDetail = Pageview.CurrentParagraph.Page.NavigationTag == "ProductDetailPage";
9
10 if (Model.Value is List<FieldOptionValueViewModel> listValues)
11 {
12 <span>
13 @foreach (var field in listValues)
14 {
15 if (field.IsColor() && field.GetColor() is ColorViewModel colorModel)
16 {
17 string hexColor = colorModel.Hex;
18
19 <span class="colorbox-sm" style="background-color: @hexColor" title="@hexColor"></span>
20 }
21 else
22 {
23 @field.Name.Trim()
24 }
25
26 if (isProductDetail && index < total - 1)
27 {
28 @(", ")
29 }
30
31 index++;
32 }
33 </span>
34 else
35 {
36 if (Model.IsLink() && Model.GetLink() is LinkViewModel linkModel)
37 {
38 <span>
39 <a href="@linkModel.Url">@linkModel.Url</a>
40 </span>
41 }
42 else if (Model.IsColor() && Model.GetColor() is ColorViewModel colorModel)
43 {
44 string hexColor = colorModel.Hex;
45
46 <span class="colorbox-sm" style="background-color: @hexColor" title="@hexColor"></span>
47 }
48 else if (Model.IsFile() && Model.GetFile() is FileViewModel fileModel)
49 {
50 var file = fileModel;
51
52 <a href="@file.Path" download>@file.Name</a>
53 }
54 else
55 {
56 var value = hideUnitsOfMeasure ? Model.Value : Model.GetValueWithUnits();
57 value = value.ToString().ToLower() == "true" ? Translate("Yes") : value;
58 value = value.ToString().ToLower() == "false" ? Translate("No") : value;
59
60 <span>@value</span>
61 }
62 }
63 }
64
|
| Certification |
Error compiling template "Designs/Swift/Components/Specifications/Shared/FieldValue.cshtml"
Line 56: 'else' cannot start a statement.
Line 56: Syntax error, '(' expected
Line 56: Invalid expression term 'else'
Line 56: ) expected
Line 56: Invalid expression term 'else'
Line 56: ; expected
Line 48: The name 'total' does not exist in the current context
1 // <auto-generated/>
2 #pragma warning disable 1591
3 namespace CompiledRazorTemplates.Dynamic
4 {
5 #line hidden
6 using System.Threading.Tasks;
7 using System;
8 using System.Collections.Generic;
9 using System.Linq;
10 using Dynamicweb.Frontend;
11 using Dynamicweb.Ecommerce.ProductCatalog;
12 internal class RazorEngine_04ec7f813de34dc5a6b1402c3202e5ea : Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Ecommerce.ProductCatalog.FieldValueViewModel>
13 {
14 #pragma warning disable 1998
15 public async override global::System.Threading.Tasks.Task ExecuteAsync()
16 {
17 WriteLiteral("\r\n");
18
19 var hideUnitsOfMeasure = false;
20 var index = 0;
21 var isProductDetail = Pageview.CurrentParagraph.Page.NavigationTag == "ProductDetailPage";
22
23 if (Model.Value is List<FieldOptionValueViewModel> listValues)
24 {
25 WriteLiteral("\t<span>\r\n");
26 foreach (var field in listValues)
27 {
28 if (field.IsColor() && field.GetColor() is ColorViewModel colorModel)
29 {
30 string hexColor = colorModel.Hex;
31
32 WriteLiteral(" <span class=\"colorbox-sm\"");
33 BeginWriteAttribute("style", " style=\"", 632, "\"", 667, 2);
34 WriteAttributeValue("", 640, "background-color:", 640, 17, true);
35 WriteAttributeValue(" ", 657, hexColor, 658, 9, false);
36 EndWriteAttribute();
37 BeginWriteAttribute("title", " title=\"", 668, "\"", 685, 1);
38 WriteAttributeValue("", 676, hexColor, 676, 9, false);
39 EndWriteAttribute();
40 WriteLiteral("></span>\r\n");
41 }
42 else
43 {
44 Write(field.Name.Trim());
45
46 }
47
48 if (isProductDetail && index < total - 1)
49 {
50 Write(", ");
51
52 }
53
54 index++;
55 }
56 WriteLiteral(" </span>\r\n");
57 else
58 {
59 if (Model.IsLink() && Model.GetLink() is LinkViewModel linkModel)
60 {
61 WriteLiteral("\t\t\t<span>\r\n\t\t\t\t<a");
62 BeginWriteAttribute("href", " href=\"", 1013, "\"", 1034, 1);
63 WriteAttributeValue("", 1020, linkModel.Url, 1020, 14, false);
64 EndWriteAttribute();
65 WriteLiteral(">");
66 Write(linkModel.Url);
67 WriteLiteral("</a>\r\n\t\t\t</span>\r\n");
68 }
69 else if (Model.IsColor() && Model.GetColor() is ColorViewModel colorModel)
70 {
71 string hexColor = colorModel.Hex;
72
73 WriteLiteral("\t\t\t<span class=\"colorbox-sm\"");
74 BeginWriteAttribute("style", " style=\"", 1224, "\"", 1259, 2);
75 WriteAttributeValue("", 1232, "background-color:", 1232, 17, true);
76 WriteAttributeValue(" ", 1249, hexColor, 1250, 9, false);
77 EndWriteAttribute();
78 BeginWriteAttribute("title", " title=\"", 1260, "\"", 1277, 1);
79 WriteAttributeValue("", 1268, hexColor, 1268, 9, false);
80 EndWriteAttribute();
81 WriteLiteral("></span>\r\n");
82 }
83 else if (Model.IsFile() && Model.GetFile() is FileViewModel fileModel)
84 {
85 var file = fileModel;
86
87 WriteLiteral("\t\t\t<a");
88 BeginWriteAttribute("href", " href=\"", 1405, "\"", 1422, 1);
89 WriteAttributeValue("", 1412, file.Path, 1412, 10, false);
90 EndWriteAttribute();
91 WriteLiteral(" download>");
92 Write(file.Name);
93 WriteLiteral("</a>\r\n");
94 }
95 else
96 {
97 var value = hideUnitsOfMeasure ? Model.Value : Model.GetValueWithUnits();
98 value = value.ToString().ToLower() == "true" ? Translate("Yes") : value;
99 value = value.ToString().ToLower() == "false" ? Translate("No") : value;
100
101 WriteLiteral("\t\t\t<span>");
102 Write(value);
103 WriteLiteral("</span>\r\n");
104 }
105 }
106 }
107 }
108 #pragma warning restore 1998
109 }
110 }
111 #pragma warning restore 1591
112
1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Ecommerce.ProductCatalog.FieldValueViewModel>
2 @using Dynamicweb.Frontend
3 @using Dynamicweb.Ecommerce.ProductCatalog
4
5 @{
6 var hideUnitsOfMeasure = false;
7 var index = 0;
8 var isProductDetail = Pageview.CurrentParagraph.Page.NavigationTag == "ProductDetailPage";
9
10 if (Model.Value is List<FieldOptionValueViewModel> listValues)
11 {
12 <span>
13 @foreach (var field in listValues)
14 {
15 if (field.IsColor() && field.GetColor() is ColorViewModel colorModel)
16 {
17 string hexColor = colorModel.Hex;
18
19 <span class="colorbox-sm" style="background-color: @hexColor" title="@hexColor"></span>
20 }
21 else
22 {
23 @field.Name.Trim()
24 }
25
26 if (isProductDetail && index < total - 1)
27 {
28 @(", ")
29 }
30
31 index++;
32 }
33 </span>
34 else
35 {
36 if (Model.IsLink() && Model.GetLink() is LinkViewModel linkModel)
37 {
38 <span>
39 <a href="@linkModel.Url">@linkModel.Url</a>
40 </span>
41 }
42 else if (Model.IsColor() && Model.GetColor() is ColorViewModel colorModel)
43 {
44 string hexColor = colorModel.Hex;
45
46 <span class="colorbox-sm" style="background-color: @hexColor" title="@hexColor"></span>
47 }
48 else if (Model.IsFile() && Model.GetFile() is FileViewModel fileModel)
49 {
50 var file = fileModel;
51
52 <a href="@file.Path" download>@file.Name</a>
53 }
54 else
55 {
56 var value = hideUnitsOfMeasure ? Model.Value : Model.GetValueWithUnits();
57 value = value.ToString().ToLower() == "true" ? Translate("Yes") : value;
58 value = value.ToString().ToLower() == "false" ? Translate("No") : value;
59
60 <span>@value</span>
61 }
62 }
63 }
64
|
| Physical Form |
Error compiling template "Designs/Swift/Components/Specifications/Shared/FieldValue.cshtml"
Line 56: 'else' cannot start a statement.
Line 56: Syntax error, '(' expected
Line 56: Invalid expression term 'else'
Line 56: ) expected
Line 56: Invalid expression term 'else'
Line 56: ; expected
Line 48: The name 'total' does not exist in the current context
1 // <auto-generated/>
2 #pragma warning disable 1591
3 namespace CompiledRazorTemplates.Dynamic
4 {
5 #line hidden
6 using System.Threading.Tasks;
7 using System;
8 using System.Collections.Generic;
9 using System.Linq;
10 using Dynamicweb.Frontend;
11 using Dynamicweb.Ecommerce.ProductCatalog;
12 internal class RazorEngine_7321944daa46450794cc131a9a236e83 : Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Ecommerce.ProductCatalog.FieldValueViewModel>
13 {
14 #pragma warning disable 1998
15 public async override global::System.Threading.Tasks.Task ExecuteAsync()
16 {
17 WriteLiteral("\r\n");
18
19 var hideUnitsOfMeasure = false;
20 var index = 0;
21 var isProductDetail = Pageview.CurrentParagraph.Page.NavigationTag == "ProductDetailPage";
22
23 if (Model.Value is List<FieldOptionValueViewModel> listValues)
24 {
25 WriteLiteral("\t<span>\r\n");
26 foreach (var field in listValues)
27 {
28 if (field.IsColor() && field.GetColor() is ColorViewModel colorModel)
29 {
30 string hexColor = colorModel.Hex;
31
32 WriteLiteral(" <span class=\"colorbox-sm\"");
33 BeginWriteAttribute("style", " style=\"", 632, "\"", 667, 2);
34 WriteAttributeValue("", 640, "background-color:", 640, 17, true);
35 WriteAttributeValue(" ", 657, hexColor, 658, 9, false);
36 EndWriteAttribute();
37 BeginWriteAttribute("title", " title=\"", 668, "\"", 685, 1);
38 WriteAttributeValue("", 676, hexColor, 676, 9, false);
39 EndWriteAttribute();
40 WriteLiteral("></span>\r\n");
41 }
42 else
43 {
44 Write(field.Name.Trim());
45
46 }
47
48 if (isProductDetail && index < total - 1)
49 {
50 Write(", ");
51
52 }
53
54 index++;
55 }
56 WriteLiteral(" </span>\r\n");
57 else
58 {
59 if (Model.IsLink() && Model.GetLink() is LinkViewModel linkModel)
60 {
61 WriteLiteral("\t\t\t<span>\r\n\t\t\t\t<a");
62 BeginWriteAttribute("href", " href=\"", 1013, "\"", 1034, 1);
63 WriteAttributeValue("", 1020, linkModel.Url, 1020, 14, false);
64 EndWriteAttribute();
65 WriteLiteral(">");
66 Write(linkModel.Url);
67 WriteLiteral("</a>\r\n\t\t\t</span>\r\n");
68 }
69 else if (Model.IsColor() && Model.GetColor() is ColorViewModel colorModel)
70 {
71 string hexColor = colorModel.Hex;
72
73 WriteLiteral("\t\t\t<span class=\"colorbox-sm\"");
74 BeginWriteAttribute("style", " style=\"", 1224, "\"", 1259, 2);
75 WriteAttributeValue("", 1232, "background-color:", 1232, 17, true);
76 WriteAttributeValue(" ", 1249, hexColor, 1250, 9, false);
77 EndWriteAttribute();
78 BeginWriteAttribute("title", " title=\"", 1260, "\"", 1277, 1);
79 WriteAttributeValue("", 1268, hexColor, 1268, 9, false);
80 EndWriteAttribute();
81 WriteLiteral("></span>\r\n");
82 }
83 else if (Model.IsFile() && Model.GetFile() is FileViewModel fileModel)
84 {
85 var file = fileModel;
86
87 WriteLiteral("\t\t\t<a");
88 BeginWriteAttribute("href", " href=\"", 1405, "\"", 1422, 1);
89 WriteAttributeValue("", 1412, file.Path, 1412, 10, false);
90 EndWriteAttribute();
91 WriteLiteral(" download>");
92 Write(file.Name);
93 WriteLiteral("</a>\r\n");
94 }
95 else
96 {
97 var value = hideUnitsOfMeasure ? Model.Value : Model.GetValueWithUnits();
98 value = value.ToString().ToLower() == "true" ? Translate("Yes") : value;
99 value = value.ToString().ToLower() == "false" ? Translate("No") : value;
100
101 WriteLiteral("\t\t\t<span>");
102 Write(value);
103 WriteLiteral("</span>\r\n");
104 }
105 }
106 }
107 }
108 #pragma warning restore 1998
109 }
110 }
111 #pragma warning restore 1591
112
1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Ecommerce.ProductCatalog.FieldValueViewModel>
2 @using Dynamicweb.Frontend
3 @using Dynamicweb.Ecommerce.ProductCatalog
4
5 @{
6 var hideUnitsOfMeasure = false;
7 var index = 0;
8 var isProductDetail = Pageview.CurrentParagraph.Page.NavigationTag == "ProductDetailPage";
9
10 if (Model.Value is List<FieldOptionValueViewModel> listValues)
11 {
12 <span>
13 @foreach (var field in listValues)
14 {
15 if (field.IsColor() && field.GetColor() is ColorViewModel colorModel)
16 {
17 string hexColor = colorModel.Hex;
18
19 <span class="colorbox-sm" style="background-color: @hexColor" title="@hexColor"></span>
20 }
21 else
22 {
23 @field.Name.Trim()
24 }
25
26 if (isProductDetail && index < total - 1)
27 {
28 @(", ")
29 }
30
31 index++;
32 }
33 </span>
34 else
35 {
36 if (Model.IsLink() && Model.GetLink() is LinkViewModel linkModel)
37 {
38 <span>
39 <a href="@linkModel.Url">@linkModel.Url</a>
40 </span>
41 }
42 else if (Model.IsColor() && Model.GetColor() is ColorViewModel colorModel)
43 {
44 string hexColor = colorModel.Hex;
45
46 <span class="colorbox-sm" style="background-color: @hexColor" title="@hexColor"></span>
47 }
48 else if (Model.IsFile() && Model.GetFile() is FileViewModel fileModel)
49 {
50 var file = fileModel;
51
52 <a href="@file.Path" download>@file.Name</a>
53 }
54 else
55 {
56 var value = hideUnitsOfMeasure ? Model.Value : Model.GetValueWithUnits();
57 value = value.ToString().ToLower() == "true" ? Translate("Yes") : value;
58 value = value.ToString().ToLower() == "false" ? Translate("No") : value;
59
60 <span>@value</span>
61 }
62 }
63 }
64
|
| Catalog Number |
Error compiling template "Designs/Swift/Components/Specifications/Shared/FieldValue.cshtml"
Line 56: 'else' cannot start a statement.
Line 56: Syntax error, '(' expected
Line 56: Invalid expression term 'else'
Line 56: ) expected
Line 56: Invalid expression term 'else'
Line 56: ; expected
Line 48: The name 'total' does not exist in the current context
1 // <auto-generated/>
2 #pragma warning disable 1591
3 namespace CompiledRazorTemplates.Dynamic
4 {
5 #line hidden
6 using System.Threading.Tasks;
7 using System;
8 using System.Collections.Generic;
9 using System.Linq;
10 using Dynamicweb.Frontend;
11 using Dynamicweb.Ecommerce.ProductCatalog;
12 internal class RazorEngine_205e6a1fa4f142f28a4ad3b6d584a50a : Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Ecommerce.ProductCatalog.FieldValueViewModel>
13 {
14 #pragma warning disable 1998
15 public async override global::System.Threading.Tasks.Task ExecuteAsync()
16 {
17 WriteLiteral("\r\n");
18
19 var hideUnitsOfMeasure = false;
20 var index = 0;
21 var isProductDetail = Pageview.CurrentParagraph.Page.NavigationTag == "ProductDetailPage";
22
23 if (Model.Value is List<FieldOptionValueViewModel> listValues)
24 {
25 WriteLiteral("\t<span>\r\n");
26 foreach (var field in listValues)
27 {
28 if (field.IsColor() && field.GetColor() is ColorViewModel colorModel)
29 {
30 string hexColor = colorModel.Hex;
31
32 WriteLiteral(" <span class=\"colorbox-sm\"");
33 BeginWriteAttribute("style", " style=\"", 632, "\"", 667, 2);
34 WriteAttributeValue("", 640, "background-color:", 640, 17, true);
35 WriteAttributeValue(" ", 657, hexColor, 658, 9, false);
36 EndWriteAttribute();
37 BeginWriteAttribute("title", " title=\"", 668, "\"", 685, 1);
38 WriteAttributeValue("", 676, hexColor, 676, 9, false);
39 EndWriteAttribute();
40 WriteLiteral("></span>\r\n");
41 }
42 else
43 {
44 Write(field.Name.Trim());
45
46 }
47
48 if (isProductDetail && index < total - 1)
49 {
50 Write(", ");
51
52 }
53
54 index++;
55 }
56 WriteLiteral(" </span>\r\n");
57 else
58 {
59 if (Model.IsLink() && Model.GetLink() is LinkViewModel linkModel)
60 {
61 WriteLiteral("\t\t\t<span>\r\n\t\t\t\t<a");
62 BeginWriteAttribute("href", " href=\"", 1013, "\"", 1034, 1);
63 WriteAttributeValue("", 1020, linkModel.Url, 1020, 14, false);
64 EndWriteAttribute();
65 WriteLiteral(">");
66 Write(linkModel.Url);
67 WriteLiteral("</a>\r\n\t\t\t</span>\r\n");
68 }
69 else if (Model.IsColor() && Model.GetColor() is ColorViewModel colorModel)
70 {
71 string hexColor = colorModel.Hex;
72
73 WriteLiteral("\t\t\t<span class=\"colorbox-sm\"");
74 BeginWriteAttribute("style", " style=\"", 1224, "\"", 1259, 2);
75 WriteAttributeValue("", 1232, "background-color:", 1232, 17, true);
76 WriteAttributeValue(" ", 1249, hexColor, 1250, 9, false);
77 EndWriteAttribute();
78 BeginWriteAttribute("title", " title=\"", 1260, "\"", 1277, 1);
79 WriteAttributeValue("", 1268, hexColor, 1268, 9, false);
80 EndWriteAttribute();
81 WriteLiteral("></span>\r\n");
82 }
83 else if (Model.IsFile() && Model.GetFile() is FileViewModel fileModel)
84 {
85 var file = fileModel;
86
87 WriteLiteral("\t\t\t<a");
88 BeginWriteAttribute("href", " href=\"", 1405, "\"", 1422, 1);
89 WriteAttributeValue("", 1412, file.Path, 1412, 10, false);
90 EndWriteAttribute();
91 WriteLiteral(" download>");
92 Write(file.Name);
93 WriteLiteral("</a>\r\n");
94 }
95 else
96 {
97 var value = hideUnitsOfMeasure ? Model.Value : Model.GetValueWithUnits();
98 value = value.ToString().ToLower() == "true" ? Translate("Yes") : value;
99 value = value.ToString().ToLower() == "false" ? Translate("No") : value;
100
101 WriteLiteral("\t\t\t<span>");
102 Write(value);
103 WriteLiteral("</span>\r\n");
104 }
105 }
106 }
107 }
108 #pragma warning restore 1998
109 }
110 }
111 #pragma warning restore 1591
112
1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Ecommerce.ProductCatalog.FieldValueViewModel>
2 @using Dynamicweb.Frontend
3 @using Dynamicweb.Ecommerce.ProductCatalog
4
5 @{
6 var hideUnitsOfMeasure = false;
7 var index = 0;
8 var isProductDetail = Pageview.CurrentParagraph.Page.NavigationTag == "ProductDetailPage";
9
10 if (Model.Value is List<FieldOptionValueViewModel> listValues)
11 {
12 <span>
13 @foreach (var field in listValues)
14 {
15 if (field.IsColor() && field.GetColor() is ColorViewModel colorModel)
16 {
17 string hexColor = colorModel.Hex;
18
19 <span class="colorbox-sm" style="background-color: @hexColor" title="@hexColor"></span>
20 }
21 else
22 {
23 @field.Name.Trim()
24 }
25
26 if (isProductDetail && index < total - 1)
27 {
28 @(", ")
29 }
30
31 index++;
32 }
33 </span>
34 else
35 {
36 if (Model.IsLink() && Model.GetLink() is LinkViewModel linkModel)
37 {
38 <span>
39 <a href="@linkModel.Url">@linkModel.Url</a>
40 </span>
41 }
42 else if (Model.IsColor() && Model.GetColor() is ColorViewModel colorModel)
43 {
44 string hexColor = colorModel.Hex;
45
46 <span class="colorbox-sm" style="background-color: @hexColor" title="@hexColor"></span>
47 }
48 else if (Model.IsFile() && Model.GetFile() is FileViewModel fileModel)
49 {
50 var file = fileModel;
51
52 <a href="@file.Path" download>@file.Name</a>
53 }
54 else
55 {
56 var value = hideUnitsOfMeasure ? Model.Value : Model.GetValueWithUnits();
57 value = value.ToString().ToLower() == "true" ? Translate("Yes") : value;
58 value = value.ToString().ToLower() == "false" ? Translate("No") : value;
59
60 <span>@value</span>
61 }
62 }
63 }
64
|