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