Web Exclusive

Error executing template "/Designs/TTonlineNew/Paragraph/ArticleListBySection-Query.cshtml"
System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at Lucene.Net.Search.AnonymousClassIntParser1.ParseInt(String val)
   at Lucene.Net.Search.FieldCacheImpl.IntCache.CreateValue(IndexReader reader, Entry entryKey)
   at Lucene.Net.Search.FieldCacheImpl.Cache.Get(IndexReader reader, Entry key)
   at Lucene.Net.Search.FieldCacheImpl.GetInts(IndexReader reader, String field, IntParser parser)
   at Lucene.Net.Search.FieldCacheImpl.IntCache.CreateValue(IndexReader reader, Entry entryKey)
   at Lucene.Net.Search.FieldCacheImpl.Cache.Get(IndexReader reader, Entry key)
   at Lucene.Net.Search.FieldCacheImpl.GetInts(IndexReader reader, String field, IntParser parser)
   at Lucene.Net.Search.FieldComparator.IntComparator.SetNextReader(IndexReader reader, Int32 docBase)
   at Lucene.Net.Search.IndexSearcher.Search(Weight weight, Filter filter, Collector collector)
   at Lucene.Net.Search.IndexSearcher.Search(Weight weight, Filter filter, Int32 nDocs, Sort sort, Boolean fillFields)
   at Lucene.Net.Search.IndexSearcher.Search(Weight weight, Filter filter, Int32 nDocs, Sort sort)
   at Dynamicweb.Indexing.Lucene.LuceneIndexProvider.SearchInternal(IQuery query, QuerySettings settings)
   at Dynamicweb.Indexing.Querying.QueryService.Query(IQuery query, QuerySettings settings)
   at CompiledRazorTemplates.Dynamic.RazorEngine_99a3a1ff4f69463c8aca97f8dc91c16d.Execute() in Z:\Sites\_dotFusion\www.ttonline.ro\Files\Templates\Designs\TTonlineNew\Paragraph\ArticleListBySection-Query.cshtml:line 405
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
   at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 2 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 3 @using Dynamicweb.Indexing.Querying 4 @using System.Text.RegularExpressions 5 @{ 6 init(); 7 } 8 9 @functions { 10 private int columnsWritten { get; set; } 11 private int columns { get; set; } 12 private string noPadding {get; set; } 13 private string noMargin{get; set; } 14 private string customStyle {get; set;} 15 16 public void init() 17 { 18 columnsWritten = Dynamicweb.Core.Converter.ToInt32(System.Web.HttpContext.Current.Items["currentColumns"]); 19 columns = GetInteger("Item.Width"); 20 noPadding = GetBoolean("Item.No_Padding") ? " no-padding" : ""; 21 noMargin = GetBoolean("Item.No_Margin") ? " no-margin" : ""; 22 customStyle = !string.IsNullOrEmpty(GetString("Item.CustomStyle")) ? " " + GetString("Item.CustomStyle"): ""; 23 System.Web.HttpContext.Current.Items["currentColumns"] = columnsWritten + GetInteger("Item.Width"); 24 } 25 26 public void Fluid() 27 { 28 columnsWritten = Dynamicweb.Core.Converter.ToInt32(System.Web.HttpContext.Current.Items["currentColumns"]); 29 columns = 12; 30 System.Web.HttpContext.Current.Items["currentColumns"] = columnsWritten + 12; 31 } 32 33 public string ColumnClass() 34 { 35 if (GetString("Item.WidthMobile") == "hide"){ 36 return "col-md-" + GetString("Item.Width") + " hidden-xs" + noPadding + noMargin + customStyle; 37 } else { 38 return "col-md-" + GetString("Item.Width") + " col-xs-" + GetString("Item.WidthMobile") + noPadding + noMargin +customStyle; 39 } 40 } 41 42 public string NewRow() 43 { 44 if (columns + columnsWritten > 12) 45 { 46 System.Web.HttpContext.Current.Items["currentColumns"] = columns; 47 return "</div><div class=\"row\">"; 48 } 49 else 50 { 51 return string.Empty; 52 } 53 54 } 55 } 56 @{ 57 58 string areaLayoutPath = "/Files/Templates/Designs/TTonline/"; 59 areaLayoutPath = areaLayoutPath.Substring(0, areaLayoutPath.LastIndexOf("/")); 60 61 string Layout_Style = GetString("Item.Area.Layout_Style.Value"), 62 Template_Style = GetString("Item.Area.Template_Style.Value"), 63 Sticky_Header = GetString("Item.Area.Sticky_Header.Value"), 64 Template_Color = GetString("Item.Area.Template_Color.Value"), 65 bodyStyle = Layout_Style + " " + Template_Style + " " + Sticky_Header + " " + Template_Color; 66 67 } 68 69 70 @functions { 71 72 //public class Session 73 //{ 74 //public string Id; 75 //public string Title; 76 //public DateTime StartTime; 77 //public DateTime EndTime; 78 //public bool IsBreak; 79 //public string Description; 80 //public string Type; 81 //public string Url; 82 //public string AllowedGroups; 83 //public string Location; 84 //public string Level; 85 //public int NumberOfSeats; 86 //public int NumberOfReservedSeats; 87 //public List<Speaker> 88 //Speakers; 89 //public List<Speaker> 90 //Moderatori; 91 //public LoopItem Item; 92 //} 93 94 public class Autor 95 { 96 public string Id; 97 public string Name; 98 public string Link; 99 public string Description; 100 public string Image; 101 public string Persoana; 102 } 103 104 public class Companie 105 { 106 public string Id; 107 public string Name; 108 public string Link; 109 public string Logo; 110 } 111 112 public class RelevantaGeografica 113 { 114 public string Id; 115 public string Name; 116 public string Link; 117 } 118 119 public class Tag 120 { 121 public string Id; 122 public string Name; 123 public string Link; 124 } 125 126 public class Sectiune 127 { 128 public string Id; 129 public string Name; 130 public string Link; 131 } 132 133 public class Editie 134 { 135 public string Id; 136 public string Name; 137 public string Link; 138 } 139 140 141 142 public static string StripHtmlTagByCharArray(string htmlString) 143 { 144 char[] array = new char[htmlString.Length]; 145 int arrayIndex = 0; 146 bool inside = false; 147 148 for (int i = 0; i < htmlString.Length; i++) 149 { 150 char let = htmlString[i]; 151 if (let == '<') 152 { 153 inside = true; 154 continue; 155 } 156 if (let == '>') 157 { 158 inside = false; 159 continue; 160 } 161 if (!inside) 162 { 163 array[arrayIndex] = let; 164 arrayIndex++; 165 } 166 } 167 return new string(array, 0, arrayIndex); 168 } 169 170 171 private List<Autor> GetAutori(string autoriList) 172 { 173 var autori = new List<Autor> (); 174 175 if(!string.IsNullOrEmpty(autoriList)){ 176 string[] itemIdList = autoriList.Split(','); 177 foreach (string itemId in itemIdList) 178 { 179 var autor = Dynamicweb.Content.Items.Item.GetItemById("Taxonomie_Autori", itemId); 180 if (autor != null) 181 { 182 autori.Add(new Autor 183 { 184 Id = itemId, 185 Name = autor["Name"] != null ? autor["Name"].ToString() : "", 186 Image = autor["Image"] != null ? autor["Image"].ToString() : "", 187 Description = autor["Description"] != null ? autor["Description"].ToString() : "", 188 Link = "/Default.aspx?ID=4250&autor="+itemId, 189 Persoana = autor["Persoana_Companie"] != null ? autor["Persoana_Companie"].ToString() : "" 190 }); 191 } 192 } 193 } 194 195 return autori; 196 } 197 198 private List<RelevantaGeografica> GetRelevanta(string relevantaList) 199 { 200 var relevante = new List<RelevantaGeografica> (); 201 202 if(!string.IsNullOrEmpty(relevantaList)){ 203 string[] itemIdList = relevantaList.Split(','); 204 foreach (string itemId in itemIdList) 205 { 206 var relevanta = Dynamicweb.Content.Items.Item.GetItemById("RelevantaGeografica", itemId); 207 if (relevanta != null) 208 { 209 relevante.Add(new RelevantaGeografica 210 { 211 Id = itemId, 212 Name = relevanta["Name"] != null ? relevanta["Name"].ToString() : "", 213 Link = "" 214 }); 215 } 216 } 217 } 218 219 return relevante; 220 } 221 222 223 private List<Sectiune> GetSectiuni(string sectiuniList) 224 { 225 var sectiuni = new List<Sectiune> (); 226 227 return sectiuni; 228 229 } 230 231 private List<Tag> GetTaguri(string taguriList) 232 { 233 var taguri = new List<Tag>(); 234 if(!string.IsNullOrEmpty(taguriList)){ 235 string[] itemIdList = taguriList.Split(','); 236 foreach (string itemId in itemIdList) 237 { 238 var tag = Dynamicweb.Content.Items.Item.GetItemById("Taxonomie_Taguri", itemId); 239 if (tag != null) 240 { 241 taguri.Add(new Tag 242 { 243 Id = itemId, 244 Name = tag["Name"] != null ? tag["Name"].ToString() : "", 245 Link = "Default.aspx?ID=4252&tag="+itemId 246 }); 247 } 248 } 249 } 250 return taguri; 251 252 } 253 254 255 private List<Companie> GetCompany(string companyList) 256 { 257 var companies = new List<Companie> (); 258 if(!string.IsNullOrEmpty(companyList)){ 259 string[] itemIdList = companyList.Split(','); 260 foreach (string itemId in itemIdList) 261 { 262 var companie = Dynamicweb.Content.Items.Item.GetItemById("Taxonomie_Companii", itemId); 263 if (companie != null) 264 { 265 companies.Add(new Companie 266 { 267 Id = itemId, 268 Name = companie["Name"] != null ? companie["Name"].ToString() : "", 269 Logo = companie["Logo"] != null ? companie["Logo"].ToString() : "", 270 Link = "/Default.aspx?ID=4271&companie="+itemId 271 }); 272 } 273 } 274 } 275 return companies; 276 277 } 278 279 280 281 282 283 } 284 285 @using Dna.ImageProcessor; 286 @using Dynamicweb.Frontend.Devices; 287 288 @{ 289 string designName = GetString("Template:DesignBaseUrl").Replace("/Files/Templates/Designs/", "").Replace("/", ""); 290 } 291 292 @functions{ 293 /// <summary> 294 /// Returns the URL for the given ImageSettings. 295 /// </summary> 296 /// <param name="settings">The ImageSettings used to generate the URL.</param> 297 private static string GetImage(ImageSettings settings) 298 { 299 return settings.ToUrl(); 300 } 301 302 /// <summary> 303 /// Returns the URL for the given ImageSettings. 304 /// </summary> 305 /// <param name="url">The URL to the image.</param> 306 /// <param name="settings">The ImageSettings used to generate the URL.</param> 307 public static string GetImage(string url, ImageSettings settings = null) 308 { 309 if (settings == null) 310 { 311 settings = new ImageSettings(); 312 } 313 settings.ImageUrl = url; 314 return GetImage(settings); 315 } 316 317 /// <summary> 318 /// Returns the URL for the given ImageSettings. 319 /// </summary> 320 /// <param name="url">The URL to the image.</param> 321 /// <param name="width">The requested width of the image.</param> 322 /// <param name="height">The requested height of the image.</param> 323 /// <param name="settings">The ImageSettings used to generate the URL.</param> 324 public static string GetImage(string url, int width, int height, ImageSettings settings = null) 325 { 326 if (settings == null) 327 { 328 settings = new ImageSettings(); 329 } 330 settings.Width = width; 331 settings.Height = height; 332 return GetImage(url, settings); 333 } 334 335 /// <summary> 336 /// Returns the URL for the given ImageSettings. 337 /// </summary> 338 /// <param name="url">The URL to the image.</param> 339 /// <param name="width">The requested width of the image.</param> 340 /// <param name="height">The requested height of the image.</param> 341 /// <param name="widthTablet">The requested width of the image for a tablet device.</param> 342 /// <param name="heightTablet">The requested height of the image for a tablet device.</param> 343 /// <param name="widthMobile">The requested width of the image for a mobile device.</param> 344 /// <param name="heightMobile">The requested height of the image for a mobile device.</param> 345 /// <param name="settings">The ImageSettings used to generate the URL.</param> 346 public static string GetImage(string url, int width, int height, int widthTablet, int heightTablet, int widthMobile, int heightMobile, ImageSettings settings = null) 347 { 348 var currentDevice = Dynamicweb.Frontend.PageView.Current().Device; 349 350 switch (currentDevice) 351 { 352 case DeviceType.Tablet: 353 width = widthTablet != 0 ? widthTablet : width; 354 height = heightTablet != 0 ? heightTablet : height; 355 break; 356 case DeviceType.Mobile: 357 width = widthMobile != 0 ? widthMobile : width; 358 height = heightMobile != 0 ? heightMobile : height; 359 break; 360 // default: Skip; just use existing width and height 361 } 362 if (settings == null) 363 { 364 settings = new ImageSettings(); 365 } 366 settings.ImageUrl = url; 367 settings.Width = width; 368 settings.Height = height; 369 return GetImage(settings); 370 } 371 } 372 @{ 373 374 int listSize = GetInteger("Item.ListSize") > 0 ? GetInteger("Item.ListSize") : 10; 375 var section = GetString("Item.Section"); 376 var featuredList = GetLoop("Item.Featured_Article"); 377 var itemDisplay= GetString("Item.Display"); 378 string customStyle = GetString("Item.CustomStyle"); 379 var featuredArticle = GetString("Item.Featured_Article"); 380 381 var queryService = Dynamicweb.Extensibility.ServiceLocator.Current.GetInstance<Dynamicweb.Indexing.Querying.IQueryService>(); 382 Dynamicweb.Indexing.Querying.QuerySettings querySettings = new Dynamicweb.Indexing.Querying.QuerySettings(); 383 384 List<string> includedArticles = new List<string>(); 385 List<string> excludedArticles = new List<string>(); 386 if(featuredList.Any()){ 387 388 foreach(LoopItem article in featuredList){ 389 390 includedArticles.Add(article.GetString("Item.Featured_Article.Id")); 391 392 } 393 394 //var myArray = myList.ToArray(); 395 396 } 397 398 399 System.Collections.Generic.Dictionary<string, object> parameters = new System.Collections.Generic.Dictionary<string, object>(); 400 parameters.Add("Sections", section); 401 402 querySettings.Parameters = parameters; 403 querySettings.Take = listSize; 404 405 Dynamicweb.Indexing.Querying.IQueryResult result = queryService.Query(queryService.LoadQuery("SQLIndexes", "ArticoleSQL.query"), querySettings); 406 407 IEnumerable<object> articleList = result.QueryResult; 408 } 409 410 @functions{ 411 412 public class Article 413 { 414 public string articleTitle { get; set; } 415 public List<Section> articleSections {get; set;} 416 public string articleImage {get; set;} 417 public string articleExcerpt {get; set;} 418 public List<Author> articleAutori {get; set;} 419 public DateTime articleDate {get; set;} 420 public string articleLink {get; set;} 421 public string articleVisits {get; set;} 422 public string articleSectionName {get; set;} 423 public string articleSectionId {get; set;} 424 } 425 426 public class Section 427 { 428 public string Name { get; set; } 429 public string Link { get; set; } 430 public string Id { get; set; } 431 } 432 433 public class Author 434 { 435 public string Name { get; set; } 436 public string Link { get; set; } 437 public string Id { get; set; } 438 } 439 440 441 } 442 443 444 445 446 447 @NewRow() 448 449 <div class="@ColumnClass() homepage-sectiune" style="margin-top: 25px; margin-bottom:0px"> 450 <h3 class="block-title"><span>@GetString("Item.ParagraphName")</span></h3> 451 @RenderFeaturedArticle() 452 @RenderArticleList(articleList,itemDisplay) 453 </div> 454 455 @helper RenderFeaturedArticle() 456 { 457 //int featuredArticle = GetInteger("Item.Featured_Article"); 458 var featuredArticles = GetLoop("Item.Featured_Article"); 459 if(featuredArticles.Any()){ 460 foreach(LoopItem i in featuredArticles){ 461 462 463 464 string mainImageRaw = i.GetString("Item.Featured_Article.ImaginePrincipala.Value"); 465 string mainImage = !string.IsNullOrEmpty(mainImageRaw) ? GetImage(mainImageRaw, 730, 355) + "&bgcolor=white" : "/Files/Images/NoImage/540x355.png"; 466 467 468 469 470 string mainTitle = i.GetString("Item.Featured_Article.Titlu.Value"); 471 var mainDate = i.GetDate("Item.Featured_Article.Data"); 472 string mainSummary = StripHtmlTagByCharArray(i.GetString("Item.Featured_Article.Sumar")); 473 string mainURL = i.GetString("Item.Featured_Article.Url"); 474 string mainAutori = i.GetString("Item.Featured_Article.Autori"); 475 string articleSectiune = i.GetString("Item.Featured_Article.SectiuneParinte"); 476 bool itemConditionVisits = i.GetBoolean("Item.Featured_Article.Vizite"); 477 string articleVisits = i.GetString("Item.Featured_Article.Visits.Value"); 478 int articleSectiuneID = i.GetInteger("Item.Featured_Article.SectiuneParinteId"); 479 string mainSections = ""; 480 481 482 List<Autor> articleAutori = GetAutori(mainAutori); 483 List<Sectiune> articleSections = GetSectiuni(mainSections); 484 485 <article class="news-block"> 486 <a href="@mainURL" class="overlay-link"> 487 488 489 <figure class=" "> 490 @if(!string.IsNullOrEmpty(i.GetString("Item.Featured_Article.ImaginePrincipala.Value"))){ 491 <img src="@mainImage" alt="@mainTitle" class="img-responsive" /> 492 }else{ 493 <img src="/Files/Images/NoImage/540x355.png" alt="@mainTitle" /> 494 } 495 </figure> 496 <a href='/Default.aspx?ID=@articleSectiuneID' class="bg@(articleSectiuneID) category">@articleSectiune</a> 497 </a> 498 499 500 @foreach (var articleSection in articleSections) 501 { 502 <a href="#" class="category bgcolor3">@articleSectiune</a> 503 } 504 <header class="news-details"> 505 <h3 class="news-title"> <a href='@mainURL' alt='@mainTitle'>@mainTitle</a></h3> 506 <p>@mainSummary</p> 507 <p class="simple-share">@Translate("articolde","de") 508 @foreach (var articleAutor in articleAutori) 509 { 510 <a href="@articleAutor.Link"><b>@articleAutor.Name</b></a> 511 } 512 - <span class="article-date"><i class="fa fa-clock-o"></i> @mainDate.ToString("dd/MM/yyyy")</span> 513 @if (itemConditionVisits) { 514 <span> - <i class="fa fa-eye"></i> @articleVisits vizualizari</span> 515 } 516 </p> 517 </header> 518 </article><!-- News block --> 519 520 521 522 } 523 } 524 } 525 526 @helper RenderArticleList(IEnumerable<object> articleList, string display) 527 { 528 //string listTemplate = "ItemPublisher/List/Loop-" + GetString("Item.Display") + ".cshtml"; 529 //ListOrderBy = "Data", 530 //ListOrderByDirection = "Descending" 531 //1col-image-nosummary 532 //1col-image-nosummary-small 533 //1col-image-summary 534 //2col-image-nosummary 535 //2col-noimage-nosummary 536 //3col-image-nosummary 537 //Slider-Articole 538 int paginaAutori = GetPageIdByNavigationTag("PaginaAutori"); 539 540 541 if(articleList != null && articleList.Any()){ 542 543 foreach(var resultObject in articleList){ 544 Article article = new Article(); 545 string[] autoriIDs = "".Split(','); 546 string[] autoriNames = "".Split(','); 547 List<string> sectionIDs = new List<string>(); 548 List<string> sectionNames = new List<string>(); 549 article.articleAutori = new List<Author>(); 550 article.articleSections = new List<Section>(); 551 552 IDictionary<string, object> dictionary = resultObject as IDictionary<string, object>; 553 if (dictionary != null) { 554 foreach (object key in dictionary.Keys) { 555 if ((key != null)) { 556 // something 557 //PageUrlName 558 559 if(key.ToString() == "PageMenuText"){ 560 article.articleTitle = dictionary["PageMenuText"].ToString(); 561 } 562 if(key.ToString() == "ItemImaginePrincipala"){ 563 article.articleImage = dictionary["ItemImaginePrincipala"].ToString(); 564 } 565 if(key.ToString() == "ItemSumar"){ 566 article.articleExcerpt = dictionary["ItemSumar"].ToString(); 567 } 568 if(key.ToString() == "ItemData"){ 569 article.articleDate = (DateTime)dictionary["ItemData"]; 570 } 571 if(key.ToString() == "PagePageID"){ 572 article.articleLink = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("Default.aspx?ID=" + dictionary["PagePageID"].ToString()); 573 } 574 if(key.ToString() == "ItemVisits"){ 575 article.articleVisits = dictionary["ItemVisits"].ToString(); 576 } 577 if(key.ToString() == "ItemAutori"){ 578 autoriIDs = (string[])dictionary["ItemAutori"]; 579 } 580 if(key.ToString() == "ItemAutoriName"){ 581 autoriNames = (string[])dictionary["ItemAutoriName"]; 582 } 583 if(key.ToString() == "ItemSectiuneParinte"){ 584 //sectionNames.Add(dictionary["ItemSectiuneParinte"].ToString()); 585 article.articleSectionName = dictionary["ItemSectiuneParinte"].ToString(); 586 } 587 if(key.ToString() == "ItemSectiuneParinteId"){ 588 //sectionIDs.Add(dictionary["ItemSectiuneParinteId"].ToString()); 589 article.articleSectionId = dictionary["ItemSectiuneParinteId"].ToString(); 590 } 591 592 //public List<Author> articleAutori {get; set;} 593 //public List<Section> articleSections {get; set;} 594 595 596 597 } 598 } 599 } 600 601 var authorList = autoriIDs.Zip(autoriNames, (s, i) => new { sv = s, iv = i }).ToList(); 602 foreach (var x in authorList) 603 { 604 article.articleAutori.Add(new Author{ 605 Name = x.iv.ToString(), 606 Link = "/Default.aspx?ID="+paginaAutori+"&autor="+x.sv, 607 Id = x.sv, 608 }); 609 610 } 611 612 if(display.Contains("1col-")) 613 { 614 @RenderOneCol(article,display); 615 } 616 else if (display.Contains("2col-")) 617 { 618 @RenderTwoCol(article,display); 619 } 620 else if (display.Contains("3col-")) 621 { 622 @RenderThreeCol(article,display); 623 } 624 else if (display.Contains("Slider-")) 625 { 626 @RenderSliderArticle(article,display); 627 } 628 629 } 630 } 631 632 633 } 634 635 636 @foreach(LoopItem j in GetLoop("Item.Featured_Article")){ 637 638 string articleSectiune = j.GetString("Item.Featured_Article.SectiuneParinte"); 639 int articleSectiuneID = j.GetInteger("Item.Featured_Article.SectiuneParinteId"); 640 641 <div class="col-md-12 col-xs-12 load-more"> 642 <a href="/Default.aspx?ID=@articleSectiuneID"><button type="button" class="btn btn-lg btn-block">@Translate("maimulte","Mai multe")</button></a> 643 </div> 644 645 } 646 647 @helper RenderOneCol(Article article, string display) 648 { 649 //1col-image-nosummary 650 //1col-image-nosummary-small 651 //1col-image-summary 652 string imageWidth= "350"; 653 string imageHeight= "230"; 654 string imageCrop = "5"; 655 string fillCanvasString = "&amp;FillCanvas=true"; 656 657 string articleTitle = article.articleTitle; 658 var articleDate = article.articleDate; 659 string articleLink = article.articleLink; 660 string articleImage = "/Admin/Public/GetImage.ashx?width=" + imageWidth + "&amp;height=" + imageHeight + "&amp;crop=" + imageCrop + "&amp;Compression=75" + fillCanvasString+ "&amp;DoNotUpscale=true&amp;image=" + article.articleImage ; 661 string articleExcerpt = article.articleExcerpt != null ? article.articleExcerpt : ""; 662 articleExcerpt = articleExcerpt != "" ? Regex.Replace(articleExcerpt, @"<[^>]*>", String.Empty) : articleExcerpt; 663 string articleVisits = article.articleVisits; 664 bool itemConditionVisits = true;//item.GetBoolean("ItemPublisher:Item.Vizite"); 665 string articleSectiune = article.articleSectionName; 666 string articleSectiuneID = article.articleSectionId; 667 // string smallImage = "/Admin/Public/GetImage.ashx?width=" + imageWidth + "&amp;height=" + imageHeight + "&amp;crop=" + imgCrop + "&amp;Compression=75" + fillCanvasString+ "&amp;DoNotUpscale=true&amp;image=" + image + imageFocalPointParameters; 668 List<Autor> articleAutori = new List<Autor>(); //article.articleAutori; 669 List<Sectiune> articleSections = new List<Sectiune>(); //article.articleSections; 670 if(article.articleAutori != null && article.articleAutori.Any() ){ 671 foreach(var autor in article.articleAutori){ 672 articleAutori.Add(new Autor{ 673 Id = autor.Id, 674 Name = autor.Name, 675 Link = autor.Link 676 }); 677 } 678 } 679 <article class="simple-post clearfix simple-post-2"> 680 <div class="simple-thumb"> 681 <a href="@articleLink"> 682 <div class=" "> 683 <img src="@articleImage" alt="@articleTitle" class="img-responsive" /> 684 </div> 685 </a> 686 </div> 687 688 <header> 689 <p class="simple-share"> 690 <span>@articleSectiune / </span> 691 @foreach (var articleSection in articleSections) 692 { 693 <a href="@articleSection.Link">@articleSection.Name</a> 694 } 695 @Translate("articolde","de") 696 @foreach (var articleAutor in articleAutori) 697 { 698 <a href="@articleAutor.Link"> @articleAutor.Name</a> 699 } 700 <span>- <i class="fa fa-clock-o"></i> @articleDate.ToString("D")</span> 701 @if (itemConditionVisits) { 702 <span><i class="fa fa-eye"></i> @articleVisits vizualizari</span> 703 } 704 </p> 705 <h3> 706 <a href="@articleLink">@articleTitle</a> 707 </h3> 708 </header> 709 </article> 710 } 711 712 @helper RenderTwoCol(Article article, string display) 713 { 714 //2col-image-nosummary 715 //2col-noimage-nosummary 716 string imageWidth= "350"; 717 string imageHeight= "230"; 718 string imageCrop = "5"; 719 string fillCanvasString = "&amp;FillCanvas=true"; 720 721 string articleTitle = article.articleTitle; 722 var articleDate = article.articleDate; 723 string articleLink = article.articleLink; 724 string articleImage = "/Admin/Public/GetImage.ashx?width=" + imageWidth + "&amp;height=" + imageHeight + "&amp;crop=" + imageCrop + "&amp;Compression=75" + fillCanvasString+ "&amp;DoNotUpscale=true&amp;image=" + article.articleImage ; 725 string articleExcerpt = article.articleExcerpt != null ? article.articleExcerpt : ""; 726 articleExcerpt = articleExcerpt != "" ? Regex.Replace(articleExcerpt, @"<[^>]*>", String.Empty) : articleExcerpt; 727 string articleVisits = article.articleVisits; 728 bool itemConditionVisits = true;//item.GetBoolean("ItemPublisher:Item.Vizite"); 729 string articleSectiune = article.articleSectionName; 730 string articleSectiuneID = article.articleSectionId; 731 // string smallImage = "/Admin/Public/GetImage.ashx?width=" + imageWidth + "&amp;height=" + imageHeight + "&amp;crop=" + imgCrop + "&amp;Compression=75" + fillCanvasString+ "&amp;DoNotUpscale=true&amp;image=" + image + imageFocalPointParameters; 732 List<Autor> articleAutori = new List<Autor>(); //article.articleAutori; 733 List<Sectiune> articleSections = new List<Sectiune>(); //article.articleSections; 734 if(article.articleAutori != null && article.articleAutori.Any() ){ 735 foreach(var autor in article.articleAutori){ 736 articleAutori.Add(new Autor{ 737 Id = autor.Id, 738 Name = autor.Name, 739 Link = autor.Link 740 }); 741 } 742 } 743 744 <div class="col-xs-6"> 745 <article class="news-block small-block" style="margin-bottom: 110px;"> 746 <a href="@articleLink" class="overlay-link"> 747 <figure class=" "> 748 <img src="@articleImage" alt="@articleTitle" class="img-responsive" /> 749 </figure> 750 </a> 751 752 <a href='/Default.aspx?ID=@articleSectiuneID' class="bg@(articleSectiuneID) category">@articleSectiune</a> 753 <header class="news-details"> 754 755 <h3 class="news-title"><a href="@articleLink">@articleTitle</a></h3> 756 <p class="simple-share"> 757 @foreach (var articleSection in articleSections) 758 { 759 <a href="#">@articleSectiune</a> 760 } 761 762 @Translate("articolde","de") 763 764 @{ 765 int counterAutori = 0; 766 foreach (var articleAutor in articleAutori) 767 { 768 <a href="@articleAutor.Link"> @articleAutor.Name @(counterAutori < articleAutori.Count() - 1 ? "," : "")</a> 769 ++counterAutori; 770 } 771 } 772 <br/> 773 <span><i class="fa fa-clock-o"></i> @articleDate.ToString("D")</span> 774 @if (itemConditionVisits) { 775 <span><i class="fa fa-eye"></i> @articleVisits vizualizari</span> 776 } 777 </p> 778 779 </header> 780 781 782 783 </article> 784 </div> 785 786 787 788 789 790 } 791 792 @helper RenderThreeCol(Article article, string display) 793 { 794 //3col-image-nosummary 795 //[Include file '../../Lists/1col-image-nosummary.cshtml' not found in 'Templates/Designs/TTonlineNew/Paragraph/ArticleListBySection-Query.cshtml'] 796 } 797 798 @helper RenderSliderArticle (Article article, string display) 799 { 800 //[Include file '../../Lists/1col-image-nosummary.cshtml' not found in 'Templates/Designs/TTonlineNew/Paragraph/ArticleListBySection-Query.cshtml'] 801 //Slider-Articole 802 } 803 804 805 806 807