Error compiling template "/Designs/Swift/Grid/Email/RowTemplates/1Column.cshtml"
Line 20: Required member 'ItemViewModel.Id' must be set in the object initializer or attribute constructor.
Line 20: Required member 'ItemViewModel.SystemName' must be set in the object initializer or attribute constructor.
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 internal class RazorEngine_f1a80b4a74374fb988ee629ae4268f37 : Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.GridRowViewModel>
11 {
12 #pragma warning disable 1998
13 public async override global::System.Threading.Tasks.Task ExecuteAsync()
14 {
15 WriteLiteral("\r\n");
16 WriteLiteral("\r\n");
17
18 var pageId = Model.Column(1).Paragraph?.PageID != null ? Model.Column(1).Paragraph.PageID : 0;
19 var parentPage = pageId != 0 ? Dynamicweb.Content.Services.Pages.GetPage(pageId).Parent : null;
20 var settings = parentPage != null ? Dynamicweb.Frontend.ContentViewModelFactory.CreatePageInfoViewModel(parentPage).Item : new Dynamicweb.Frontend.ItemViewModel();
21
22 var rowId = Model.Id;
23
24
25 var emailThemeId = settings.GetRawValueString("EmailTheme");
26 var emailThemeParagraph = emailThemeId != null && emailThemeId != string.Empty ? Dynamicweb.Content.Services.Paragraphs.GetParagraph(Convert.ToInt32(emailThemeId)) : null;
27 var emailTheme = emailThemeParagraph != null && Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(emailThemeParagraph).Item.GetString("CssClassName") != string.Empty ? Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(emailThemeParagraph)?.Item : null;
28
29 var emailContentThemeId = settings.GetRawValueString("EmailContentTheme");
30 var emailContentThemeParagraph = emailContentThemeId != null && emailContentThemeId != string.Empty ? Dynamicweb.Content.Services.Paragraphs.GetParagraph(Convert.ToInt32(emailContentThemeId)) : null;
31 var emailContentTheme = emailContentThemeParagraph != null && Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(emailContentThemeParagraph).Item.GetString("CssClassName") != string.Empty ? Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(emailContentThemeParagraph)?.Item : null;
32
33
34 var rowThemeId = Model.Item.GetRawValueString("RowBackground");
35 var rowThemeParagraph = rowThemeId != null && rowThemeId != string.Empty ? Dynamicweb.Content.Services.Paragraphs.GetParagraph(Convert.ToInt32(rowThemeId)) : null;
36 var rowTheme = rowThemeParagraph != null && Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(rowThemeParagraph).Item.GetString("CssClassName") != string.Empty ? Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(rowThemeParagraph)?.Item : null;
37 string rowBackgroundColor = "background-color:";
38 rowBackgroundColor += rowTheme != null ? rowTheme.GetString("BackgroundColor") + ";" : emailTheme != null ? emailTheme.GetString("BackgroundColor") + ";" : "none;";
39 string rowColor = "color:";
40 rowColor += rowTheme != null ? rowTheme.GetString("ForegroundColor") + ";" : emailTheme != null ? emailTheme.GetString("ForegroundColor") + ";" : "inherit;";
41
42
43 var columnThemeId = Model.Item.GetRawValueString("ColumnBackground", string.Empty);
44 var columnThemeParagraph = columnThemeId != null && columnThemeId != string.Empty ? Dynamicweb.Content.Services.Paragraphs.GetParagraph(Convert.ToInt32(columnThemeId)) : null;
45 var columnTheme = columnThemeParagraph != null && Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(columnThemeParagraph).Item.GetString("CssClassName") != string.Empty ? Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(columnThemeParagraph)?.Item : null;
46 string columnBackgroundColor = "background-color:";
47 columnBackgroundColor += columnTheme != null ? columnTheme.GetString("BackgroundColor") + ";" : emailContentTheme != null ? emailContentTheme.GetString("BackgroundColor") + ";" : "none;";
48 string columnColor = "color:";
49 columnColor += columnTheme != null ? columnTheme.GetString("ForegroundColor") + ";" : emailContentTheme != null ? emailContentTheme.GetString("ForegroundColor") + ";" : "inherit;";
50 WriteLiteral("\r\n<div");
51 BeginWriteAttribute("class", " class=\"", 3850, "\"", 3895, 2);
52 WriteAttributeValue("", 3858, "item_", 3858, 5, true);
53 WriteAttributeValue("", 3863, Model.Item.SystemName.ToLower(), 3863, 32, false);
54 EndWriteAttribute();
55 BeginWriteAttribute("id", " id=\"", 3896, "\"", 3907, 1);
56 WriteAttributeValue("", 3901, rowId, 3901, 6, false);
57 EndWriteAttribute();
58 BeginWriteAttribute("style", " style=\"", 3908, "\"", 3932, 1);
59 WriteAttributeValue("", 3916, GetTableReset(), 3916, 16, false);
60 EndWriteAttribute();
61 WriteLiteral(">\r\n\t<table class=\"row\" align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\"");
62 BeginWriteAttribute("style", " style=\"", 4033, "\"", 4171, 5);
63 WriteAttributeValue("", 4041, "mso-table-lspace:0pt;mso-table-rspace:0pt;mso-line-height-rule:exactly;", 4041, 71, true);
64 WriteAttributeValue("", 4112, GetTableReset(), 4112, 16, false);
65 WriteAttributeValue("", 4128, "width:100%;", 4128, 11, true);
66 WriteAttributeValue("", 4139, rowBackgroundColor, 4139, 21, false);
67 WriteAttributeValue("", 4160, rowColor, 4160, 11, false);
68 EndWriteAttribute();
69 WriteLiteral(" width=\"100%\">\r\n\t\t<tbody>\r\n\t\t\t<tr");
70 BeginWriteAttribute("style", " style=\"", 4205, "\"", 4229, 1);
71 WriteAttributeValue("", 4213, GetTableReset(), 4213, 16, false);
72 EndWriteAttribute();
73 WriteLiteral(">\r\n\t\t\t\t<td");
74 BeginWriteAttribute("style", " style=\"", 4240, "\"", 4264, 1);
75 WriteAttributeValue("", 4248, GetTableReset(), 4248, 16, false);
76 EndWriteAttribute();
77 WriteLiteral(">\r\n\t\t\t\t\t<table class=\"row-content\" align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\"");
78 BeginWriteAttribute("style", " style=\"", 4377, "\"", 4571, 6);
79 WriteAttributeValue("", 4385, "mso-table-lspace:0pt;mso-table-rspace:0pt;mso-line-height-rule:exactly;", 4385, 71, true);
80 WriteAttributeValue("", 4456, GetTableReset(), 4456, 16, false);
81 WriteAttributeValue("", 4472, "color:inherit;width:640px;", 4472, 26, true);
82 WriteAttributeValue("", 4498, columnBackgroundColor, 4498, 24, false);
83 WriteAttributeValue("", 4522, columnColor, 4522, 14, false);
84 WriteAttributeValue("", 4536, "margin-left:auto;margin-right:auto;", 4536, 35, true);
85 EndWriteAttribute();
86 WriteLiteral(" width=\"640\">\r\n\t\t\t\t\t\t<tbody>\r\n\t\t\t\t\t\t\t<tr");
87 BeginWriteAttribute("style", " style=\"", 4612, "\"", 4636, 1);
88 WriteAttributeValue("", 4620, GetTableReset(), 4620, 16, false);
89 EndWriteAttribute();
90 WriteLiteral(">\r\n\t\t\t\t\t\t\t\t<td class=\"column\"");
91 BeginWriteAttribute("style", " style=\"", 4666, "\"", 4812, 4);
92 WriteAttributeValue("", 4674, "mso-table-lspace:0pt;mso-table-rspace:0pt;mso-line-height-rule:exactly;", 4674, 71, true);
93 WriteAttributeValue("", 4745, GetTableReset(), 4745, 16, false);
94 WriteAttributeValue("", 4761, "text-align:left;vertical-align:top;", 4761, 35, true);
95 WriteAttributeValue("", 4796, GetTableReset(), 4796, 16, false);
96 EndWriteAttribute();
97 WriteLiteral(" width=\"100%\">\r\n\t\t\t\t\t\t\t\t\t");
98 Write(Model.Column(1).Output());
99 WriteLiteral("\r\n\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t</tbody>\r\n\t\t\t\t\t</table>\r\n\t\t\t\t</td>\r\n\t\t\t</tr>\r\n\t\t</tbody>\r\n\t</table>\r\n</div>\r\n");
100 }
101 #pragma warning restore 1998
102
103 private string GetTableReset()
104 {
105 return "border-collapse:separate;border-spacing:0;border:0;margin:0;outline:0;padding:0;";
106 }
107 }
108 }
109 #pragma warning restore 1591
110
1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.GridRowViewModel>
2
3 @functions
4 {
5 private string GetTableReset()
6 {
7 return "border-collapse:separate;border-spacing:0;border:0;margin:0;outline:0;padding:0;";
8 }
9 }
10
11 @{
12 var pageId = Model.Column(1).Paragraph?.PageID != null ? Model.Column(1).Paragraph.PageID : 0;
13 var parentPage = pageId != 0 ? Dynamicweb.Content.Services.Pages.GetPage(pageId).Parent : null;
14 var settings = parentPage != null ? Dynamicweb.Frontend.ContentViewModelFactory.CreatePageInfoViewModel(parentPage).Item : new Dynamicweb.Frontend.ItemViewModel();
15
16 var rowId = Model.Id;
17
18 @* The email settings page *@
19 var emailThemeId = settings.GetRawValueString("EmailTheme");
20 var emailThemeParagraph = emailThemeId != null && emailThemeId != string.Empty ? Dynamicweb.Content.Services.Paragraphs.GetParagraph(Convert.ToInt32(emailThemeId)) : null;
21 var emailTheme = emailThemeParagraph != null && Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(emailThemeParagraph).Item.GetString("CssClassName") != string.Empty ? Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(emailThemeParagraph)?.Item : null;
22
23 var emailContentThemeId = settings.GetRawValueString("EmailContentTheme");
24 var emailContentThemeParagraph = emailContentThemeId != null && emailContentThemeId != string.Empty ? Dynamicweb.Content.Services.Paragraphs.GetParagraph(Convert.ToInt32(emailContentThemeId)) : null;
25 var emailContentTheme = emailContentThemeParagraph != null && Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(emailContentThemeParagraph).Item.GetString("CssClassName") != string.Empty ? Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(emailContentThemeParagraph)?.Item : null;
26
27 @* Row theme colors*@
28 var rowThemeId = Model.Item.GetRawValueString("RowBackground");
29 var rowThemeParagraph = rowThemeId != null && rowThemeId != string.Empty ? Dynamicweb.Content.Services.Paragraphs.GetParagraph(Convert.ToInt32(rowThemeId)) : null;
30 var rowTheme = rowThemeParagraph != null && Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(rowThemeParagraph).Item.GetString("CssClassName") != string.Empty ? Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(rowThemeParagraph)?.Item : null;
31 string rowBackgroundColor = "background-color:";
32 rowBackgroundColor += rowTheme != null ? rowTheme.GetString("BackgroundColor") + ";" : emailTheme != null ? emailTheme.GetString("BackgroundColor") + ";" : "none;";
33 string rowColor = "color:";
34 rowColor += rowTheme != null ? rowTheme.GetString("ForegroundColor") + ";" : emailTheme != null ? emailTheme.GetString("ForegroundColor") + ";" : "inherit;";
35
36 @* Column theme colors *@
37 var columnThemeId = Model.Item.GetRawValueString("ColumnBackground", string.Empty);
38 var columnThemeParagraph = columnThemeId != null && columnThemeId != string.Empty ? Dynamicweb.Content.Services.Paragraphs.GetParagraph(Convert.ToInt32(columnThemeId)) : null;
39 var columnTheme = columnThemeParagraph != null && Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(columnThemeParagraph).Item.GetString("CssClassName") != string.Empty ? Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(columnThemeParagraph)?.Item : null;
40 string columnBackgroundColor = "background-color:";
41 columnBackgroundColor += columnTheme != null ? columnTheme.GetString("BackgroundColor") + ";" : emailContentTheme != null ? emailContentTheme.GetString("BackgroundColor") + ";" : "none;";
42 string columnColor = "color:";
43 columnColor += columnTheme != null ? columnTheme.GetString("ForegroundColor") + ";" : emailContentTheme != null ? emailContentTheme.GetString("ForegroundColor") + ";" : "inherit;";
44 }
45
46 <div class="item_@Model.Item.SystemName.ToLower()" id="@rowId" style="@GetTableReset()">
47 <table class="row" align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="mso-table-lspace:0pt;mso-table-rspace:0pt;mso-line-height-rule:exactly;@GetTableReset()width:100%;@(rowBackgroundColor)@(rowColor)" width="100%">
48 <tbody>
49 <tr style="@GetTableReset()">
50 <td style="@GetTableReset()">
51 <table class="row-content" align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="mso-table-lspace:0pt;mso-table-rspace:0pt;mso-line-height-rule:exactly;@GetTableReset()color:inherit;width:640px;@(columnBackgroundColor)@(columnColor)margin-left:auto;margin-right:auto;" width="640">
52 <tbody>
53 <tr style="@GetTableReset()">
54 <td class="column" style="mso-table-lspace:0pt;mso-table-rspace:0pt;mso-line-height-rule:exactly;@GetTableReset()text-align:left;vertical-align:top;@GetTableReset()" width="100%">
55 @Model.Column(1).Output()
56 </td>
57 </tr>
58 </tbody>
59 </table>
60 </td>
61 </tr>
62 </tbody>
63 </table>
64 </div>
65
Error compiling template "/Designs/Swift/Grid/Email/RowTemplates/1Column.cshtml"
Line 20: Required member 'ItemViewModel.Id' must be set in the object initializer or attribute constructor.
Line 20: Required member 'ItemViewModel.SystemName' must be set in the object initializer or attribute constructor.
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 internal class RazorEngine_814d5b9c0a334931b7c4a61a444b2ec2 : Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.GridRowViewModel>
11 {
12 #pragma warning disable 1998
13 public async override global::System.Threading.Tasks.Task ExecuteAsync()
14 {
15 WriteLiteral("\r\n");
16 WriteLiteral("\r\n");
17
18 var pageId = Model.Column(1).Paragraph?.PageID != null ? Model.Column(1).Paragraph.PageID : 0;
19 var parentPage = pageId != 0 ? Dynamicweb.Content.Services.Pages.GetPage(pageId).Parent : null;
20 var settings = parentPage != null ? Dynamicweb.Frontend.ContentViewModelFactory.CreatePageInfoViewModel(parentPage).Item : new Dynamicweb.Frontend.ItemViewModel();
21
22 var rowId = Model.Id;
23
24
25 var emailThemeId = settings.GetRawValueString("EmailTheme");
26 var emailThemeParagraph = emailThemeId != null && emailThemeId != string.Empty ? Dynamicweb.Content.Services.Paragraphs.GetParagraph(Convert.ToInt32(emailThemeId)) : null;
27 var emailTheme = emailThemeParagraph != null && Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(emailThemeParagraph).Item.GetString("CssClassName") != string.Empty ? Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(emailThemeParagraph)?.Item : null;
28
29 var emailContentThemeId = settings.GetRawValueString("EmailContentTheme");
30 var emailContentThemeParagraph = emailContentThemeId != null && emailContentThemeId != string.Empty ? Dynamicweb.Content.Services.Paragraphs.GetParagraph(Convert.ToInt32(emailContentThemeId)) : null;
31 var emailContentTheme = emailContentThemeParagraph != null && Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(emailContentThemeParagraph).Item.GetString("CssClassName") != string.Empty ? Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(emailContentThemeParagraph)?.Item : null;
32
33
34 var rowThemeId = Model.Item.GetRawValueString("RowBackground");
35 var rowThemeParagraph = rowThemeId != null && rowThemeId != string.Empty ? Dynamicweb.Content.Services.Paragraphs.GetParagraph(Convert.ToInt32(rowThemeId)) : null;
36 var rowTheme = rowThemeParagraph != null && Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(rowThemeParagraph).Item.GetString("CssClassName") != string.Empty ? Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(rowThemeParagraph)?.Item : null;
37 string rowBackgroundColor = "background-color:";
38 rowBackgroundColor += rowTheme != null ? rowTheme.GetString("BackgroundColor") + ";" : emailTheme != null ? emailTheme.GetString("BackgroundColor") + ";" : "none;";
39 string rowColor = "color:";
40 rowColor += rowTheme != null ? rowTheme.GetString("ForegroundColor") + ";" : emailTheme != null ? emailTheme.GetString("ForegroundColor") + ";" : "inherit;";
41
42
43 var columnThemeId = Model.Item.GetRawValueString("ColumnBackground", string.Empty);
44 var columnThemeParagraph = columnThemeId != null && columnThemeId != string.Empty ? Dynamicweb.Content.Services.Paragraphs.GetParagraph(Convert.ToInt32(columnThemeId)) : null;
45 var columnTheme = columnThemeParagraph != null && Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(columnThemeParagraph).Item.GetString("CssClassName") != string.Empty ? Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(columnThemeParagraph)?.Item : null;
46 string columnBackgroundColor = "background-color:";
47 columnBackgroundColor += columnTheme != null ? columnTheme.GetString("BackgroundColor") + ";" : emailContentTheme != null ? emailContentTheme.GetString("BackgroundColor") + ";" : "none;";
48 string columnColor = "color:";
49 columnColor += columnTheme != null ? columnTheme.GetString("ForegroundColor") + ";" : emailContentTheme != null ? emailContentTheme.GetString("ForegroundColor") + ";" : "inherit;";
50 WriteLiteral("\r\n<div");
51 BeginWriteAttribute("class", " class=\"", 3850, "\"", 3895, 2);
52 WriteAttributeValue("", 3858, "item_", 3858, 5, true);
53 WriteAttributeValue("", 3863, Model.Item.SystemName.ToLower(), 3863, 32, false);
54 EndWriteAttribute();
55 BeginWriteAttribute("id", " id=\"", 3896, "\"", 3907, 1);
56 WriteAttributeValue("", 3901, rowId, 3901, 6, false);
57 EndWriteAttribute();
58 BeginWriteAttribute("style", " style=\"", 3908, "\"", 3932, 1);
59 WriteAttributeValue("", 3916, GetTableReset(), 3916, 16, false);
60 EndWriteAttribute();
61 WriteLiteral(">\r\n\t<table class=\"row\" align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\"");
62 BeginWriteAttribute("style", " style=\"", 4033, "\"", 4171, 5);
63 WriteAttributeValue("", 4041, "mso-table-lspace:0pt;mso-table-rspace:0pt;mso-line-height-rule:exactly;", 4041, 71, true);
64 WriteAttributeValue("", 4112, GetTableReset(), 4112, 16, false);
65 WriteAttributeValue("", 4128, "width:100%;", 4128, 11, true);
66 WriteAttributeValue("", 4139, rowBackgroundColor, 4139, 21, false);
67 WriteAttributeValue("", 4160, rowColor, 4160, 11, false);
68 EndWriteAttribute();
69 WriteLiteral(" width=\"100%\">\r\n\t\t<tbody>\r\n\t\t\t<tr");
70 BeginWriteAttribute("style", " style=\"", 4205, "\"", 4229, 1);
71 WriteAttributeValue("", 4213, GetTableReset(), 4213, 16, false);
72 EndWriteAttribute();
73 WriteLiteral(">\r\n\t\t\t\t<td");
74 BeginWriteAttribute("style", " style=\"", 4240, "\"", 4264, 1);
75 WriteAttributeValue("", 4248, GetTableReset(), 4248, 16, false);
76 EndWriteAttribute();
77 WriteLiteral(">\r\n\t\t\t\t\t<table class=\"row-content\" align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\"");
78 BeginWriteAttribute("style", " style=\"", 4377, "\"", 4571, 6);
79 WriteAttributeValue("", 4385, "mso-table-lspace:0pt;mso-table-rspace:0pt;mso-line-height-rule:exactly;", 4385, 71, true);
80 WriteAttributeValue("", 4456, GetTableReset(), 4456, 16, false);
81 WriteAttributeValue("", 4472, "color:inherit;width:640px;", 4472, 26, true);
82 WriteAttributeValue("", 4498, columnBackgroundColor, 4498, 24, false);
83 WriteAttributeValue("", 4522, columnColor, 4522, 14, false);
84 WriteAttributeValue("", 4536, "margin-left:auto;margin-right:auto;", 4536, 35, true);
85 EndWriteAttribute();
86 WriteLiteral(" width=\"640\">\r\n\t\t\t\t\t\t<tbody>\r\n\t\t\t\t\t\t\t<tr");
87 BeginWriteAttribute("style", " style=\"", 4612, "\"", 4636, 1);
88 WriteAttributeValue("", 4620, GetTableReset(), 4620, 16, false);
89 EndWriteAttribute();
90 WriteLiteral(">\r\n\t\t\t\t\t\t\t\t<td class=\"column\"");
91 BeginWriteAttribute("style", " style=\"", 4666, "\"", 4812, 4);
92 WriteAttributeValue("", 4674, "mso-table-lspace:0pt;mso-table-rspace:0pt;mso-line-height-rule:exactly;", 4674, 71, true);
93 WriteAttributeValue("", 4745, GetTableReset(), 4745, 16, false);
94 WriteAttributeValue("", 4761, "text-align:left;vertical-align:top;", 4761, 35, true);
95 WriteAttributeValue("", 4796, GetTableReset(), 4796, 16, false);
96 EndWriteAttribute();
97 WriteLiteral(" width=\"100%\">\r\n\t\t\t\t\t\t\t\t\t");
98 Write(Model.Column(1).Output());
99 WriteLiteral("\r\n\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t</tbody>\r\n\t\t\t\t\t</table>\r\n\t\t\t\t</td>\r\n\t\t\t</tr>\r\n\t\t</tbody>\r\n\t</table>\r\n</div>\r\n");
100 }
101 #pragma warning restore 1998
102
103 private string GetTableReset()
104 {
105 return "border-collapse:separate;border-spacing:0;border:0;margin:0;outline:0;padding:0;";
106 }
107 }
108 }
109 #pragma warning restore 1591
110
1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.GridRowViewModel>
2
3 @functions
4 {
5 private string GetTableReset()
6 {
7 return "border-collapse:separate;border-spacing:0;border:0;margin:0;outline:0;padding:0;";
8 }
9 }
10
11 @{
12 var pageId = Model.Column(1).Paragraph?.PageID != null ? Model.Column(1).Paragraph.PageID : 0;
13 var parentPage = pageId != 0 ? Dynamicweb.Content.Services.Pages.GetPage(pageId).Parent : null;
14 var settings = parentPage != null ? Dynamicweb.Frontend.ContentViewModelFactory.CreatePageInfoViewModel(parentPage).Item : new Dynamicweb.Frontend.ItemViewModel();
15
16 var rowId = Model.Id;
17
18 @* The email settings page *@
19 var emailThemeId = settings.GetRawValueString("EmailTheme");
20 var emailThemeParagraph = emailThemeId != null && emailThemeId != string.Empty ? Dynamicweb.Content.Services.Paragraphs.GetParagraph(Convert.ToInt32(emailThemeId)) : null;
21 var emailTheme = emailThemeParagraph != null && Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(emailThemeParagraph).Item.GetString("CssClassName") != string.Empty ? Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(emailThemeParagraph)?.Item : null;
22
23 var emailContentThemeId = settings.GetRawValueString("EmailContentTheme");
24 var emailContentThemeParagraph = emailContentThemeId != null && emailContentThemeId != string.Empty ? Dynamicweb.Content.Services.Paragraphs.GetParagraph(Convert.ToInt32(emailContentThemeId)) : null;
25 var emailContentTheme = emailContentThemeParagraph != null && Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(emailContentThemeParagraph).Item.GetString("CssClassName") != string.Empty ? Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(emailContentThemeParagraph)?.Item : null;
26
27 @* Row theme colors*@
28 var rowThemeId = Model.Item.GetRawValueString("RowBackground");
29 var rowThemeParagraph = rowThemeId != null && rowThemeId != string.Empty ? Dynamicweb.Content.Services.Paragraphs.GetParagraph(Convert.ToInt32(rowThemeId)) : null;
30 var rowTheme = rowThemeParagraph != null && Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(rowThemeParagraph).Item.GetString("CssClassName") != string.Empty ? Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(rowThemeParagraph)?.Item : null;
31 string rowBackgroundColor = "background-color:";
32 rowBackgroundColor += rowTheme != null ? rowTheme.GetString("BackgroundColor") + ";" : emailTheme != null ? emailTheme.GetString("BackgroundColor") + ";" : "none;";
33 string rowColor = "color:";
34 rowColor += rowTheme != null ? rowTheme.GetString("ForegroundColor") + ";" : emailTheme != null ? emailTheme.GetString("ForegroundColor") + ";" : "inherit;";
35
36 @* Column theme colors *@
37 var columnThemeId = Model.Item.GetRawValueString("ColumnBackground", string.Empty);
38 var columnThemeParagraph = columnThemeId != null && columnThemeId != string.Empty ? Dynamicweb.Content.Services.Paragraphs.GetParagraph(Convert.ToInt32(columnThemeId)) : null;
39 var columnTheme = columnThemeParagraph != null && Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(columnThemeParagraph).Item.GetString("CssClassName") != string.Empty ? Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(columnThemeParagraph)?.Item : null;
40 string columnBackgroundColor = "background-color:";
41 columnBackgroundColor += columnTheme != null ? columnTheme.GetString("BackgroundColor") + ";" : emailContentTheme != null ? emailContentTheme.GetString("BackgroundColor") + ";" : "none;";
42 string columnColor = "color:";
43 columnColor += columnTheme != null ? columnTheme.GetString("ForegroundColor") + ";" : emailContentTheme != null ? emailContentTheme.GetString("ForegroundColor") + ";" : "inherit;";
44 }
45
46 <div class="item_@Model.Item.SystemName.ToLower()" id="@rowId" style="@GetTableReset()">
47 <table class="row" align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="mso-table-lspace:0pt;mso-table-rspace:0pt;mso-line-height-rule:exactly;@GetTableReset()width:100%;@(rowBackgroundColor)@(rowColor)" width="100%">
48 <tbody>
49 <tr style="@GetTableReset()">
50 <td style="@GetTableReset()">
51 <table class="row-content" align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="mso-table-lspace:0pt;mso-table-rspace:0pt;mso-line-height-rule:exactly;@GetTableReset()color:inherit;width:640px;@(columnBackgroundColor)@(columnColor)margin-left:auto;margin-right:auto;" width="640">
52 <tbody>
53 <tr style="@GetTableReset()">
54 <td class="column" style="mso-table-lspace:0pt;mso-table-rspace:0pt;mso-line-height-rule:exactly;@GetTableReset()text-align:left;vertical-align:top;@GetTableReset()" width="100%">
55 @Model.Column(1).Output()
56 </td>
57 </tr>
58 </tbody>
59 </table>
60 </td>
61 </tr>
62 </tbody>
63 </table>
64 </div>
65
Error compiling template "/Designs/Swift/Grid/Email/RowTemplates/1Column.cshtml"
Line 20: Required member 'ItemViewModel.Id' must be set in the object initializer or attribute constructor.
Line 20: Required member 'ItemViewModel.SystemName' must be set in the object initializer or attribute constructor.
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 internal class RazorEngine_9a33c886f7914e45b18a7ddcaddbdfd6 : Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.GridRowViewModel>
11 {
12 #pragma warning disable 1998
13 public async override global::System.Threading.Tasks.Task ExecuteAsync()
14 {
15 WriteLiteral("\r\n");
16 WriteLiteral("\r\n");
17
18 var pageId = Model.Column(1).Paragraph?.PageID != null ? Model.Column(1).Paragraph.PageID : 0;
19 var parentPage = pageId != 0 ? Dynamicweb.Content.Services.Pages.GetPage(pageId).Parent : null;
20 var settings = parentPage != null ? Dynamicweb.Frontend.ContentViewModelFactory.CreatePageInfoViewModel(parentPage).Item : new Dynamicweb.Frontend.ItemViewModel();
21
22 var rowId = Model.Id;
23
24
25 var emailThemeId = settings.GetRawValueString("EmailTheme");
26 var emailThemeParagraph = emailThemeId != null && emailThemeId != string.Empty ? Dynamicweb.Content.Services.Paragraphs.GetParagraph(Convert.ToInt32(emailThemeId)) : null;
27 var emailTheme = emailThemeParagraph != null && Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(emailThemeParagraph).Item.GetString("CssClassName") != string.Empty ? Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(emailThemeParagraph)?.Item : null;
28
29 var emailContentThemeId = settings.GetRawValueString("EmailContentTheme");
30 var emailContentThemeParagraph = emailContentThemeId != null && emailContentThemeId != string.Empty ? Dynamicweb.Content.Services.Paragraphs.GetParagraph(Convert.ToInt32(emailContentThemeId)) : null;
31 var emailContentTheme = emailContentThemeParagraph != null && Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(emailContentThemeParagraph).Item.GetString("CssClassName") != string.Empty ? Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(emailContentThemeParagraph)?.Item : null;
32
33
34 var rowThemeId = Model.Item.GetRawValueString("RowBackground");
35 var rowThemeParagraph = rowThemeId != null && rowThemeId != string.Empty ? Dynamicweb.Content.Services.Paragraphs.GetParagraph(Convert.ToInt32(rowThemeId)) : null;
36 var rowTheme = rowThemeParagraph != null && Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(rowThemeParagraph).Item.GetString("CssClassName") != string.Empty ? Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(rowThemeParagraph)?.Item : null;
37 string rowBackgroundColor = "background-color:";
38 rowBackgroundColor += rowTheme != null ? rowTheme.GetString("BackgroundColor") + ";" : emailTheme != null ? emailTheme.GetString("BackgroundColor") + ";" : "none;";
39 string rowColor = "color:";
40 rowColor += rowTheme != null ? rowTheme.GetString("ForegroundColor") + ";" : emailTheme != null ? emailTheme.GetString("ForegroundColor") + ";" : "inherit;";
41
42
43 var columnThemeId = Model.Item.GetRawValueString("ColumnBackground", string.Empty);
44 var columnThemeParagraph = columnThemeId != null && columnThemeId != string.Empty ? Dynamicweb.Content.Services.Paragraphs.GetParagraph(Convert.ToInt32(columnThemeId)) : null;
45 var columnTheme = columnThemeParagraph != null && Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(columnThemeParagraph).Item.GetString("CssClassName") != string.Empty ? Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(columnThemeParagraph)?.Item : null;
46 string columnBackgroundColor = "background-color:";
47 columnBackgroundColor += columnTheme != null ? columnTheme.GetString("BackgroundColor") + ";" : emailContentTheme != null ? emailContentTheme.GetString("BackgroundColor") + ";" : "none;";
48 string columnColor = "color:";
49 columnColor += columnTheme != null ? columnTheme.GetString("ForegroundColor") + ";" : emailContentTheme != null ? emailContentTheme.GetString("ForegroundColor") + ";" : "inherit;";
50 WriteLiteral("\r\n<div");
51 BeginWriteAttribute("class", " class=\"", 3850, "\"", 3895, 2);
52 WriteAttributeValue("", 3858, "item_", 3858, 5, true);
53 WriteAttributeValue("", 3863, Model.Item.SystemName.ToLower(), 3863, 32, false);
54 EndWriteAttribute();
55 BeginWriteAttribute("id", " id=\"", 3896, "\"", 3907, 1);
56 WriteAttributeValue("", 3901, rowId, 3901, 6, false);
57 EndWriteAttribute();
58 BeginWriteAttribute("style", " style=\"", 3908, "\"", 3932, 1);
59 WriteAttributeValue("", 3916, GetTableReset(), 3916, 16, false);
60 EndWriteAttribute();
61 WriteLiteral(">\r\n\t<table class=\"row\" align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\"");
62 BeginWriteAttribute("style", " style=\"", 4033, "\"", 4171, 5);
63 WriteAttributeValue("", 4041, "mso-table-lspace:0pt;mso-table-rspace:0pt;mso-line-height-rule:exactly;", 4041, 71, true);
64 WriteAttributeValue("", 4112, GetTableReset(), 4112, 16, false);
65 WriteAttributeValue("", 4128, "width:100%;", 4128, 11, true);
66 WriteAttributeValue("", 4139, rowBackgroundColor, 4139, 21, false);
67 WriteAttributeValue("", 4160, rowColor, 4160, 11, false);
68 EndWriteAttribute();
69 WriteLiteral(" width=\"100%\">\r\n\t\t<tbody>\r\n\t\t\t<tr");
70 BeginWriteAttribute("style", " style=\"", 4205, "\"", 4229, 1);
71 WriteAttributeValue("", 4213, GetTableReset(), 4213, 16, false);
72 EndWriteAttribute();
73 WriteLiteral(">\r\n\t\t\t\t<td");
74 BeginWriteAttribute("style", " style=\"", 4240, "\"", 4264, 1);
75 WriteAttributeValue("", 4248, GetTableReset(), 4248, 16, false);
76 EndWriteAttribute();
77 WriteLiteral(">\r\n\t\t\t\t\t<table class=\"row-content\" align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\"");
78 BeginWriteAttribute("style", " style=\"", 4377, "\"", 4571, 6);
79 WriteAttributeValue("", 4385, "mso-table-lspace:0pt;mso-table-rspace:0pt;mso-line-height-rule:exactly;", 4385, 71, true);
80 WriteAttributeValue("", 4456, GetTableReset(), 4456, 16, false);
81 WriteAttributeValue("", 4472, "color:inherit;width:640px;", 4472, 26, true);
82 WriteAttributeValue("", 4498, columnBackgroundColor, 4498, 24, false);
83 WriteAttributeValue("", 4522, columnColor, 4522, 14, false);
84 WriteAttributeValue("", 4536, "margin-left:auto;margin-right:auto;", 4536, 35, true);
85 EndWriteAttribute();
86 WriteLiteral(" width=\"640\">\r\n\t\t\t\t\t\t<tbody>\r\n\t\t\t\t\t\t\t<tr");
87 BeginWriteAttribute("style", " style=\"", 4612, "\"", 4636, 1);
88 WriteAttributeValue("", 4620, GetTableReset(), 4620, 16, false);
89 EndWriteAttribute();
90 WriteLiteral(">\r\n\t\t\t\t\t\t\t\t<td class=\"column\"");
91 BeginWriteAttribute("style", " style=\"", 4666, "\"", 4812, 4);
92 WriteAttributeValue("", 4674, "mso-table-lspace:0pt;mso-table-rspace:0pt;mso-line-height-rule:exactly;", 4674, 71, true);
93 WriteAttributeValue("", 4745, GetTableReset(), 4745, 16, false);
94 WriteAttributeValue("", 4761, "text-align:left;vertical-align:top;", 4761, 35, true);
95 WriteAttributeValue("", 4796, GetTableReset(), 4796, 16, false);
96 EndWriteAttribute();
97 WriteLiteral(" width=\"100%\">\r\n\t\t\t\t\t\t\t\t\t");
98 Write(Model.Column(1).Output());
99 WriteLiteral("\r\n\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t</tbody>\r\n\t\t\t\t\t</table>\r\n\t\t\t\t</td>\r\n\t\t\t</tr>\r\n\t\t</tbody>\r\n\t</table>\r\n</div>\r\n");
100 }
101 #pragma warning restore 1998
102
103 private string GetTableReset()
104 {
105 return "border-collapse:separate;border-spacing:0;border:0;margin:0;outline:0;padding:0;";
106 }
107 }
108 }
109 #pragma warning restore 1591
110
1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.GridRowViewModel>
2
3 @functions
4 {
5 private string GetTableReset()
6 {
7 return "border-collapse:separate;border-spacing:0;border:0;margin:0;outline:0;padding:0;";
8 }
9 }
10
11 @{
12 var pageId = Model.Column(1).Paragraph?.PageID != null ? Model.Column(1).Paragraph.PageID : 0;
13 var parentPage = pageId != 0 ? Dynamicweb.Content.Services.Pages.GetPage(pageId).Parent : null;
14 var settings = parentPage != null ? Dynamicweb.Frontend.ContentViewModelFactory.CreatePageInfoViewModel(parentPage).Item : new Dynamicweb.Frontend.ItemViewModel();
15
16 var rowId = Model.Id;
17
18 @* The email settings page *@
19 var emailThemeId = settings.GetRawValueString("EmailTheme");
20 var emailThemeParagraph = emailThemeId != null && emailThemeId != string.Empty ? Dynamicweb.Content.Services.Paragraphs.GetParagraph(Convert.ToInt32(emailThemeId)) : null;
21 var emailTheme = emailThemeParagraph != null && Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(emailThemeParagraph).Item.GetString("CssClassName") != string.Empty ? Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(emailThemeParagraph)?.Item : null;
22
23 var emailContentThemeId = settings.GetRawValueString("EmailContentTheme");
24 var emailContentThemeParagraph = emailContentThemeId != null && emailContentThemeId != string.Empty ? Dynamicweb.Content.Services.Paragraphs.GetParagraph(Convert.ToInt32(emailContentThemeId)) : null;
25 var emailContentTheme = emailContentThemeParagraph != null && Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(emailContentThemeParagraph).Item.GetString("CssClassName") != string.Empty ? Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(emailContentThemeParagraph)?.Item : null;
26
27 @* Row theme colors*@
28 var rowThemeId = Model.Item.GetRawValueString("RowBackground");
29 var rowThemeParagraph = rowThemeId != null && rowThemeId != string.Empty ? Dynamicweb.Content.Services.Paragraphs.GetParagraph(Convert.ToInt32(rowThemeId)) : null;
30 var rowTheme = rowThemeParagraph != null && Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(rowThemeParagraph).Item.GetString("CssClassName") != string.Empty ? Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(rowThemeParagraph)?.Item : null;
31 string rowBackgroundColor = "background-color:";
32 rowBackgroundColor += rowTheme != null ? rowTheme.GetString("BackgroundColor") + ";" : emailTheme != null ? emailTheme.GetString("BackgroundColor") + ";" : "none;";
33 string rowColor = "color:";
34 rowColor += rowTheme != null ? rowTheme.GetString("ForegroundColor") + ";" : emailTheme != null ? emailTheme.GetString("ForegroundColor") + ";" : "inherit;";
35
36 @* Column theme colors *@
37 var columnThemeId = Model.Item.GetRawValueString("ColumnBackground", string.Empty);
38 var columnThemeParagraph = columnThemeId != null && columnThemeId != string.Empty ? Dynamicweb.Content.Services.Paragraphs.GetParagraph(Convert.ToInt32(columnThemeId)) : null;
39 var columnTheme = columnThemeParagraph != null && Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(columnThemeParagraph).Item.GetString("CssClassName") != string.Empty ? Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(columnThemeParagraph)?.Item : null;
40 string columnBackgroundColor = "background-color:";
41 columnBackgroundColor += columnTheme != null ? columnTheme.GetString("BackgroundColor") + ";" : emailContentTheme != null ? emailContentTheme.GetString("BackgroundColor") + ";" : "none;";
42 string columnColor = "color:";
43 columnColor += columnTheme != null ? columnTheme.GetString("ForegroundColor") + ";" : emailContentTheme != null ? emailContentTheme.GetString("ForegroundColor") + ";" : "inherit;";
44 }
45
46 <div class="item_@Model.Item.SystemName.ToLower()" id="@rowId" style="@GetTableReset()">
47 <table class="row" align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="mso-table-lspace:0pt;mso-table-rspace:0pt;mso-line-height-rule:exactly;@GetTableReset()width:100%;@(rowBackgroundColor)@(rowColor)" width="100%">
48 <tbody>
49 <tr style="@GetTableReset()">
50 <td style="@GetTableReset()">
51 <table class="row-content" align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="mso-table-lspace:0pt;mso-table-rspace:0pt;mso-line-height-rule:exactly;@GetTableReset()color:inherit;width:640px;@(columnBackgroundColor)@(columnColor)margin-left:auto;margin-right:auto;" width="640">
52 <tbody>
53 <tr style="@GetTableReset()">
54 <td class="column" style="mso-table-lspace:0pt;mso-table-rspace:0pt;mso-line-height-rule:exactly;@GetTableReset()text-align:left;vertical-align:top;@GetTableReset()" width="100%">
55 @Model.Column(1).Output()
56 </td>
57 </tr>
58 </tbody>
59 </table>
60 </td>
61 </tr>
62 </tbody>
63 </table>
64 </div>
65
Error compiling template "/Designs/Swift/Grid/Email/RowTemplates/1Column.cshtml"
Line 20: Required member 'ItemViewModel.Id' must be set in the object initializer or attribute constructor.
Line 20: Required member 'ItemViewModel.SystemName' must be set in the object initializer or attribute constructor.
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 internal class RazorEngine_d1e4eb271d4f49b1a6f4c7c1a8d479b7 : Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.GridRowViewModel>
11 {
12 #pragma warning disable 1998
13 public async override global::System.Threading.Tasks.Task ExecuteAsync()
14 {
15 WriteLiteral("\r\n");
16 WriteLiteral("\r\n");
17
18 var pageId = Model.Column(1).Paragraph?.PageID != null ? Model.Column(1).Paragraph.PageID : 0;
19 var parentPage = pageId != 0 ? Dynamicweb.Content.Services.Pages.GetPage(pageId).Parent : null;
20 var settings = parentPage != null ? Dynamicweb.Frontend.ContentViewModelFactory.CreatePageInfoViewModel(parentPage).Item : new Dynamicweb.Frontend.ItemViewModel();
21
22 var rowId = Model.Id;
23
24
25 var emailThemeId = settings.GetRawValueString("EmailTheme");
26 var emailThemeParagraph = emailThemeId != null && emailThemeId != string.Empty ? Dynamicweb.Content.Services.Paragraphs.GetParagraph(Convert.ToInt32(emailThemeId)) : null;
27 var emailTheme = emailThemeParagraph != null && Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(emailThemeParagraph).Item.GetString("CssClassName") != string.Empty ? Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(emailThemeParagraph)?.Item : null;
28
29 var emailContentThemeId = settings.GetRawValueString("EmailContentTheme");
30 var emailContentThemeParagraph = emailContentThemeId != null && emailContentThemeId != string.Empty ? Dynamicweb.Content.Services.Paragraphs.GetParagraph(Convert.ToInt32(emailContentThemeId)) : null;
31 var emailContentTheme = emailContentThemeParagraph != null && Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(emailContentThemeParagraph).Item.GetString("CssClassName") != string.Empty ? Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(emailContentThemeParagraph)?.Item : null;
32
33
34 var rowThemeId = Model.Item.GetRawValueString("RowBackground");
35 var rowThemeParagraph = rowThemeId != null && rowThemeId != string.Empty ? Dynamicweb.Content.Services.Paragraphs.GetParagraph(Convert.ToInt32(rowThemeId)) : null;
36 var rowTheme = rowThemeParagraph != null && Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(rowThemeParagraph).Item.GetString("CssClassName") != string.Empty ? Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(rowThemeParagraph)?.Item : null;
37 string rowBackgroundColor = "background-color:";
38 rowBackgroundColor += rowTheme != null ? rowTheme.GetString("BackgroundColor") + ";" : emailTheme != null ? emailTheme.GetString("BackgroundColor") + ";" : "none;";
39 string rowColor = "color:";
40 rowColor += rowTheme != null ? rowTheme.GetString("ForegroundColor") + ";" : emailTheme != null ? emailTheme.GetString("ForegroundColor") + ";" : "inherit;";
41
42
43 var columnThemeId = Model.Item.GetRawValueString("ColumnBackground", string.Empty);
44 var columnThemeParagraph = columnThemeId != null && columnThemeId != string.Empty ? Dynamicweb.Content.Services.Paragraphs.GetParagraph(Convert.ToInt32(columnThemeId)) : null;
45 var columnTheme = columnThemeParagraph != null && Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(columnThemeParagraph).Item.GetString("CssClassName") != string.Empty ? Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(columnThemeParagraph)?.Item : null;
46 string columnBackgroundColor = "background-color:";
47 columnBackgroundColor += columnTheme != null ? columnTheme.GetString("BackgroundColor") + ";" : emailContentTheme != null ? emailContentTheme.GetString("BackgroundColor") + ";" : "none;";
48 string columnColor = "color:";
49 columnColor += columnTheme != null ? columnTheme.GetString("ForegroundColor") + ";" : emailContentTheme != null ? emailContentTheme.GetString("ForegroundColor") + ";" : "inherit;";
50 WriteLiteral("\r\n<div");
51 BeginWriteAttribute("class", " class=\"", 3850, "\"", 3895, 2);
52 WriteAttributeValue("", 3858, "item_", 3858, 5, true);
53 WriteAttributeValue("", 3863, Model.Item.SystemName.ToLower(), 3863, 32, false);
54 EndWriteAttribute();
55 BeginWriteAttribute("id", " id=\"", 3896, "\"", 3907, 1);
56 WriteAttributeValue("", 3901, rowId, 3901, 6, false);
57 EndWriteAttribute();
58 BeginWriteAttribute("style", " style=\"", 3908, "\"", 3932, 1);
59 WriteAttributeValue("", 3916, GetTableReset(), 3916, 16, false);
60 EndWriteAttribute();
61 WriteLiteral(">\r\n\t<table class=\"row\" align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\"");
62 BeginWriteAttribute("style", " style=\"", 4033, "\"", 4171, 5);
63 WriteAttributeValue("", 4041, "mso-table-lspace:0pt;mso-table-rspace:0pt;mso-line-height-rule:exactly;", 4041, 71, true);
64 WriteAttributeValue("", 4112, GetTableReset(), 4112, 16, false);
65 WriteAttributeValue("", 4128, "width:100%;", 4128, 11, true);
66 WriteAttributeValue("", 4139, rowBackgroundColor, 4139, 21, false);
67 WriteAttributeValue("", 4160, rowColor, 4160, 11, false);
68 EndWriteAttribute();
69 WriteLiteral(" width=\"100%\">\r\n\t\t<tbody>\r\n\t\t\t<tr");
70 BeginWriteAttribute("style", " style=\"", 4205, "\"", 4229, 1);
71 WriteAttributeValue("", 4213, GetTableReset(), 4213, 16, false);
72 EndWriteAttribute();
73 WriteLiteral(">\r\n\t\t\t\t<td");
74 BeginWriteAttribute("style", " style=\"", 4240, "\"", 4264, 1);
75 WriteAttributeValue("", 4248, GetTableReset(), 4248, 16, false);
76 EndWriteAttribute();
77 WriteLiteral(">\r\n\t\t\t\t\t<table class=\"row-content\" align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\"");
78 BeginWriteAttribute("style", " style=\"", 4377, "\"", 4571, 6);
79 WriteAttributeValue("", 4385, "mso-table-lspace:0pt;mso-table-rspace:0pt;mso-line-height-rule:exactly;", 4385, 71, true);
80 WriteAttributeValue("", 4456, GetTableReset(), 4456, 16, false);
81 WriteAttributeValue("", 4472, "color:inherit;width:640px;", 4472, 26, true);
82 WriteAttributeValue("", 4498, columnBackgroundColor, 4498, 24, false);
83 WriteAttributeValue("", 4522, columnColor, 4522, 14, false);
84 WriteAttributeValue("", 4536, "margin-left:auto;margin-right:auto;", 4536, 35, true);
85 EndWriteAttribute();
86 WriteLiteral(" width=\"640\">\r\n\t\t\t\t\t\t<tbody>\r\n\t\t\t\t\t\t\t<tr");
87 BeginWriteAttribute("style", " style=\"", 4612, "\"", 4636, 1);
88 WriteAttributeValue("", 4620, GetTableReset(), 4620, 16, false);
89 EndWriteAttribute();
90 WriteLiteral(">\r\n\t\t\t\t\t\t\t\t<td class=\"column\"");
91 BeginWriteAttribute("style", " style=\"", 4666, "\"", 4812, 4);
92 WriteAttributeValue("", 4674, "mso-table-lspace:0pt;mso-table-rspace:0pt;mso-line-height-rule:exactly;", 4674, 71, true);
93 WriteAttributeValue("", 4745, GetTableReset(), 4745, 16, false);
94 WriteAttributeValue("", 4761, "text-align:left;vertical-align:top;", 4761, 35, true);
95 WriteAttributeValue("", 4796, GetTableReset(), 4796, 16, false);
96 EndWriteAttribute();
97 WriteLiteral(" width=\"100%\">\r\n\t\t\t\t\t\t\t\t\t");
98 Write(Model.Column(1).Output());
99 WriteLiteral("\r\n\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t</tbody>\r\n\t\t\t\t\t</table>\r\n\t\t\t\t</td>\r\n\t\t\t</tr>\r\n\t\t</tbody>\r\n\t</table>\r\n</div>\r\n");
100 }
101 #pragma warning restore 1998
102
103 private string GetTableReset()
104 {
105 return "border-collapse:separate;border-spacing:0;border:0;margin:0;outline:0;padding:0;";
106 }
107 }
108 }
109 #pragma warning restore 1591
110
1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.GridRowViewModel>
2
3 @functions
4 {
5 private string GetTableReset()
6 {
7 return "border-collapse:separate;border-spacing:0;border:0;margin:0;outline:0;padding:0;";
8 }
9 }
10
11 @{
12 var pageId = Model.Column(1).Paragraph?.PageID != null ? Model.Column(1).Paragraph.PageID : 0;
13 var parentPage = pageId != 0 ? Dynamicweb.Content.Services.Pages.GetPage(pageId).Parent : null;
14 var settings = parentPage != null ? Dynamicweb.Frontend.ContentViewModelFactory.CreatePageInfoViewModel(parentPage).Item : new Dynamicweb.Frontend.ItemViewModel();
15
16 var rowId = Model.Id;
17
18 @* The email settings page *@
19 var emailThemeId = settings.GetRawValueString("EmailTheme");
20 var emailThemeParagraph = emailThemeId != null && emailThemeId != string.Empty ? Dynamicweb.Content.Services.Paragraphs.GetParagraph(Convert.ToInt32(emailThemeId)) : null;
21 var emailTheme = emailThemeParagraph != null && Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(emailThemeParagraph).Item.GetString("CssClassName") != string.Empty ? Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(emailThemeParagraph)?.Item : null;
22
23 var emailContentThemeId = settings.GetRawValueString("EmailContentTheme");
24 var emailContentThemeParagraph = emailContentThemeId != null && emailContentThemeId != string.Empty ? Dynamicweb.Content.Services.Paragraphs.GetParagraph(Convert.ToInt32(emailContentThemeId)) : null;
25 var emailContentTheme = emailContentThemeParagraph != null && Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(emailContentThemeParagraph).Item.GetString("CssClassName") != string.Empty ? Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(emailContentThemeParagraph)?.Item : null;
26
27 @* Row theme colors*@
28 var rowThemeId = Model.Item.GetRawValueString("RowBackground");
29 var rowThemeParagraph = rowThemeId != null && rowThemeId != string.Empty ? Dynamicweb.Content.Services.Paragraphs.GetParagraph(Convert.ToInt32(rowThemeId)) : null;
30 var rowTheme = rowThemeParagraph != null && Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(rowThemeParagraph).Item.GetString("CssClassName") != string.Empty ? Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(rowThemeParagraph)?.Item : null;
31 string rowBackgroundColor = "background-color:";
32 rowBackgroundColor += rowTheme != null ? rowTheme.GetString("BackgroundColor") + ";" : emailTheme != null ? emailTheme.GetString("BackgroundColor") + ";" : "none;";
33 string rowColor = "color:";
34 rowColor += rowTheme != null ? rowTheme.GetString("ForegroundColor") + ";" : emailTheme != null ? emailTheme.GetString("ForegroundColor") + ";" : "inherit;";
35
36 @* Column theme colors *@
37 var columnThemeId = Model.Item.GetRawValueString("ColumnBackground", string.Empty);
38 var columnThemeParagraph = columnThemeId != null && columnThemeId != string.Empty ? Dynamicweb.Content.Services.Paragraphs.GetParagraph(Convert.ToInt32(columnThemeId)) : null;
39 var columnTheme = columnThemeParagraph != null && Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(columnThemeParagraph).Item.GetString("CssClassName") != string.Empty ? Dynamicweb.Frontend.ContentViewModelFactory.CreateParagraphInfoViewModel(columnThemeParagraph)?.Item : null;
40 string columnBackgroundColor = "background-color:";
41 columnBackgroundColor += columnTheme != null ? columnTheme.GetString("BackgroundColor") + ";" : emailContentTheme != null ? emailContentTheme.GetString("BackgroundColor") + ";" : "none;";
42 string columnColor = "color:";
43 columnColor += columnTheme != null ? columnTheme.GetString("ForegroundColor") + ";" : emailContentTheme != null ? emailContentTheme.GetString("ForegroundColor") + ";" : "inherit;";
44 }
45
46 <div class="item_@Model.Item.SystemName.ToLower()" id="@rowId" style="@GetTableReset()">
47 <table class="row" align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="mso-table-lspace:0pt;mso-table-rspace:0pt;mso-line-height-rule:exactly;@GetTableReset()width:100%;@(rowBackgroundColor)@(rowColor)" width="100%">
48 <tbody>
49 <tr style="@GetTableReset()">
50 <td style="@GetTableReset()">
51 <table class="row-content" align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="mso-table-lspace:0pt;mso-table-rspace:0pt;mso-line-height-rule:exactly;@GetTableReset()color:inherit;width:640px;@(columnBackgroundColor)@(columnColor)margin-left:auto;margin-right:auto;" width="640">
52 <tbody>
53 <tr style="@GetTableReset()">
54 <td class="column" style="mso-table-lspace:0pt;mso-table-rspace:0pt;mso-line-height-rule:exactly;@GetTableReset()text-align:left;vertical-align:top;@GetTableReset()" width="100%">
55 @Model.Column(1).Output()
56 </td>
57 </tr>
58 </tbody>
59 </table>
60 </td>
61 </tr>
62 </tbody>
63 </table>
64 </div>
65