Error compiling template "Designs/Dwsimple/Paragraph/Carousel.cshtml" Line 281: The type or namespace name 'Input' does not exist in the namespace 'Dynamicweb' (are you missing an assembly reference?) Line 288: The type or namespace name 'Input' does not exist in the namespace 'Dynamicweb' (are you missing an assembly reference?) Line 359: The variable 'rawstring' is assigned but its value is never used Line 435: The variable 'TextClass' is assigned but its value is never used 1 @inherits Dynamicweb.Rendering.RazorTemplateBase> 2 3 4 @using System.Text.RegularExpressions 5 @using System.Web 6 7 8 @functions{ 9 public class WrapMethods 10 { 11 //Gets the contrasting color 12 public static string getContrastYIQ(string hexcolor) 13 { 14 if (hexcolor != "") 15 { 16 hexcolor = Regex.Replace(hexcolor, "[^0-9a-zA-Z]+", ""); 17 18 int r = Convert.ToByte(hexcolor.Substring(0, 2), 16); 19 int g = Convert.ToByte(hexcolor.Substring(2, 2), 16); 20 int b = Convert.ToByte(hexcolor.Substring(4, 2), 16); 21 int yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000; 22 23 if (yiq >= 128) 24 { 25 return "black"; 26 } 27 else 28 { 29 return "white"; 30 } 31 } 32 else 33 { 34 return "black"; 35 } 36 } 37 38 39 //Truncate text 40 public static string Truncate (string value, int count, bool strip=true) 41 { 42 if (strip == true){ 43 value = StripHtmlTagByCharArray(value); 44 } 45 46 if (value.Length > count) 47 { 48 value = value.Substring(0, count - 1) + "..."; 49 } 50 51 return value; 52 } 53 54 55 //Strip text from HTML 56 public static string StripHtmlTagByCharArray(string htmlString) 57 { 58 char[] array = new char[htmlString.Length]; 59 int arrayIndex = 0; 60 bool inside = false; 61 62 for (int i = 0; i < htmlString.Length; i++) 63 { 64 char let = htmlString[i]; 65 if (let == '<') 66 { 67 inside = true; 68 continue; 69 } 70 if (let == '>') 71 { 72 inside = false; 73 continue; 74 } 75 if (!inside) 76 { 77 array[arrayIndex] = let; 78 arrayIndex++; 79 } 80 } 81 return new string(array, 0, arrayIndex); 82 } 83 84 //Make the correct count of columns 85 public static string ColumnMaker(int Col, string ScreenSize) 86 { 87 string Columns = ""; 88 89 switch (Col) 90 { 91 case 1: 92 Columns = "col-"+ScreenSize+"-12"; 93 break; 94 95 case 2: 96 Columns = "col-"+ScreenSize+"-6"; 97 break; 98 99 case 3: 100 Columns = "col-"+ScreenSize+"-4"; 101 break; 102 103 case 4: 104 Columns = "col-"+ScreenSize+"-3"; 105 break; 106 107 default: 108 Columns = "col-"+ScreenSize+"-3"; 109 break; 110 } 111 112 return Columns; 113 } 114 115 116 private string Custom(string firstoption, string secondoption) 117 { 118 if (firstoption == "custom") 119 { 120 return secondoption; 121 } 122 else 123 { 124 return firstoption; 125 } 126 } 127 } 128 } 129 130 131 132 133 134 135 136 @helper DivBreakout() 137 { 138 string rawstring = ""; 139 140 141 if (GetBoolean("Item.Fluid")) 142 { 143 rawstring = ""; 144 @rawstring 145 146 if (GetBoolean("ParagraphContainerIsLast")) 147 { 148 149 rawstring = "
"; 150 } 151 else if (GetBoolean("ParagraphContainerIsFirst")) 152 { 153 154 if (Pageview.Area.Item["HeaderLayoutMode"].ToString() != "solid") 155 { 156 rawstring = "
"; 157 } 158 else 159 { 160 rawstring = "
"; 161 } 162 } 163 else 164 { 165 rawstring = "
"; 166 } 167 @rawstring 168 } else { 169 var layoutwidth = GetString("Item.LayoutWidth"); 170 rawstring = "
"; 171 @rawstring 172 } 173 } 174 175 @helper DivBreakbackin() 176 { 177 string rawstring = ""; 178 179 if (!GetBoolean("Item.Fluid")) 180 { 181 rawstring = "
"; 182 @rawstring 183 } 184 else 185 { 186 rawstring = "
"; 187 @rawstring 188 189 190 if (!GetBoolean("ParagraphContainerIsLast")) 191 { 192 rawstring = "
"; 193 @rawstring 194 } 195 } 196 } 197 @inherits Dynamicweb.Rendering.RazorTemplateBase> 198 199 @{ 200 init(); 201 } 202 203 @functions { 204 private int columnsWritten { get; set; } 205 private int columns { get; set; } 206 207 public void init() 208 { 209 columnsWritten = Dynamicweb.Input.FormatInteger(System.Web.HttpContext.Current.Items["currentColumns"]); 210 columns = GetInteger("Item.Width"); 211 System.Web.HttpContext.Current.Items["currentColumns"] = columnsWritten + GetInteger("Item.Width"); 212 } 213 214 public void Fluid() 215 { 216 columnsWritten = Dynamicweb.Input.FormatInteger(System.Web.HttpContext.Current.Items["currentColumns"]); 217 columns = 12; 218 System.Web.HttpContext.Current.Items["currentColumns"] = columnsWritten + 12; 219 } 220 221 public string ColumnClass() 222 { 223 if (GetString("Item.WidthMobile") == "hide"){ 224 return "col-md-" + GetString("Item.Width") + " hidden-xs"; 225 } else { 226 return "col-md-" + GetString("Item.Width") + " col-xs-" + GetString("Item.WidthMobile"); 227 } 228 } 229 230 public string NewRow() 231 { 232 if (columns + columnsWritten > 12) 233 { 234 System.Web.HttpContext.Current.Items["currentColumns"] = columns; 235 return "
"; 236 } 237 else 238 { 239 return string.Empty; 240 } 241 242 } 243 } 244 245 @{ 246 string rawstring = ""; 247 248 249 string TitleFont = CustomFont(GetString("Item.TitleFont.Font"), GetString("Item.TitleFont.CustomFont")); 250 string TitleSize = GetString("Item.TitleFont.Size") + "px"; 251 string TitleColor = GetString("Item.TitleFont.Color.Color"); 252 string TitleLineHeight = CheckExistence(GetString("Item.TitleFont.LineHeight"), "1"); 253 string TitleSpacing = CheckExistence(GetString("Item.TitleFont.LetterSpacing"), "0"); 254 string TitleCasing = GetString("Item.TitleFont.Casing"); 255 string TitleWeight = CheckExistence(GetString("Item.TitleFont.Weight"), "300"); 256 257 string SubFont = CustomFont(GetString("Item.SubtitleFont.Font"), GetString("Item.TitleFont.CustomFont")); 258 string SubSize = GetString("Item.SubtitleFont.Size") + "px"; 259 string SubColor = GetString("Item.SubtitleFont.Color.Color"); 260 string SubLineHeight = CheckExistence(GetString("Item.SubtitleFont.LineHeight"), "1"); 261 string SubtitleSpacing = CheckExistence(GetString("Item.SubtitleFont.LetterSpacing"), "0"); 262 string SubCasing = GetString("Item.SubtitleFont.Casing"); 263 string SubtitleWeight = CheckExistence(GetString("Item.SubtitleFont.Weight"), "300"); 264 265 string textpos = "0px"; 266 267 if (GetString("Item.Mode") == "clean") { 268 273 } 274 275 if (GetString("Item.Mode") == "shadow") { 276 281 } 282 283 if (GetString("Item.Mode") == "boxed") { 284 290 } 291 292 if (GetString("Item.Mode") == "box") { 293 307 } 308 309 310 string column = ""; 311 312 if (!GetBoolean("Item.Fluid")){ 313 NewRow(); 314 315 column = ColumnClass(); 316 } 317 else 318 { 319 Fluid(); 320 } 321 322 323 string TextClass = ""; 324 325 if (GetString("Item.Position") == "left"){ 326 331 } 332 333 if (GetString("Item.Position") == "center"){ 334 339 } 340 341 if (GetString("Item.Position") == "right"){ 342 347 } 348 } 349 350 351 352 353 354 @DivBreakout() 355 356
357 @{ 358 textpos = ((GetInteger("Item.Height")/2)-(GetInteger("Item.TitleFont.Size")+GetInteger("Item.SubtitleFont.Size")+20)).ToString() + "px"; 359 } 360 361 412
413 414 415 @DivBreakbackin() 416 417 @functions{ 418 private string CustomFont (string firstfont, string secondfont) 419 { 420 if (firstfont == "custom") 421 { 422 return secondfont; 423 } 424 else 425 { 426 return firstfont; 427 } 428 } 429 430 private string CheckExistence (string stringitem, string defaultvalue) 431 { 432 if (!string.IsNullOrWhiteSpace(stringitem)) { 433 return stringitem; 434 } else { 435 return defaultvalue; 436 } 437 } 438 } Error compiling template "Designs/Dwsimple/Paragraph/Paragraph.cshtml" Line 26: The type or namespace name 'Input' does not exist in the namespace 'Dynamicweb' (are you missing an assembly reference?) Line 33: The type or namespace name 'Input' does not exist in the namespace 'Dynamicweb' (are you missing an assembly reference?) 1 @inherits Dynamicweb.Rendering.RazorTemplateBase> 2 3 @inherits Dynamicweb.Rendering.RazorTemplateBase> 4 5 @{ 6 init(); 7 } 8 9 @functions { 10 private int columnsWritten { get; set; } 11 private int columns { get; set; } 12 13 public void init() 14 { 15 columnsWritten = Dynamicweb.Input.FormatInteger(System.Web.HttpContext.Current.Items["currentColumns"]); 16 columns = GetInteger("Item.Width"); 17 System.Web.HttpContext.Current.Items["currentColumns"] = columnsWritten + GetInteger("Item.Width"); 18 } 19 20 public void Fluid() 21 { 22 columnsWritten = Dynamicweb.Input.FormatInteger(System.Web.HttpContext.Current.Items["currentColumns"]); 23 columns = 12; 24 System.Web.HttpContext.Current.Items["currentColumns"] = columnsWritten + 12; 25 } 26 27 public string ColumnClass() 28 { 29 if (GetString("Item.WidthMobile") == "hide"){ 30 return "col-md-" + GetString("Item.Width") + " hidden-xs"; 31 } else { 32 return "col-md-" + GetString("Item.Width") + " col-xs-" + GetString("Item.WidthMobile"); 33 } 34 } 35 36 public string NewRow() 37 { 38 if (columns + columnsWritten > 12) 39 { 40 System.Web.HttpContext.Current.Items["currentColumns"] = columns; 41 return "
"; 42 } 43 else 44 { 45 return string.Empty; 46 } 47 48 } 49 } 50 51 @NewRow() 52 53
54 55 @if (GetString("Item.Order") == "title-first" || GetString("Item.Order") == "") 56 { 57 @RenderHeading() 58 @RenderImage() 59 @RenderSubHeading() 60 @RenderText() 61 @RenderModule() 62 @RenderButton() 63 } 64 65 @if (GetString("Item.Order") == "image-first") 66 { 67

 

68 @RenderImage() 69 @RenderHeading() 70 @RenderSubHeading() 71 @RenderText() 72 @RenderModule() 73 @RenderButton() 74 } 75 76 @if (GetString("Item.Order") == "title-sub-first") 77 { 78 @RenderHeading() 79 @RenderSubHeading() 80 @RenderImage() 81 @RenderText() 82 @RenderModule() 83 @RenderButton() 84 } 85 86 @if (GetString("Item.Order") == "icon-xs") 87 { 88
89 @RenderImage() 90
91
92 @RenderHeading() 93 @RenderSubHeading() 94 @RenderText() 95 @RenderModule() 96 @RenderButton() 97
98 } 99 100 @if (GetString("Item.Order") == "icon-sm") 101 { 102
103 @RenderImage() 104
105
106 @RenderHeading() 107 @RenderSubHeading() 108 @RenderText() 109 @RenderModule() 110 @RenderButton() 111
112 } 113 114 @if (GetString("Item.Order") == "icon-md") 115 { 116
117 @RenderImage() 118
119
120 @RenderHeading() 121 @RenderSubHeading() 122 @RenderText() 123 @RenderModule() 124 @RenderButton() 125
126 } 127 128
129 130 131 @helper RenderHeading() 132 { 133 if (GetBoolean("Item.ShowTitle") != false){ 134 if (!string.IsNullOrEmpty(GetString("Item.Title"))) 135 { 136

137 138 @GetString("Item.Title") 139 140

141 } 142 } 143 } 144 145 @helper RenderButton() 146 { 147 var Url = GetString("Item.Link"); 148 149 if (!string.IsNullOrEmpty(Url) && !string.IsNullOrEmpty(GetString("Item.LinkText"))) 150 { 151 if (Url.Contains("http")) 152 { 153 154

155 @GetString("Item.LinkText") 156

157
158 } 159 else if (Url.Contains("/")) 160 { 161 162

163 @GetString("Item.LinkText") 164

165
166 } 167 else 168 { 169 170

171 @GetString("Item.LinkText") 172

173
174 } 175 } 176 } 177 178 @helper RenderSubHeading() 179 { 180 if (!string.IsNullOrEmpty(GetString("Item.Subtitle"))) 181 { 182

183 @GetString("Item.Subtitle") 184

185 } 186 } 187 188 @helper RenderText() 189 { 190 if (!string.IsNullOrWhiteSpace(GetString("Item.Text"))){ 191
192 @GetString("Item.Text") 193
194 } 195 } 196 197 @helper RenderModule() 198 { 199 @GetString("ParagraphModule") 200 } 201 202 @helper RenderImage() 203 { 204 if (!string.IsNullOrEmpty(GetString("Item.Image"))) 205 { 206 var image = System.Web.HttpContext.Current.Server.UrlEncode(GetString("Item.Image")); 207 208 209 string optimizedwidth = "1280"; 210 211 switch (GetString("Item.Width")){ 212 case "12": 213 optimizedwidth = "1280"; 214 break; 215 case "9": 216 optimizedwidth = "960"; 217 break; 218 case "6": 219 optimizedwidth = "722"; 220 break; 221 case "3": 222 optimizedwidth = "722"; 223 break; 224 case "8": 225 optimizedwidth = "960"; 226 break; 227 case "4": 228 optimizedwidth = "722"; 229 break; 230 } 231 232 string optimizedheight = ((Convert.ToInt32(optimizedwidth)/16)*9).ToString(); 233 234 if (GetString("Item.ImageStyle") == "ball") { 235 optimizedwidth = "500"; 236 optimizedheight = "500"; 237 } 238 239 string altText = GetString("Item.Title"); 240 241 if (string.IsNullOrEmpty(GetString("Item.Link"))) 242 { 243 244
245 @altText 246
247 } else { 248 249
250 @altText 251
252 253 } 254 } 255 } 256 257 @functions { 258 private string GetImageBorderCss() 259 { 260 if (GetString("Item.ImageStyle") == "cover") 261 { 262 return "padding: 8px"; 263 } 264 else if (GetString("Item.ImageStyle") == "cover-border") 265 { 266 return "padding: 4px; border: 1px solid #e1e1e1; border-radius: 0px !important"; 267 } 268 else if (GetString("Item.ImageStyle") == "frame") 269 { 270 return "padding: 6px; border: 1px solid #e1e1e1; border-radius: 0px !important"; 271 } 272 else if (GetString("Item.ImageStyle") == "rounded") 273 { 274 return "border-radius: 8px !important"; 275 } 276 else if (GetString("Item.ImageStyle") == "ball") 277 { 278 return "border-radius: 1000px !important"; 279 } 280 else if (GetString("Item.ImageStyle") == "shadow") 281 { 282 return "box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.2)"; 283 } 284 else 285 { 286 return string.Empty; 287 } 288 } 289 } Error compiling template "Designs/Dwsimple/Paragraph/Paragraph.cshtml" Line 26: The type or namespace name 'Input' does not exist in the namespace 'Dynamicweb' (are you missing an assembly reference?) Line 33: The type or namespace name 'Input' does not exist in the namespace 'Dynamicweb' (are you missing an assembly reference?) 1 @inherits Dynamicweb.Rendering.RazorTemplateBase> 2 3 @inherits Dynamicweb.Rendering.RazorTemplateBase> 4 5 @{ 6 init(); 7 } 8 9 @functions { 10 private int columnsWritten { get; set; } 11 private int columns { get; set; } 12 13 public void init() 14 { 15 columnsWritten = Dynamicweb.Input.FormatInteger(System.Web.HttpContext.Current.Items["currentColumns"]); 16 columns = GetInteger("Item.Width"); 17 System.Web.HttpContext.Current.Items["currentColumns"] = columnsWritten + GetInteger("Item.Width"); 18 } 19 20 public void Fluid() 21 { 22 columnsWritten = Dynamicweb.Input.FormatInteger(System.Web.HttpContext.Current.Items["currentColumns"]); 23 columns = 12; 24 System.Web.HttpContext.Current.Items["currentColumns"] = columnsWritten + 12; 25 } 26 27 public string ColumnClass() 28 { 29 if (GetString("Item.WidthMobile") == "hide"){ 30 return "col-md-" + GetString("Item.Width") + " hidden-xs"; 31 } else { 32 return "col-md-" + GetString("Item.Width") + " col-xs-" + GetString("Item.WidthMobile"); 33 } 34 } 35 36 public string NewRow() 37 { 38 if (columns + columnsWritten > 12) 39 { 40 System.Web.HttpContext.Current.Items["currentColumns"] = columns; 41 return "
"; 42 } 43 else 44 { 45 return string.Empty; 46 } 47 48 } 49 } 50 51 @NewRow() 52 53
54 55 @if (GetString("Item.Order") == "title-first" || GetString("Item.Order") == "") 56 { 57 @RenderHeading() 58 @RenderImage() 59 @RenderSubHeading() 60 @RenderText() 61 @RenderModule() 62 @RenderButton() 63 } 64 65 @if (GetString("Item.Order") == "image-first") 66 { 67

 

68 @RenderImage() 69 @RenderHeading() 70 @RenderSubHeading() 71 @RenderText() 72 @RenderModule() 73 @RenderButton() 74 } 75 76 @if (GetString("Item.Order") == "title-sub-first") 77 { 78 @RenderHeading() 79 @RenderSubHeading() 80 @RenderImage() 81 @RenderText() 82 @RenderModule() 83 @RenderButton() 84 } 85 86 @if (GetString("Item.Order") == "icon-xs") 87 { 88
89 @RenderImage() 90
91
92 @RenderHeading() 93 @RenderSubHeading() 94 @RenderText() 95 @RenderModule() 96 @RenderButton() 97
98 } 99 100 @if (GetString("Item.Order") == "icon-sm") 101 { 102
103 @RenderImage() 104
105
106 @RenderHeading() 107 @RenderSubHeading() 108 @RenderText() 109 @RenderModule() 110 @RenderButton() 111
112 } 113 114 @if (GetString("Item.Order") == "icon-md") 115 { 116
117 @RenderImage() 118
119
120 @RenderHeading() 121 @RenderSubHeading() 122 @RenderText() 123 @RenderModule() 124 @RenderButton() 125
126 } 127 128
129 130 131 @helper RenderHeading() 132 { 133 if (GetBoolean("Item.ShowTitle") != false){ 134 if (!string.IsNullOrEmpty(GetString("Item.Title"))) 135 { 136

137 138 @GetString("Item.Title") 139 140

141 } 142 } 143 } 144 145 @helper RenderButton() 146 { 147 var Url = GetString("Item.Link"); 148 149 if (!string.IsNullOrEmpty(Url) && !string.IsNullOrEmpty(GetString("Item.LinkText"))) 150 { 151 if (Url.Contains("http")) 152 { 153 154

155 @GetString("Item.LinkText") 156

157
158 } 159 else if (Url.Contains("/")) 160 { 161 162

163 @GetString("Item.LinkText") 164

165
166 } 167 else 168 { 169 170

171 @GetString("Item.LinkText") 172

173
174 } 175 } 176 } 177 178 @helper RenderSubHeading() 179 { 180 if (!string.IsNullOrEmpty(GetString("Item.Subtitle"))) 181 { 182

183 @GetString("Item.Subtitle") 184

185 } 186 } 187 188 @helper RenderText() 189 { 190 if (!string.IsNullOrWhiteSpace(GetString("Item.Text"))){ 191
192 @GetString("Item.Text") 193
194 } 195 } 196 197 @helper RenderModule() 198 { 199 @GetString("ParagraphModule") 200 } 201 202 @helper RenderImage() 203 { 204 if (!string.IsNullOrEmpty(GetString("Item.Image"))) 205 { 206 var image = System.Web.HttpContext.Current.Server.UrlEncode(GetString("Item.Image")); 207 208 209 string optimizedwidth = "1280"; 210 211 switch (GetString("Item.Width")){ 212 case "12": 213 optimizedwidth = "1280"; 214 break; 215 case "9": 216 optimizedwidth = "960"; 217 break; 218 case "6": 219 optimizedwidth = "722"; 220 break; 221 case "3": 222 optimizedwidth = "722"; 223 break; 224 case "8": 225 optimizedwidth = "960"; 226 break; 227 case "4": 228 optimizedwidth = "722"; 229 break; 230 } 231 232 string optimizedheight = ((Convert.ToInt32(optimizedwidth)/16)*9).ToString(); 233 234 if (GetString("Item.ImageStyle") == "ball") { 235 optimizedwidth = "500"; 236 optimizedheight = "500"; 237 } 238 239 string altText = GetString("Item.Title"); 240 241 if (string.IsNullOrEmpty(GetString("Item.Link"))) 242 { 243 244
245 @altText 246
247 } else { 248 249
250 @altText 251
252 253 } 254 } 255 } 256 257 @functions { 258 private string GetImageBorderCss() 259 { 260 if (GetString("Item.ImageStyle") == "cover") 261 { 262 return "padding: 8px"; 263 } 264 else if (GetString("Item.ImageStyle") == "cover-border") 265 { 266 return "padding: 4px; border: 1px solid #e1e1e1; border-radius: 0px !important"; 267 } 268 else if (GetString("Item.ImageStyle") == "frame") 269 { 270 return "padding: 6px; border: 1px solid #e1e1e1; border-radius: 0px !important"; 271 } 272 else if (GetString("Item.ImageStyle") == "rounded") 273 { 274 return "border-radius: 8px !important"; 275 } 276 else if (GetString("Item.ImageStyle") == "ball") 277 { 278 return "border-radius: 1000px !important"; 279 } 280 else if (GetString("Item.ImageStyle") == "shadow") 281 { 282 return "box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.2)"; 283 } 284 else 285 { 286 return string.Empty; 287 } 288 } 289 } Error compiling template "Designs/Dwsimple/Paragraph/Paragraph.cshtml" Line 26: The type or namespace name 'Input' does not exist in the namespace 'Dynamicweb' (are you missing an assembly reference?) Line 33: The type or namespace name 'Input' does not exist in the namespace 'Dynamicweb' (are you missing an assembly reference?) 1 @inherits Dynamicweb.Rendering.RazorTemplateBase> 2 3 @inherits Dynamicweb.Rendering.RazorTemplateBase> 4 5 @{ 6 init(); 7 } 8 9 @functions { 10 private int columnsWritten { get; set; } 11 private int columns { get; set; } 12 13 public void init() 14 { 15 columnsWritten = Dynamicweb.Input.FormatInteger(System.Web.HttpContext.Current.Items["currentColumns"]); 16 columns = GetInteger("Item.Width"); 17 System.Web.HttpContext.Current.Items["currentColumns"] = columnsWritten + GetInteger("Item.Width"); 18 } 19 20 public void Fluid() 21 { 22 columnsWritten = Dynamicweb.Input.FormatInteger(System.Web.HttpContext.Current.Items["currentColumns"]); 23 columns = 12; 24 System.Web.HttpContext.Current.Items["currentColumns"] = columnsWritten + 12; 25 } 26 27 public string ColumnClass() 28 { 29 if (GetString("Item.WidthMobile") == "hide"){ 30 return "col-md-" + GetString("Item.Width") + " hidden-xs"; 31 } else { 32 return "col-md-" + GetString("Item.Width") + " col-xs-" + GetString("Item.WidthMobile"); 33 } 34 } 35 36 public string NewRow() 37 { 38 if (columns + columnsWritten > 12) 39 { 40 System.Web.HttpContext.Current.Items["currentColumns"] = columns; 41 return "
"; 42 } 43 else 44 { 45 return string.Empty; 46 } 47 48 } 49 } 50 51 @NewRow() 52 53
54 55 @if (GetString("Item.Order") == "title-first" || GetString("Item.Order") == "") 56 { 57 @RenderHeading() 58 @RenderImage() 59 @RenderSubHeading() 60 @RenderText() 61 @RenderModule() 62 @RenderButton() 63 } 64 65 @if (GetString("Item.Order") == "image-first") 66 { 67

 

68 @RenderImage() 69 @RenderHeading() 70 @RenderSubHeading() 71 @RenderText() 72 @RenderModule() 73 @RenderButton() 74 } 75 76 @if (GetString("Item.Order") == "title-sub-first") 77 { 78 @RenderHeading() 79 @RenderSubHeading() 80 @RenderImage() 81 @RenderText() 82 @RenderModule() 83 @RenderButton() 84 } 85 86 @if (GetString("Item.Order") == "icon-xs") 87 { 88
89 @RenderImage() 90
91
92 @RenderHeading() 93 @RenderSubHeading() 94 @RenderText() 95 @RenderModule() 96 @RenderButton() 97
98 } 99 100 @if (GetString("Item.Order") == "icon-sm") 101 { 102
103 @RenderImage() 104
105
106 @RenderHeading() 107 @RenderSubHeading() 108 @RenderText() 109 @RenderModule() 110 @RenderButton() 111
112 } 113 114 @if (GetString("Item.Order") == "icon-md") 115 { 116
117 @RenderImage() 118
119
120 @RenderHeading() 121 @RenderSubHeading() 122 @RenderText() 123 @RenderModule() 124 @RenderButton() 125
126 } 127 128
129 130 131 @helper RenderHeading() 132 { 133 if (GetBoolean("Item.ShowTitle") != false){ 134 if (!string.IsNullOrEmpty(GetString("Item.Title"))) 135 { 136

137 138 @GetString("Item.Title") 139 140

141 } 142 } 143 } 144 145 @helper RenderButton() 146 { 147 var Url = GetString("Item.Link"); 148 149 if (!string.IsNullOrEmpty(Url) && !string.IsNullOrEmpty(GetString("Item.LinkText"))) 150 { 151 if (Url.Contains("http")) 152 { 153 154

155 @GetString("Item.LinkText") 156

157
158 } 159 else if (Url.Contains("/")) 160 { 161 162

163 @GetString("Item.LinkText") 164

165
166 } 167 else 168 { 169 170

171 @GetString("Item.LinkText") 172

173
174 } 175 } 176 } 177 178 @helper RenderSubHeading() 179 { 180 if (!string.IsNullOrEmpty(GetString("Item.Subtitle"))) 181 { 182

183 @GetString("Item.Subtitle") 184

185 } 186 } 187 188 @helper RenderText() 189 { 190 if (!string.IsNullOrWhiteSpace(GetString("Item.Text"))){ 191
192 @GetString("Item.Text") 193
194 } 195 } 196 197 @helper RenderModule() 198 { 199 @GetString("ParagraphModule") 200 } 201 202 @helper RenderImage() 203 { 204 if (!string.IsNullOrEmpty(GetString("Item.Image"))) 205 { 206 var image = System.Web.HttpContext.Current.Server.UrlEncode(GetString("Item.Image")); 207 208 209 string optimizedwidth = "1280"; 210 211 switch (GetString("Item.Width")){ 212 case "12": 213 optimizedwidth = "1280"; 214 break; 215 case "9": 216 optimizedwidth = "960"; 217 break; 218 case "6": 219 optimizedwidth = "722"; 220 break; 221 case "3": 222 optimizedwidth = "722"; 223 break; 224 case "8": 225 optimizedwidth = "960"; 226 break; 227 case "4": 228 optimizedwidth = "722"; 229 break; 230 } 231 232 string optimizedheight = ((Convert.ToInt32(optimizedwidth)/16)*9).ToString(); 233 234 if (GetString("Item.ImageStyle") == "ball") { 235 optimizedwidth = "500"; 236 optimizedheight = "500"; 237 } 238 239 string altText = GetString("Item.Title"); 240 241 if (string.IsNullOrEmpty(GetString("Item.Link"))) 242 { 243 244
245 @altText 246
247 } else { 248 249
250 @altText 251
252 253 } 254 } 255 } 256 257 @functions { 258 private string GetImageBorderCss() 259 { 260 if (GetString("Item.ImageStyle") == "cover") 261 { 262 return "padding: 8px"; 263 } 264 else if (GetString("Item.ImageStyle") == "cover-border") 265 { 266 return "padding: 4px; border: 1px solid #e1e1e1; border-radius: 0px !important"; 267 } 268 else if (GetString("Item.ImageStyle") == "frame") 269 { 270 return "padding: 6px; border: 1px solid #e1e1e1; border-radius: 0px !important"; 271 } 272 else if (GetString("Item.ImageStyle") == "rounded") 273 { 274 return "border-radius: 8px !important"; 275 } 276 else if (GetString("Item.ImageStyle") == "ball") 277 { 278 return "border-radius: 1000px !important"; 279 } 280 else if (GetString("Item.ImageStyle") == "shadow") 281 { 282 return "box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.2)"; 283 } 284 else 285 { 286 return string.Empty; 287 } 288 } 289 } Error compiling template "Designs/Dwsimple/Paragraph/Paragraph.cshtml" Line 26: The type or namespace name 'Input' does not exist in the namespace 'Dynamicweb' (are you missing an assembly reference?) Line 33: The type or namespace name 'Input' does not exist in the namespace 'Dynamicweb' (are you missing an assembly reference?) 1 @inherits Dynamicweb.Rendering.RazorTemplateBase> 2 3 @inherits Dynamicweb.Rendering.RazorTemplateBase> 4 5 @{ 6 init(); 7 } 8 9 @functions { 10 private int columnsWritten { get; set; } 11 private int columns { get; set; } 12 13 public void init() 14 { 15 columnsWritten = Dynamicweb.Input.FormatInteger(System.Web.HttpContext.Current.Items["currentColumns"]); 16 columns = GetInteger("Item.Width"); 17 System.Web.HttpContext.Current.Items["currentColumns"] = columnsWritten + GetInteger("Item.Width"); 18 } 19 20 public void Fluid() 21 { 22 columnsWritten = Dynamicweb.Input.FormatInteger(System.Web.HttpContext.Current.Items["currentColumns"]); 23 columns = 12; 24 System.Web.HttpContext.Current.Items["currentColumns"] = columnsWritten + 12; 25 } 26 27 public string ColumnClass() 28 { 29 if (GetString("Item.WidthMobile") == "hide"){ 30 return "col-md-" + GetString("Item.Width") + " hidden-xs"; 31 } else { 32 return "col-md-" + GetString("Item.Width") + " col-xs-" + GetString("Item.WidthMobile"); 33 } 34 } 35 36 public string NewRow() 37 { 38 if (columns + columnsWritten > 12) 39 { 40 System.Web.HttpContext.Current.Items["currentColumns"] = columns; 41 return "
"; 42 } 43 else 44 { 45 return string.Empty; 46 } 47 48 } 49 } 50 51 @NewRow() 52 53
54 55 @if (GetString("Item.Order") == "title-first" || GetString("Item.Order") == "") 56 { 57 @RenderHeading() 58 @RenderImage() 59 @RenderSubHeading() 60 @RenderText() 61 @RenderModule() 62 @RenderButton() 63 } 64 65 @if (GetString("Item.Order") == "image-first") 66 { 67

 

68 @RenderImage() 69 @RenderHeading() 70 @RenderSubHeading() 71 @RenderText() 72 @RenderModule() 73 @RenderButton() 74 } 75 76 @if (GetString("Item.Order") == "title-sub-first") 77 { 78 @RenderHeading() 79 @RenderSubHeading() 80 @RenderImage() 81 @RenderText() 82 @RenderModule() 83 @RenderButton() 84 } 85 86 @if (GetString("Item.Order") == "icon-xs") 87 { 88
89 @RenderImage() 90
91
92 @RenderHeading() 93 @RenderSubHeading() 94 @RenderText() 95 @RenderModule() 96 @RenderButton() 97
98 } 99 100 @if (GetString("Item.Order") == "icon-sm") 101 { 102
103 @RenderImage() 104
105
106 @RenderHeading() 107 @RenderSubHeading() 108 @RenderText() 109 @RenderModule() 110 @RenderButton() 111
112 } 113 114 @if (GetString("Item.Order") == "icon-md") 115 { 116
117 @RenderImage() 118
119
120 @RenderHeading() 121 @RenderSubHeading() 122 @RenderText() 123 @RenderModule() 124 @RenderButton() 125
126 } 127 128
129 130 131 @helper RenderHeading() 132 { 133 if (GetBoolean("Item.ShowTitle") != false){ 134 if (!string.IsNullOrEmpty(GetString("Item.Title"))) 135 { 136

137 138 @GetString("Item.Title") 139 140

141 } 142 } 143 } 144 145 @helper RenderButton() 146 { 147 var Url = GetString("Item.Link"); 148 149 if (!string.IsNullOrEmpty(Url) && !string.IsNullOrEmpty(GetString("Item.LinkText"))) 150 { 151 if (Url.Contains("http")) 152 { 153 154

155 @GetString("Item.LinkText") 156

157
158 } 159 else if (Url.Contains("/")) 160 { 161 162

163 @GetString("Item.LinkText") 164

165
166 } 167 else 168 { 169 170

171 @GetString("Item.LinkText") 172

173
174 } 175 } 176 } 177 178 @helper RenderSubHeading() 179 { 180 if (!string.IsNullOrEmpty(GetString("Item.Subtitle"))) 181 { 182

183 @GetString("Item.Subtitle") 184

185 } 186 } 187 188 @helper RenderText() 189 { 190 if (!string.IsNullOrWhiteSpace(GetString("Item.Text"))){ 191
192 @GetString("Item.Text") 193
194 } 195 } 196 197 @helper RenderModule() 198 { 199 @GetString("ParagraphModule") 200 } 201 202 @helper RenderImage() 203 { 204 if (!string.IsNullOrEmpty(GetString("Item.Image"))) 205 { 206 var image = System.Web.HttpContext.Current.Server.UrlEncode(GetString("Item.Image")); 207 208 209 string optimizedwidth = "1280"; 210 211 switch (GetString("Item.Width")){ 212 case "12": 213 optimizedwidth = "1280"; 214 break; 215 case "9": 216 optimizedwidth = "960"; 217 break; 218 case "6": 219 optimizedwidth = "722"; 220 break; 221 case "3": 222 optimizedwidth = "722"; 223 break; 224 case "8": 225 optimizedwidth = "960"; 226 break; 227 case "4": 228 optimizedwidth = "722"; 229 break; 230 } 231 232 string optimizedheight = ((Convert.ToInt32(optimizedwidth)/16)*9).ToString(); 233 234 if (GetString("Item.ImageStyle") == "ball") { 235 optimizedwidth = "500"; 236 optimizedheight = "500"; 237 } 238 239 string altText = GetString("Item.Title"); 240 241 if (string.IsNullOrEmpty(GetString("Item.Link"))) 242 { 243 244
245 @altText 246
247 } else { 248 249
250 @altText 251
252 253 } 254 } 255 } 256 257 @functions { 258 private string GetImageBorderCss() 259 { 260 if (GetString("Item.ImageStyle") == "cover") 261 { 262 return "padding: 8px"; 263 } 264 else if (GetString("Item.ImageStyle") == "cover-border") 265 { 266 return "padding: 4px; border: 1px solid #e1e1e1; border-radius: 0px !important"; 267 } 268 else if (GetString("Item.ImageStyle") == "frame") 269 { 270 return "padding: 6px; border: 1px solid #e1e1e1; border-radius: 0px !important"; 271 } 272 else if (GetString("Item.ImageStyle") == "rounded") 273 { 274 return "border-radius: 8px !important"; 275 } 276 else if (GetString("Item.ImageStyle") == "ball") 277 { 278 return "border-radius: 1000px !important"; 279 } 280 else if (GetString("Item.ImageStyle") == "shadow") 281 { 282 return "box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.2)"; 283 } 284 else 285 { 286 return string.Empty; 287 } 288 } 289 } Error compiling template "Designs/Dwsimple/Paragraph/Paragraph.cshtml" Line 26: The type or namespace name 'Input' does not exist in the namespace 'Dynamicweb' (are you missing an assembly reference?) Line 33: The type or namespace name 'Input' does not exist in the namespace 'Dynamicweb' (are you missing an assembly reference?) 1 @inherits Dynamicweb.Rendering.RazorTemplateBase> 2 3 @inherits Dynamicweb.Rendering.RazorTemplateBase> 4 5 @{ 6 init(); 7 } 8 9 @functions { 10 private int columnsWritten { get; set; } 11 private int columns { get; set; } 12 13 public void init() 14 { 15 columnsWritten = Dynamicweb.Input.FormatInteger(System.Web.HttpContext.Current.Items["currentColumns"]); 16 columns = GetInteger("Item.Width"); 17 System.Web.HttpContext.Current.Items["currentColumns"] = columnsWritten + GetInteger("Item.Width"); 18 } 19 20 public void Fluid() 21 { 22 columnsWritten = Dynamicweb.Input.FormatInteger(System.Web.HttpContext.Current.Items["currentColumns"]); 23 columns = 12; 24 System.Web.HttpContext.Current.Items["currentColumns"] = columnsWritten + 12; 25 } 26 27 public string ColumnClass() 28 { 29 if (GetString("Item.WidthMobile") == "hide"){ 30 return "col-md-" + GetString("Item.Width") + " hidden-xs"; 31 } else { 32 return "col-md-" + GetString("Item.Width") + " col-xs-" + GetString("Item.WidthMobile"); 33 } 34 } 35 36 public string NewRow() 37 { 38 if (columns + columnsWritten > 12) 39 { 40 System.Web.HttpContext.Current.Items["currentColumns"] = columns; 41 return "
"; 42 } 43 else 44 { 45 return string.Empty; 46 } 47 48 } 49 } 50 51 @NewRow() 52 53
54 55 @if (GetString("Item.Order") == "title-first" || GetString("Item.Order") == "") 56 { 57 @RenderHeading() 58 @RenderImage() 59 @RenderSubHeading() 60 @RenderText() 61 @RenderModule() 62 @RenderButton() 63 } 64 65 @if (GetString("Item.Order") == "image-first") 66 { 67

 

68 @RenderImage() 69 @RenderHeading() 70 @RenderSubHeading() 71 @RenderText() 72 @RenderModule() 73 @RenderButton() 74 } 75 76 @if (GetString("Item.Order") == "title-sub-first") 77 { 78 @RenderHeading() 79 @RenderSubHeading() 80 @RenderImage() 81 @RenderText() 82 @RenderModule() 83 @RenderButton() 84 } 85 86 @if (GetString("Item.Order") == "icon-xs") 87 { 88
89 @RenderImage() 90
91
92 @RenderHeading() 93 @RenderSubHeading() 94 @RenderText() 95 @RenderModule() 96 @RenderButton() 97
98 } 99 100 @if (GetString("Item.Order") == "icon-sm") 101 { 102
103 @RenderImage() 104
105
106 @RenderHeading() 107 @RenderSubHeading() 108 @RenderText() 109 @RenderModule() 110 @RenderButton() 111
112 } 113 114 @if (GetString("Item.Order") == "icon-md") 115 { 116
117 @RenderImage() 118
119
120 @RenderHeading() 121 @RenderSubHeading() 122 @RenderText() 123 @RenderModule() 124 @RenderButton() 125
126 } 127 128
129 130 131 @helper RenderHeading() 132 { 133 if (GetBoolean("Item.ShowTitle") != false){ 134 if (!string.IsNullOrEmpty(GetString("Item.Title"))) 135 { 136

137 138 @GetString("Item.Title") 139 140

141 } 142 } 143 } 144 145 @helper RenderButton() 146 { 147 var Url = GetString("Item.Link"); 148 149 if (!string.IsNullOrEmpty(Url) && !string.IsNullOrEmpty(GetString("Item.LinkText"))) 150 { 151 if (Url.Contains("http")) 152 { 153 154

155 @GetString("Item.LinkText") 156

157
158 } 159 else if (Url.Contains("/")) 160 { 161 162

163 @GetString("Item.LinkText") 164

165
166 } 167 else 168 { 169 170

171 @GetString("Item.LinkText") 172

173
174 } 175 } 176 } 177 178 @helper RenderSubHeading() 179 { 180 if (!string.IsNullOrEmpty(GetString("Item.Subtitle"))) 181 { 182

183 @GetString("Item.Subtitle") 184

185 } 186 } 187 188 @helper RenderText() 189 { 190 if (!string.IsNullOrWhiteSpace(GetString("Item.Text"))){ 191
192 @GetString("Item.Text") 193
194 } 195 } 196 197 @helper RenderModule() 198 { 199 @GetString("ParagraphModule") 200 } 201 202 @helper RenderImage() 203 { 204 if (!string.IsNullOrEmpty(GetString("Item.Image"))) 205 { 206 var image = System.Web.HttpContext.Current.Server.UrlEncode(GetString("Item.Image")); 207 208 209 string optimizedwidth = "1280"; 210 211 switch (GetString("Item.Width")){ 212 case "12": 213 optimizedwidth = "1280"; 214 break; 215 case "9": 216 optimizedwidth = "960"; 217 break; 218 case "6": 219 optimizedwidth = "722"; 220 break; 221 case "3": 222 optimizedwidth = "722"; 223 break; 224 case "8": 225 optimizedwidth = "960"; 226 break; 227 case "4": 228 optimizedwidth = "722"; 229 break; 230 } 231 232 string optimizedheight = ((Convert.ToInt32(optimizedwidth)/16)*9).ToString(); 233 234 if (GetString("Item.ImageStyle") == "ball") { 235 optimizedwidth = "500"; 236 optimizedheight = "500"; 237 } 238 239 string altText = GetString("Item.Title"); 240 241 if (string.IsNullOrEmpty(GetString("Item.Link"))) 242 { 243 244
245 @altText 246
247 } else { 248 249
250 @altText 251
252 253 } 254 } 255 } 256 257 @functions { 258 private string GetImageBorderCss() 259 { 260 if (GetString("Item.ImageStyle") == "cover") 261 { 262 return "padding: 8px"; 263 } 264 else if (GetString("Item.ImageStyle") == "cover-border") 265 { 266 return "padding: 4px; border: 1px solid #e1e1e1; border-radius: 0px !important"; 267 } 268 else if (GetString("Item.ImageStyle") == "frame") 269 { 270 return "padding: 6px; border: 1px solid #e1e1e1; border-radius: 0px !important"; 271 } 272 else if (GetString("Item.ImageStyle") == "rounded") 273 { 274 return "border-radius: 8px !important"; 275 } 276 else if (GetString("Item.ImageStyle") == "ball") 277 { 278 return "border-radius: 1000px !important"; 279 } 280 else if (GetString("Item.ImageStyle") == "shadow") 281 { 282 return "box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.2)"; 283 } 284 else 285 { 286 return string.Empty; 287 } 288 } 289 }