Error executing template "Designs/Swift/Paragraph/COMM_SpeakerWall.cshtml"
Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: d. Path '', line 0, position 0.
   at Newtonsoft.Json.JsonTextReader.ParseValue()
   at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
   at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
   at CompiledRazorTemplates.Dynamic.RazorEngine_53cf27d86c9b4fa2bac56e0fd55f3078.Execute() in C:\inetpub\wwwroot\directions2023\Files\Templates\Designs\Swift\Paragraph\COMM_SpeakerWall.cshtml:line 259
   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.<RunCompile>b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
   at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 2 @using Dynamicweb.Frontend.Navigation 3 @using Dynamicweb.Content.Items 4 @using Dynamicweb.Frontend 5 @using System.Web.Helpers 6 @using System.Web 7 @using System.Text 8 @using System.Net 9 @using System.Linq 10 @using System 11 @using System.Globalization 12 @using Newtonsoft.Json 13 @using Newtonsoft.Json.Linq 14 15 16 @functions{ 17 18 19 public class Root 20 { 21 public List<Session> sessions {get; set;} 22 public List<Speaker> speakers {get; set;} 23 public List<Category> categories {get; set;} 24 } 25 26 public class Session 27 { 28 public string id {get; set;} 29 public string title {get; set;} 30 public string description {get; set;} 31 public DateTime? startsAt {get; set;} 32 public DateTime? endsAt {get; set;} 33 public bool isServiceSession {get; set;} 34 public bool isPlenumSession {get; set;} 35 public List<string> speakers {get; set;} 36 public List<int> categoryItems {get; set;} 37 public List<QuestionAnswers> questionAnswers {get; set;} 38 public int? roomId {get; set;} 39 //liveUrl 40 //recordingUrl 41 } 42 43 public class categoryItems 44 { 45 public string name { get; set; } 46 } 47 // For Speaker class 48 public class sessions 49 { 50 public int id { get; set; } 51 public string name { get; set; } 52 } 53 // For Speaker class 54 public class categories 55 { 56 public int id { get; set; } 57 public string name { get; set; } 58 public List<Item> categoryItems {get; set;} 59 public int sort { get; set; } 60 } 61 62 public class Speaker 63 { 64 public string id {get; set;} 65 public string firstName {get; set;} 66 public string lastName {get; set;} 67 public string bio {get; set;} 68 public string tagLine {get; set;} 69 public string profilePicture {get; set;} 70 public bool isTopSpeaker {get; set;} 71 public List<Link> links {get; set;} 72 73 public List<sessions> sessions {get; set;} 74 public List<categories> categories { get; set; } 75 public string fullName {get; set;} 76 public List<int> categoryItems {get; set;} 77 public List<QuestionAnswers> questionAnswers {get; set;} 78 public int displayPriority {get; set;} 79 } 80 81 public class Category 82 { 83 public int id {get; set;} 84 public string title {get; set;} 85 public List<Item> items {get; set;} 86 public int sort {get; set;} 87 public string type {get; set;} 88 } 89 90 public class Link 91 { 92 public string title {get; set;} 93 public string url {get; set;} 94 public string linType {get; set;} 95 } 96 97 public class Item 98 { 99 public int id {get; set;} 100 public string name {get; set;} 101 public int sort {get; set;} 102 } 103 104 public class Timeslot 105 { 106 public string Code {get; set;} 107 public DateTime? DateAndStart {get; set;} 108 public DateTime? SlotDate {get; set;} 109 public DateTime SlotDuration {get; set;} 110 public string SlotEnd {get; set;} 111 public string SlotStart {get; set;} 112 public string Status {get; set;} 113 114 } 115 116 public class Attribute 117 { 118 public string categoryTitle {get; set;} 119 public int categoryId {get; set;} 120 public int categorySort {get; set;} 121 public int attributeId {get; set;} 122 public string attributeName {get; set;} 123 public int attributeSort {get; set;} 124 } 125 126 public string GetTimeslot(Session session) 127 { 128 string code = session.startsAt != null && session.endsAt != null ? session.startsAt.ToString().GetHashCode().ToString("x") + session.endsAt.ToString().GetHashCode().ToString("x") : "UNDEFINED"; 129 return code; 130 } 131 132 public class QuestionAnswers 133 { 134 public string questionId {get; set;} 135 public string answerValue {get; set;} 136 } 137 138 static string GetJson(string address) 139 { 140 using (var client = new WebClient()) 141 { 142 client.Headers.Add("Content-Type", "application/json"); 143 try 144 { 145 return client.DownloadString(address); 146 } 147 catch (InvalidCastException e) 148 { 149 return ""; 150 } 151 } 152 } 153 154 string makeStringReadable(string data){ 155 string myStr = data; 156 byte[] bytes = Encoding.Default.GetBytes(myStr); 157 return Encoding.UTF8.GetString(bytes); 158 } 159 //we define variables for acces in other helpers 160 string theme = ""; 161 bool showSummary = false; 162 string sessionDetailsPage = ""; 163 } 164 165 166 @{ 167 var parentPages = Dynamicweb.Content.Services.Pages.GetAncestors(Pageview.Page.ID, true); 168 Dynamicweb.Content.Page rootPage = parentPages.Any() ? parentPages.Where(x => x.ItemType == "COMM_EventSection").FirstOrDefault() : new Dynamicweb.Content.Page(); 169 theme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("Theme")) && Model.Item.GetRawValueString("Theme") != "no-theme" ? " theme " + Model.Item.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : ""; 170 171 var item = Dynamicweb.Content.Services.Items.GetItem(rootPage.ItemType, rootPage.ItemId); 172 var sessionizeCode = item?["SessionizeCode"].ToString() ?? ""; 173 var parentTheme = !string.IsNullOrEmpty(item?["Theme"].ToString()) ? "theme " + item?["Theme"].ToString() : ""; 174 var eventCode = !string.IsNullOrEmpty(Model.Item?.GetString("SessionizeCode")) ? Model.Item?.GetString("SessionizeCode") : sessionizeCode; 175 sessionDetailsPage = !string.IsNullOrEmpty(Model.Item?.GetString("SessionDetailPage")) ? Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(Model.Item?.GetString("SessionDetailPage")) : ""; 176 177 theme = theme != "" ? theme : parentTheme; 178 179 showSummary = Model.Item.GetBoolean("ShowSummaryOnly"); 180 181 string eyebrow = Model.Item.GetString("Eyebrow", string.Empty).Replace(System.Environment.NewLine, "<br>"); 182 string eyebrowHeadingLevel = Model.Item.GetString("EyebrowHeadingLevel", "h3"); 183 string eyebrowFontSize = Model.Item.GetRawValueString("EyebrowFontSize", "h5"); 184 string eyebrowColor = Model.Item.GetString("EyebrowColor", "text-inherit"); 185 string eyebrowTextOpacity = Model.Item.GetString("EyebrowTextOpacity", "opacity-100"); 186 string eyebrowCssClass = Model.Item.GetString("EyebrowCssClass", string.Empty); 187 string eyebrowSpacingBottomDesktop = Model.Item.GetRawValueString("EyebrowSpacingBottomDesktop", "default"); 188 eyebrowSpacingBottomDesktop = eyebrowSpacingBottomDesktop != "default" ? eyebrowSpacingBottomDesktop : string.Empty; 189 string eyebrowSpacingBottomMobile = Model.Item.GetRawValueString("EyebrowSpacingBottomMobile", "default"); 190 eyebrowSpacingBottomMobile = eyebrowSpacingBottomMobile != "default" ? eyebrowSpacingBottomMobile : string.Empty; 191 192 string title = Model.Item.GetString("Title", string.Empty).Replace(System.Environment.NewLine, "<br>"); 193 string titleHeadingLevel = Model.Item.GetString("TitleHeadingLevel", "h2"); 194 string titleFontSize = Model.Item.GetRawValueString("TitleFontSize", "h2"); 195 string titleColor = Model.Item.GetString("TitleColor", "text-inherit"); 196 string titleTextOpacity = Model.Item.GetString("TitleTextOpacity", "opacity-100"); 197 string titleCssClass = Model.Item.GetString("TitleCssClass", string.Empty); 198 string titleSpacingBottomDesktop = Model.Item.GetRawValueString("TitleSpacingBottomDesktop", "default"); 199 titleSpacingBottomDesktop = titleSpacingBottomDesktop != "default" ? titleSpacingBottomDesktop : string.Empty; 200 string titleSpacingBottomMobile = Model.Item.GetRawValueString("TitleSpacingBottomMobile", "default"); 201 titleSpacingBottomMobile = titleSpacingBottomMobile != "default" ? titleSpacingBottomMobile : string.Empty; 202 203 string subtitle = Model.Item.GetString("Subtitle", string.Empty).Replace(System.Environment.NewLine, "<br>"); 204 string subtitleHeadingLevel = Model.Item.GetString("SubtitleHeadingLevel", "p"); 205 string subtitleFontSize = Model.Item.GetRawValueString("SubtitleFontSize", "fs-5"); 206 string subtitleColor = Model.Item.GetString("SubtitleColor", "text-inherit"); 207 string subtitleTextOpacity = Model.Item.GetString("SubtitleTextOpacity", "opacity-100"); 208 string subtitleCssClass = Model.Item.GetString("SubtitleCssClass", string.Empty); 209 string subtitleSpacingBottomDesktop = Model.Item.GetRawValueString("SubtitleSpacingBottomDesktop", "default"); 210 subtitleSpacingBottomDesktop = subtitleSpacingBottomDesktop != "default" ? subtitleSpacingBottomDesktop : string.Empty; 211 string subtitleSpacingBottomMobile = Model.Item.GetRawValueString("SubtitleSpacingBottomMobile", "default"); 212 subtitleSpacingBottomMobile = subtitleSpacingBottomMobile != "default" ? subtitleSpacingBottomMobile : string.Empty; 213 214 //Button 1 215 var button1Link = Model.Item.GetLink("Button1Link"); 216 var button1Label = Model.Item.GetString("Button1Label", string.Empty); 217 var button1Icon = Model.Item.GetRawValueString("Button1Icon"); 218 var button1IconPosition = Model.Item.GetRawValueString("Button1IconPosition", "right"); 219 var button1Style = Model.Item.GetRawValueString("Button1Style", "btn-primary"); 220 221 //Button 2 222 var button2Link = Model.Item.GetLink("Button2Link"); 223 var button2Label = Model.Item.GetString("Button2Label", string.Empty); 224 var button2Icon = Model.Item.GetRawValueString("Button2Icon"); 225 var button2IconPosition = Model.Item.GetRawValueString("Button2IconPosition", "right"); 226 var button2Style = Model.Item.GetRawValueString("Button2Style", "btn-primary"); 227 228 string contentAlignment = "align-items-center justify-content-center"; 229 string contentTextAlignment = "text-start"; 230 231 string renderTextCss = showSummary ? "d-none" : ""; 232 233 234 } 235 236 <div class="h-100 item_@Model.Item.SystemName.ToLower()"> 237 <div class="@renderTextCss"> 238 @if (!string.IsNullOrEmpty(eyebrow)) 239 { 240 @RenderContent(eyebrow, eyebrowHeadingLevel, eyebrowFontSize, eyebrowColor, eyebrowTextOpacity, eyebrowSpacingBottomDesktop, eyebrowSpacingBottomMobile, eyebrowCssClass) 241 } 242 243 @if (!string.IsNullOrEmpty(title)) 244 { 245 @RenderContent(title, titleHeadingLevel, titleFontSize, titleColor, titleTextOpacity, titleSpacingBottomDesktop, titleSpacingBottomMobile, titleCssClass) 246 } 247 248 @if (!string.IsNullOrEmpty(subtitle)) 249 { 250 @RenderContent(subtitle, subtitleHeadingLevel, subtitleFontSize, subtitleColor, subtitleTextOpacity, subtitleSpacingBottomDesktop, subtitleSpacingBottomMobile, subtitleCssClass) 251 } 252 </div> 253 254 @if (!string.IsNullOrEmpty(eventCode)) 255 { 256 257 string sessionizeSpeakers = "https://sessionize.com/api/v2/"+ sessionizeCode + "/view/Speakers"; 258 string response = GetJson(sessionizeSpeakers).ToString(); 259 var speakers = JsonConvert.DeserializeObject<List<Speaker>>(response); 260 261 //extend speakers with DisplayPriority property 262 List<Speaker> updatedSpeakers = new List<Speaker>(); 263 foreach(var speaker in speakers) 264 { 265 var speakerCategories = speaker.categories; 266 var speakerDisplayPriorities = speakerCategories != null ? speakerCategories.Where(c => c.name =="DisplayPriority")?.FirstOrDefault() : new categories(); 267 var categoryItems = speakerDisplayPriorities != null ? speakerDisplayPriorities.categoryItems : new List<Item>(); 268 Item priority = categoryItems.Any() ? categoryItems.FirstOrDefault() : new Item();//speaker.categories != null ? speaker.categories.Where(c => c.name =="DisplayPriority")?.FirstOrDefault().categoryItems?.FirstOrDefault() : new Item(); 269 //var priority = speaker.categories.Where(c => c.name =="DisplayPriority")?.FirstOrDefault().categoryItems?.FirstOrDefault();// : new Item(); 270 271 272 Speaker updatedSpeaker = new Speaker(); 273 updatedSpeaker = speaker; 274 updatedSpeaker.displayPriority = priority.name != null ? Dynamicweb.Core.Converter.ToInt32(priority.name) : 99; 275 updatedSpeakers.Add(updatedSpeaker); 276 } 277 278 //sort speakers by display priority 279 speakers = updatedSpeakers.OrderBy(x=>x.displayPriority).ThenBy(x=>x.lastName).ToList(); 280 281 @RenderSpeakers(speakers , showSummary , theme , sessionDetailsPage) 282 283 } 284 else 285 { 286 <div class="alert alert-info" role="alert"> 287 <span>@Translate("Missing sessionize Id")</span> 288 </div> 289 } 290 </div> 291 292 @helper RenderSpeakers(System.Collections.Generic.List<Speaker> speakers, bool showSummary , string theme , string sessionDetailsPage) 293 { 294 string iconBadgeWidth = Model.Item.GetString("IconBadgeWidth"); 295 string iconBadgeHeight = Model.Item.GetString("IconBadgeHeight"); 296 297 var summaryCss = showSummary ? "grid-auto-rows-1-fr" : ""; 298 var gridCss = !showSummary ? "grid" : "container-lg p-0"; 299 int categoryParameter = !string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString["Category"]) ? 300 Convert.ToInt32(Dynamicweb.Context.Current.Request.QueryString["Category"]) : 0; 301 302 var filtersList = new string []{"SpeakerType"}; 303 304 bool hideSpeakerCategory = Model.Item.GetBoolean("HideSpeakerCategory"); 305 306 List<Attribute> sessionizeAttributes = new List<Attribute>(); 307 308 foreach (var speaker in speakers) 309 { 310 foreach(var category in speaker.categories) 311 { 312 foreach(var element in category.categoryItems) 313 { 314 if(category.name == "SpeakerType") 315 { 316 Attribute attribute = new Attribute(); 317 attribute.categoryTitle = category.name; 318 attribute.categoryId = category.id; 319 attribute.categorySort = category.sort; 320 attribute.attributeId = element.id; 321 attribute.attributeName = element.name; 322 // attribute.attributeSort = element.sort; 323 sessionizeAttributes.Add(attribute); 324 } 325 } 326 } 327 } 328 329 //Remove grouping 330 var groupedAttributes = sessionizeAttributes.GroupBy( 331 attr => attr.categoryTitle, 332 (key, g) => new { Title = key, Items = g.GroupBy(x => x.attributeId).Select(x => x.First()).ToList() }); 333 334 335 string categoryId = Model.Item.GetRawValueString("CategoryId"); 336 337 if (!showSummary && string.IsNullOrEmpty(categoryId)) 338 { 339 <div class="grid mb-3"> 340 @{ 341 Uri url = Dynamicweb.Context.Current.Request.Url; 342 var query = System.Web.HttpUtility.ParseQueryString(url.Query); 343 query.Remove("Category"); 344 var link = new UriBuilder( url ) { Query = query.ToString() }.Uri; 345 } 346 @foreach (var attrCollection in groupedAttributes) 347 { 348 foreach (var attr in attrCollection.Items.Where(item => item.attributeId == categoryParameter)) 349 { 350 <a href="@link" class="px-0 g-col-lg-3 g-col-12 btn btn-link btn-sm d-flex justify-content-between align-items-center"> 351 <span>@attrCollection.Title : @attr.attributeName</span> 352 <span class="btn-close btn-sm" aria-label="Close"></span> 353 </a> 354 } 355 } 356 </div> 357 <div class="grid mb-4"> 358 <div class="g-col-lg-3 g-col-12"> 359 <div class="form-group"> 360 <label class="fw-bold mb-2" for="searchSpeaker">@Translate("Search")</label> 361 <input type="search" class="form-control" id="searchSpeaker" placeholder="@Translate("Enter speaker name...")"></input> 362 </div> 363 </div> 364 365 <div class="g-col-lg-3 g-col-12"> 366 <label class="fw-bold mb-2" for="Category">@Translate("Category")</label> 367 <select class="form-control filter-session-ref filter-session-trigger speaker-category-dropdown-filter" id="Category" name="Category"> 368 <option value="">@Translate("Choose category")</option> 369 @foreach (var attrCollection in groupedAttributes) 370 { 371 @*<optgroup label="@attrCollection.Title">*@ 372 foreach (var attr in attrCollection.Items) 373 { 374 var selectedAttr = attr.attributeId == categoryParameter ? "selected" : ""; 375 <option value="@attr.attributeId" @selectedAttr>@attr.attributeName</option> 376 } 377 @*</optgroup>*@ 378 } 379 </select> 380 </div> 381 382 383 <div class="g-col-lg-3 g-col-12 d-flex justify-content-start align-items-end"> 384 <a class="btn btn-link p-0 clear-all-speaker-filters" data-params-to-remove="Category">@Translate("Clear all")</a> 385 </div> 386 </div> 387 } 388 389 390 if (speakers.Any()) 391 { 392 //speakers = categoryParameter != 0 && !showSummary ? 393 //speakers.Where(speaker => speaker.categories.Any(i => i.categoryItems.Any(cat => cat.id.Equals(categoryParameter)))).ToList() : 394 //speakers.OrderBy(speaker => speaker.isTopSpeaker ? 0 : 1).ToList(); 395 speakers = !string.IsNullOrEmpty(categoryId) ? speakers.Where(speaker => speaker.categories.Any(i => i.categoryItems.Any(cat => cat.id.ToString().Equals(categoryId)))).ToList() : speakers; 396 int summaryItemsCount = Model.Item.GetInt32("SummaryItemsCount"); 397 398 int displayCount = showSummary ? summaryItemsCount : speakers.Count(); 399 400 if (showSummary) 401 { 402 string eyebrow = Model.Item.GetString("Eyebrow", string.Empty).Replace(System.Environment.NewLine, "<br>"); 403 string eyebrowHeadingLevel = Model.Item.GetString("EyebrowHeadingLevel", "h3"); 404 string eyebrowFontSize = Model.Item.GetRawValueString("EyebrowFontSize", "h5"); 405 string eyebrowColor = Model.Item.GetString("EyebrowColor", "text-inherit"); 406 string eyebrowTextOpacity = Model.Item.GetString("EyebrowTextOpacity", "opacity-100"); 407 string eyebrowCssClass = Model.Item.GetString("EyebrowCssClass", string.Empty); 408 string eyebrowSpacingBottomDesktop = Model.Item.GetRawValueString("EyebrowSpacingBottomDesktop", "default"); 409 eyebrowSpacingBottomDesktop = eyebrowSpacingBottomDesktop != "default" ? eyebrowSpacingBottomDesktop : string.Empty; 410 string eyebrowSpacingBottomMobile = Model.Item.GetRawValueString("EyebrowSpacingBottomMobile", "default"); 411 eyebrowSpacingBottomMobile = eyebrowSpacingBottomMobile != "default" ? eyebrowSpacingBottomMobile : string.Empty; 412 413 string title = Model.Item.GetString("Title", string.Empty).Replace(System.Environment.NewLine, "<br>"); 414 string titleHeadingLevel = Model.Item.GetString("TitleHeadingLevel", "h2"); 415 string titleFontSize = Model.Item.GetRawValueString("TitleFontSize", "h2"); 416 string titleColor = Model.Item.GetString("TitleColor", "text-inherit"); 417 string titleTextOpacity = Model.Item.GetString("TitleTextOpacity", "opacity-100"); 418 string titleCssClass = Model.Item.GetString("TitleCssClass", string.Empty); 419 string titleSpacingBottomDesktop = Model.Item.GetRawValueString("TitleSpacingBottomDesktop", "default"); 420 titleSpacingBottomDesktop = titleSpacingBottomDesktop != "default" ? titleSpacingBottomDesktop : string.Empty; 421 string titleSpacingBottomMobile = Model.Item.GetRawValueString("TitleSpacingBottomMobile", "default"); 422 titleSpacingBottomMobile = titleSpacingBottomMobile != "default" ? titleSpacingBottomMobile : string.Empty; 423 424 string subtitle = Model.Item.GetString("Subtitle", string.Empty).Replace(System.Environment.NewLine, "<br>"); 425 string subtitleHeadingLevel = Model.Item.GetString("SubtitleHeadingLevel", "p"); 426 string subtitleFontSize = Model.Item.GetRawValueString("SubtitleFontSize", "fs-5"); 427 string subtitleColor = Model.Item.GetString("SubtitleColor", "text-inherit"); 428 string subtitleTextOpacity = Model.Item.GetString("SubtitleTextOpacity", "opacity-100"); 429 string subtitleCssClass = Model.Item.GetString("SubtitleCssClass", string.Empty); 430 string subtitleSpacingBottomDesktop = Model.Item.GetRawValueString("SubtitleSpacingBottomDesktop", "default"); 431 subtitleSpacingBottomDesktop = subtitleSpacingBottomDesktop != "default" ? subtitleSpacingBottomDesktop : string.Empty; 432 string subtitleSpacingBottomMobile = Model.Item.GetRawValueString("SubtitleSpacingBottomMobile", "default"); 433 subtitleSpacingBottomMobile = subtitleSpacingBottomMobile != "default" ? subtitleSpacingBottomMobile : string.Empty; 434 435 436 //Button 1 437 var button1Link = Model.Item.GetLink("Button1Link"); 438 var button1Label = Model.Item.GetString("Button1Label", string.Empty); 439 var button1Icon = Model.Item.GetRawValueString("Button1Icon"); 440 var button1IconPosition = Model.Item.GetRawValueString("Button1IconPosition", "right"); 441 var button1Style = Model.Item.GetRawValueString("Button1Style", "btn-primary"); 442 443 //Button 2 444 var button2Link = Model.Item.GetLink("Button2Link"); 445 var button2Label = Model.Item.GetString("Button2Label", string.Empty); 446 var button2Icon = Model.Item.GetRawValueString("Button2Icon"); 447 var button2IconPosition = Model.Item.GetRawValueString("Button2IconPosition", "right"); 448 var button2Style = Model.Item.GetRawValueString("Button2Style", "btn-primary"); 449 450 string contentAlignment = "align-items-center justify-content-center"; 451 string contentTextAlignment = "text-start"; 452 453 454 var count = 0; 455 speakers = speakers.Where((speaker, index) => index < displayCount).ToList(); 456 457 var summarySpeakers = speakers.Select((speaker, index) => new {speaker, index}) 458 .GroupBy(g => g.index <= 5, 459 (key, g) => new { Title = key, Items = g.ToList() }); 460 461 <div class="@gridCss"> 462 <div id="Slider_@Model.ID" class="swiffy-slider slider-nav-visible slider-nav-round speaker-wall-preview"> 463 <div class="g-col-12 w-100 d-flex align-items-end justify-content-between gap-3 flex-wrap mb-4"> 464 <div> 465 @if (!string.IsNullOrEmpty(eyebrow)) 466 { 467 @RenderContent(eyebrow, eyebrowHeadingLevel, eyebrowFontSize, eyebrowColor, eyebrowTextOpacity, eyebrowSpacingBottomDesktop, eyebrowSpacingBottomMobile, eyebrowCssClass) 468 } 469 470 @if (!string.IsNullOrEmpty(title)) 471 { 472 @RenderContent(title, titleHeadingLevel, titleFontSize, titleColor, titleTextOpacity, titleSpacingBottomDesktop, titleSpacingBottomMobile, titleCssClass) 473 } 474 475 @if (!string.IsNullOrEmpty(subtitle)) 476 { 477 @RenderContent(subtitle, subtitleHeadingLevel, subtitleFontSize, subtitleColor, subtitleTextOpacity, subtitleSpacingBottomDesktop, subtitleSpacingBottomMobile, subtitleCssClass) 478 } 479 </div> 480 <div class="d-flex gap-3 align-items-stretch"> 481 <div> 482 @if (button1Link is object || button2Link is object) 483 { 484 if (contentTextAlignment == "text-start") 485 { 486 contentAlignment = "justify-content-start"; 487 } 488 if (contentTextAlignment == "text-center") 489 { 490 contentAlignment = "justify-content-center"; 491 } 492 if (contentTextAlignment == "text-end") 493 { 494 contentAlignment = "justify-content-end"; 495 } 496 497 <div class="d-flex flex-wrap @(contentAlignment) gap-3"> 498 @if (button1Link is object && !string.IsNullOrEmpty(button1Label)) 499 { 500 button1Style = button1Style + " rounded-7 btn-sm"; 501 @RenderButton(button1Link, button1Label, button1Style, button1Icon, button1IconPosition) 502 } 503 504 @if (button2Link is object && !string.IsNullOrEmpty(button1Label)) 505 { 506 @RenderButton(button2Link, button2Label, button2Style, button2Icon, button2IconPosition) 507 } 508 </div> 509 } 510 </div> 511 <div class="d-flex"> 512 <button type="button" title="@Translate("Previous slide")" class="btn btn-primary slider-nav position-relative p-lg-3 rounded-7-start bg-black text-white" style="z-index:1;max-height: 2.75em;min-height: 2.75em"> 513 <span class="icon-auto"> 514 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-left"><line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline></svg> 515 </span> 516 <span class="visually-hidden">@Translate("Previous slide")</span> 517 </button> 518 <button type="button" title="@Translate("Next slide")" class="btn btn-primary slider-nav slider-nav-next position-relative p-lg-3 rounded-7-end bg-black text-white" style="z-index:1;max-height: 2.75em;min-height: 2.75em"> 519 <span class="icon-auto"> 520 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-right"><line x1="5" y1="12" x2="19" y2="12"></line><polyline points="12 5 19 12 12 19"></polyline></svg> 521 </span> 522 <span class="visually-hidden">@Translate("Next slide")</span> 523 </button> 524 </div> 525 </div> 526 </div> 527 528 529 <ul class="slider-container"> 530 @foreach (var _i in summarySpeakers) 531 { 532 <li class="grid speaker-slider"> 533 @foreach (var _item in _i.Items.Take(6)) 534 { 535 count++; 536 string viewSpeakerInfoTranslate = Translate("View") + " " + _item.speaker.fullName + " " + Translate("info"); 537 string speakerName = _item.speaker.fullName != null ? _item.speaker.fullName.ToString() : ""; 538 string speakerBio = _item.speaker.bio != null ? _item.speaker.bio.ToString() : ""; 539 string speakerTagLine = _item.speaker.tagLine != null ? _item.speaker.tagLine.ToString() : ""; 540 string speakerProfilePicture = _item.speaker.profilePicture != null ? _item.speaker.profilePicture.ToString() : ""; 541 var sessionsTranslate = _item.speaker.sessions.Count() > 1 ? Translate("Sessions") : Translate("Session"); 542 var speakerTypeList = _item.speaker.categories.Where(cat => cat.name == "SpeakerType") ?? null; 543 544 <div class="speaker h-100 grid grid-12 gap-lg-4 @theme gap-2 position-relative rounded-7"> 545 <div class="h-100 p-4 g-col-md-6 g-col-12 order-last order-md-first d-flex flex-column gap-1 max-h-15-em"> 546 <a href="#" class="btn btn-link p-0 text-decoration-none" title="@viewSpeakerInfoTranslate" onclick="event.preventDefault(); new bootstrap.Modal(document.getElementById('SpeakerModal_@(count - 1)')).show()"> 547 <h5 class="text-start">@makeStringReadable(speakerName)</h5> 548 </a> 549 <p class="fs-7 m-0">@speakerTagLine</p> 550 @if (speakerTypeList != null) 551 { 552 <div class="d-flex gap-2 mt-2"> 553 @foreach (var cat in speakerTypeList) 554 { 555 foreach (var c in cat.categoryItems) 556 { 557 string badgePath = "/Files/Images/"; 558 559 if (c.name.Equals("Microsoft")) 560 { 561 badgePath += "microsoftIconBadge.png"; 562 } 563 else if (c.name.Equals("Sponsor")) 564 { 565 badgePath += "sponsorIconBadge.png"; 566 } 567 else if (c.name.Equals("MVP")) 568 { 569 badgePath += "mvpIconBadge.png"; 570 } 571 else if (c.name.Equals("Directions")) 572 { 573 badgePath += "directionsIconBadge.png"; 574 } 575 else 576 { 577 badgePath = badgePath; 578 } 579 580 <img height="@iconBadgeHeight" width="@iconBadgeWidth" src="@badgePath" class="rounded-0"></img> 581 } 582 } 583 </div> 584 } 585 </div> 586 <div class="h-100 g-col-md-6 g-col-12 overflow-hidden rounded-7"> 587 <a class="btn btn-link p-0" title="@viewSpeakerInfoTranslate" onclick="new bootstrap.Modal(document.getElementById('SpeakerModal_@(count - 1)')).show()"> 588 <img src="@speakerProfilePicture" class="w-100 img-fluid rounded-7"></img> 589 </a> 590 </div> 591 </div> 592 } 593 </li> 594 } 595 </ul> 596 597 @for (int x = 0; x < displayCount; x++) 598 { 599 string viewSpeakerInfoTranslate = Translate("View") + " " + speakers[x].fullName + " " + Translate("info"); 600 string speakerName = speakers[x].fullName != null ? speakers[x].fullName.ToString() : ""; 601 string speakerBio = speakers[x].bio != null ? speakers[x].bio.ToString() : ""; 602 string speakerTagLine = speakers[x].tagLine != null ? speakers[x].tagLine.ToString() : ""; 603 string speakerProfilePicture = speakers[x].profilePicture != null ? speakers[x].profilePicture.ToString() : ""; 604 string speakerCategories = speakers[x].categoryItems != null ? String.Join(",", speakers[x].categoryItems) : ""; 605 var sessionsTranslate = speakers[x].sessions.Count() > 1 ? Translate("Sessions") : Translate("Session"); 606 var speakerTypeList = speakers[x].categories.Where(cat => cat.name == "SpeakerType") ?? null; 607 608 <div class="modal fade modal-xl" id="SpeakerModal_@x"> 609 <div class="modal-dialog"> 610 <div class="modal-content @theme rounded-7"> 611 <div class="modal-body p-0" id="SpeakerModalBodyContainer_@x"> 612 <div class="close-container position-absolute p-3 end-0 m-3 bg-white rounded-7 z-index-9"> 613 <button type="button" class="btn-close bg-dark z-index-9" data-bs-dismiss="modal" aria-label="Close"></button> 614 </div> 615 <div class="grid @theme gap-0 rounded-7"> 616 <div class="h-100 g-col-lg-7 g-col-12 order-last order-md-first"> 617 <div class="h-100 p-4 overflow-auto max-h-30-em"> 618 <div> 619 <h5>@makeStringReadable(speakerName)</h5> 620 <p>@speakerTagLine</p> 621 </div> 622 <div class="d-flex flex-column gap-3 justify-content-between overflow-auto max-h-15-em"> 623 <p class="m-0">@makeStringReadable(speakerBio)</p> 624 </div> 625 <div class="mt-4 d-grid"> 626 <p class="m-0 fw-bold">@sessionsTranslate</p> 627 @foreach (var session in speakers[x].sessions) 628 { 629 if (!string.IsNullOrEmpty(sessionDetailsPage)) 630 { 631 var sessionLink = sessionDetailsPage.IndexOf("?") > 0 ? sessionDetailsPage + "&session=" + session.id : sessionDetailsPage + "?session=" + session.id; 632 <a class="btn btn-link text-start p-0 mb-2" title="@session.name" href="@sessionLink"> 633 @session.name 634 </a> 635 } 636 else 637 { 638 <p class="mb-2">@session.name</p> 639 } 640 } 641 </div> 642 @if (speakerTypeList != null) 643 { 644 <div class="d-flex gap-2"> 645 @foreach (var cat in speakerTypeList) 646 { 647 foreach (var c in cat.categoryItems) 648 { 649 string badgePath = "/Files/Images/"; 650 651 if (c.name.Equals("Microsoft")) 652 { 653 badgePath += "microsoftIconBadge.png"; 654 } 655 else if (c.name.Equals("Sponsor")) 656 { 657 badgePath += "sponsorIconBadge.png"; 658 } 659 else if (c.name.Equals("MVP")) 660 { 661 badgePath += "mvpIconBadge.png"; 662 } 663 else if (c.name.Equals("Directions")) 664 { 665 badgePath += "directionsIconBadge.png"; 666 } 667 else 668 { 669 badgePath = badgePath; 670 } 671 672 <img height="@iconBadgeHeight" width="@iconBadgeWidth" src="@badgePath" class="rounded-0"></img> 673 } 674 } 675 </div> 676 } 677 </div> 678 </div> 679 <div class="h-100 g-col-lg-5 g-col-12"> 680 <img src="@speakerProfilePicture" class="h-100 w-100 img-fluid rounded-7"></img> 681 </div> 682 </div> 683 </div> 684 </div> 685 </div> 686 </div> 687 } 688 </div> 689 </div> 690 } 691 else 692 { 693 var level1Speakers = speakers.Where(s => s.displayPriority == 1).ToList(); 694 var level2Speakers = speakers.Where(s => s.displayPriority == 2); 695 var level3Speakers = speakers.Where(s => s.displayPriority > 2); 696 697 if (categoryParameter != 0) 698 { 699 level1Speakers = level1Speakers.Where(speaker => speaker.categories.Any(i => i.categoryItems.Any(cat => cat.id.Equals(categoryParameter)))).ToList(); 700 level2Speakers = level2Speakers.Where(speaker => speaker.categories.Any(i => i.categoryItems.Any(cat => cat.id.Equals(categoryParameter)))).ToList(); 701 level3Speakers = level3Speakers.Where(speaker => speaker.categories.Any(i => i.categoryItems.Any(cat => cat.id.Equals(categoryParameter)))).ToList(); 702 } 703 704 string topSpeakersCarouselWidth = Model.Item.GetRawValueString("TopSpeakersCarouselWidth", "w-100"); 705 706 <div class="d-grid mb-3"> 707 @if (level1Speakers.Any() && !hideSpeakerCategory) 708 { 709 <h4 class="mb-4">@Translate("SpeakerWall_DisplayOrder_1")</h4> 710 } 711 712 <div id="Slider_@Model.ID" class="@(topSpeakersCarouselWidth) m-auto d-grid swiffy-slider slider-nav-visible slider-nav-round slider-nav-autoplay slider-nav-autopause speaker-wall-preview"> 713 @RenderSpeakerSlider(level1Speakers, 6) 714 </div> 715 @*foreach(var speaker in level1Speakers) 716 { 717 @RenderSpeaker(speaker) 718 719 } *@ 720 </div> 721 722 if (level1Speakers.Any() && !hideSpeakerCategory) 723 { 724 <hr class="my-5"> 725 } 726 727 <div class="@gridCss mb-3"> 728 @if (level2Speakers.Any() && !hideSpeakerCategory) 729 { 730 <h4 class="mb-4 g-col-12">@Translate("SpeakerWall_DisplayOrder_2")</h4> 731 } 732 733 @foreach (var speaker in level2Speakers) 734 { 735 @RenderSpeaker(speaker) 736 } 737 </div> 738 739 if (level2Speakers.Any() && !hideSpeakerCategory) 740 { 741 <hr class="my-5"> 742 } 743 744 <div class="@gridCss mb-3"> 745 @if (level3Speakers.Any() && !hideSpeakerCategory) 746 { 747 <h4 class="mb-4 g-col-12">@Translate("SpeakerWall_DisplayOrder_3")</h4> 748 } 749 750 @foreach(var speaker in level3Speakers) 751 { 752 @RenderSpeaker(speaker) 753 } 754 </div> 755 } 756 } 757 758 } 759 760 @helper RenderContent(string content, string heading, string fontSize, string color, string opacity, string margin, string marginMobile, string cssClass) 761 { 762 var classes = new List<string> { }; 763 if (!string.IsNullOrEmpty(fontSize)) { classes.Add(fontSize); } 764 if (!string.IsNullOrEmpty(color)) { classes.Add(color); } 765 if (!string.IsNullOrEmpty(opacity)) { classes.Add(opacity); } 766 if (!string.IsNullOrEmpty(margin)) { classes.Add(margin); } 767 if (!string.IsNullOrEmpty(marginMobile)) { classes.Add(marginMobile); } 768 if (!string.IsNullOrEmpty(cssClass)) { classes.Add(cssClass); } 769 770 var tagStart = $"<{heading} class=\"{string.Join(" ", classes)}\">"; 771 var tagEnd = $"</{heading}>"; 772 773 @tagStart 774 @content 775 @tagEnd 776 } 777 778 @helper RenderButton(Dynamicweb.Frontend.LinkViewModel link, string label, string style, string icon, string iconPosition) 779 { 780 string target = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && link.IsExternal ? "target=\"_blank\"" : string.Empty; 781 string rel = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && link.IsExternal ? "rel=\"noopener\"" : string.Empty; 782 783 <a href="@link.Url" @target @rel class="btn @(style)"> 784 @if (icon is object) 785 { 786 <span class="d-flex align-items-center gap-1 @(iconPosition)"> 787 @label 788 @RenderIcon(icon) 789 </span> 790 } 791 else 792 { 793 @label 794 } 795 </a> 796 } 797 798 @helper RenderIcon(string icon) 799 { 800 if (System.IO.Path.GetExtension(icon).ToLower() == ".svg") 801 { 802 if (!icon.ToLower().Contains("none") && icon != string.Empty) 803 { 804 <span class="icon-auto"> 805 @ReadFile(icon) 806 </span> 807 } 808 } 809 } 810 @helper RenderSpeaker (Speaker speaker) 811 { 812 string iconBadgeWidth = Model.Item.GetString("IconBadgeWidth"); 813 string iconBadgeHeight = Model.Item.GetString("IconBadgeHeight"); 814 815 var columnSize = "grid g-col-xl-4 g-col-lg-6 g-col-md-6 g-col-12"; 816 columnSize = speaker.displayPriority == 1 ? "grid g-col-lg-12 g-col-12" : columnSize; 817 columnSize = speaker.displayPriority == 2 ? "grid g-col-lg-6 g-col-12" : columnSize; 818 819 string viewSpeakerInfoTranslate = Translate("View") + " " + speaker.fullName + " " + Translate("info"); 820 string speakerId = speaker.id; 821 string speakerName = speaker.fullName != null ? speaker.fullName.ToString() : ""; 822 string speakerBio = speaker.bio != null ? speaker.bio.ToString() : ""; 823 string speakerTagLine = speaker.tagLine != null ? speaker.tagLine.ToString() : ""; 824 string speakerProfilePicture = speaker.profilePicture != null ? speaker.profilePicture.ToString() : ""; 825 string speakerCategories = speaker.categoryItems != null ? String.Join(",", speaker.categoryItems) : ""; 826 string tagLineCssClass = "fs-7 m-0";//i == 0 ? string.Empty : "fs-7 m-0"; 827 var sessionsTranslate = speaker.sessions.Count() > 1 ? Translate("Sessions") : Translate("Session"); 828 var speakerTypeList = speaker.categories.Where(cat => cat.name == "SpeakerType") ?? null; 829 var speakerDisplayPriority = speaker.displayPriority.ToString(); 830 831 <div class="speaker @columnSize @theme gap-0 position-relative rounded-7 toggle-speaker" data-name="@makeStringReadable(speakerName)"> 832 <div class="h-100 g-col-lg-7 g-col-12 order-last order-lg-first"> 833 <div class="h-100 p-4 d-flex flex-column justify-content-between"> 834 <div class="d-flex flex-column"> 835 <a href="#" class="btn btn-link p-0 text-decoration-none" title="@viewSpeakerInfoTranslate" onclick="event.preventDefault(); new bootstrap.Modal(document.getElementById('SpeakerModal_@speakerId')).show()"> 836 <h5 class="text-start m-0">@makeStringReadable(speakerName)</h5> 837 </a> 838 <p class="@tagLineCssClass">@speakerTagLine</p> 839 </div> 840 <div class="d-flex flex-column gap-3 justify-content-between max-height-inherit overflow-auto"> 841 @*if (i == 0 && !showSummary) 842 { 843 <p class="m-0">@makeStringReadable(speakerBio)</p> 844 }*@ 845 </div> 846 @if (speakerTypeList != null) 847 { 848 <div class="d-flex gap-2"> 849 @foreach (var cat in speakerTypeList) 850 { 851 foreach (var c in cat.categoryItems) 852 { 853 string badgePath = "/Files/Images/"; 854 855 if (c.name.Equals("Microsoft")) 856 { 857 badgePath += "microsoftIconBadge.png"; 858 } 859 else if (c.name.Equals("Sponsor")) 860 { 861 badgePath += "sponsorIconBadge.png"; 862 } 863 else if (c.name.Equals("MVP")) 864 { 865 badgePath += "mvpIconBadge.png"; 866 } 867 else if (c.name.Equals("Directions")) 868 { 869 badgePath += "directionsIconBadge.png"; 870 } 871 else 872 { 873 badgePath = badgePath; 874 } 875 876 <img height="@iconBadgeHeight" width="@iconBadgeWidth" src="@badgePath" class="rounded-0"></img> 877 } 878 } 879 </div> 880 } 881 </div> 882 </div> 883 <div class="h-100 g-col-lg-5 g-col-12 rounded-7"> 884 <a class="btn btn-link p-0 d-flex" title="@viewSpeakerInfoTranslate" onclick="new bootstrap.Modal(document.getElementById('SpeakerModal_@speakerId')).show()"> 885 <img src="@speakerProfilePicture" class="w-100 img-fluid rounded-7"></img> 886 </a> 887 </div> 888 <div class="h-100 w-100 position-absolute cursor-pointer d-none"> 889 <a class="btn btn-link stretched-link" title="@viewSpeakerInfoTranslate" onclick="new bootstrap.Modal(document.getElementById('SpeakerModal_@speakerId')).show()"></a> 890 </div> 891 </div> 892 893 894 <div class="modal fade modal-xl" id="SpeakerModal_@speakerId"> 895 <div class="modal-dialog"> 896 <div class="modal-content @theme rounded-7"> 897 <div class="modal-body p-0" id="SpeakerModalBodyContainer_@speakerId"> 898 <div class="close-container position-absolute p-3 end-0 m-3 bg-white rounded-7 z-index-9"> 899 <button type="button" class="btn-close bg-dark z-index-9" data-bs-dismiss="modal" aria-label="Close"></button> 900 </div> 901 <div class="grid @theme gap-0 rounded-7"> 902 <div class="h-100 g-col-lg-7 g-col-12 order-last order-md-first"> 903 <div class="h-100 p-4 overflow-auto max-h-30-em"> 904 <div> 905 <h5>@makeStringReadable(speakerName)</h5> 906 <p>@speakerTagLine</p> 907 </div> 908 <div class="d-flex flex-column gap-3 justify-content-between overflow-auto max-h-15-em"> 909 <p class="m-0">@makeStringReadable(speakerBio)</p> 910 </div> 911 @if (speakerTypeList != null) 912 { 913 <div class="d-flex gap-2 mt-4"> 914 @foreach (var cat in speakerTypeList) 915 { 916 foreach (var c in cat.categoryItems) 917 { 918 string badgePath = "/Files/Images/"; 919 920 if (c.name.Equals("Microsoft")) 921 { 922 badgePath += "microsoftIconBadge.png"; 923 } 924 else if (c.name.Equals("Sponsor")) 925 { 926 badgePath += "sponsorIconBadge.png"; 927 } 928 else if (c.name.Equals("MVP")) 929 { 930 badgePath += "mvpIconBadge.png"; 931 } 932 else if (c.name.Equals("Directions")) 933 { 934 badgePath += "directionsIconBadge.png"; 935 } 936 else 937 { 938 badgePath = badgePath; 939 } 940 941 <img height="@iconBadgeHeight" width="@iconBadgeWidth" src="@badgePath" class="rounded-0"></img> 942 } 943 } 944 </div> 945 } 946 <div class="mt-4 d-grid"> 947 <p class="m-0 fw-bold">@sessionsTranslate</p> 948 @foreach (var session in speaker.sessions) 949 { 950 if (!string.IsNullOrEmpty(sessionDetailsPage)) 951 { 952 var sessionLink = sessionDetailsPage.IndexOf("?") > 0 ? sessionDetailsPage + "&session=" + session.id : sessionDetailsPage + "?session=" + session.id; 953 <a class="btn btn-link text-start p-0 mb-2" title="@session.name" href="@sessionLink"> 954 @session.name 955 </a> 956 } 957 else 958 { 959 <p class="mb-2">@session.name</p> 960 } 961 } 962 </div> 963 @if (speaker.links.Any()) 964 { 965 <div class="d-flex gap-3 align-items-end"> 966 @foreach (var link in speaker.links) 967 { 968 string icon = "/Files/Templates/Designs/Swift/Assets/icons/"; 969 970 if (link.url.Contains("twitter")) 971 { 972 icon += "twitter.svg"; 973 } 974 else if (link.url.Contains("linkedin")) 975 { 976 icon += "linkedin.svg"; 977 } 978 else 979 { 980 icon += "link.svg"; 981 } 982 983 <a href="@link.url" title="@link.title" target="_blank"> 984 @RenderIcon(icon) 985 </a> 986 } 987 </div> 988 } 989 </div> 990 </div> 991 <div class="h-100 g-col-lg-5 g-col-12"> 992 <img src="@speakerProfilePicture" class="h-100 w-100 img-fluid rounded-7"></img> 993 </div> 994 </div> 995 </div> 996 </div> 997 </div> 998 </div> 999 } 1000 1001 @helper RenderSpeakerSlider(List<Speaker> speakers, int pageSize) 1002 { 1003 string iconBadgeWidth = Model.Item.GetString("IconBadgeWidth"); 1004 string iconBadgeHeight = Model.Item.GetString("IconBadgeHeight"); 1005 var summarySpeakers = speakers.Select((speaker, index) => new {speaker, index}) 1006 .GroupBy(g => g.index < 3, 1007 (key, g) => new { Title = key, Items = g.ToList() }); 1008 if(speakers.Any()) 1009 { 1010 <div class="d-flex"> 1011 <button type="button" title="@Translate("Previous slide")" class="btn btn-primary slider-nav position-relative p-lg-3 rounded-7-start bg-black text-white" style="z-index:1;max-height: 2.75em;min-height: 2.75em"> 1012 <span class="icon-auto"> 1013 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-left"><line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline></svg> 1014 </span> 1015 <span class="visually-hidden">@Translate("Previous slide")</span> 1016 </button> 1017 <button type="button" title="@Translate("Next slide")" class="btn btn-primary slider-nav slider-nav-next position-relative p-lg-3 rounded-7-end bg-black text-white" style="z-index:1;max-height: 2.75em;min-height: 2.75em"> 1018 <span class="icon-auto"> 1019 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-right"><line x1="5" y1="12" x2="19" y2="12"></line><polyline points="12 5 19 12 12 19"></polyline></svg> 1020 </span> 1021 <span class="visually-hidden">@Translate("Next slide")</span> 1022 </button> 1023 </div> 1024 1025 <ul class="slider-container"> 1026 @foreach (var _speaker in speakers.Take(pageSize)) 1027 { 1028 string viewSpeakerInfoTranslate = Translate("View") + " " + _speaker.fullName + " " + Translate("info"); 1029 string speakerId = _speaker.id; 1030 string speakerName = _speaker.fullName != null ? _speaker.fullName.ToString() : ""; 1031 string speakerBio = _speaker.bio != null ? _speaker.bio.ToString() : ""; 1032 string speakerTagLine = _speaker.tagLine != null ? _speaker.tagLine.ToString() : ""; 1033 string speakerProfilePicture = _speaker.profilePicture != null ? _speaker.profilePicture.ToString() : ""; 1034 var sessionsTranslate = _speaker.sessions.Count() > 1 ? Translate("Sessions") : Translate("Session"); 1035 var speakerTypeList = _speaker.categories.Where(cat => cat.name == "SpeakerType") ?? null; 1036 string bioText = speakerBio.Count() > 700 ? speakerBio.Substring(0, 700) + "..." : speakerBio; 1037 1038 <li class="toggle-speaker" data-name="@makeStringReadable(speakerName)"> 1039 <div class="speaker grid @theme position-relative rounded-7"> 1040 <div class="h-100 p-4 g-col-lg-7 g-col-12 order-last order-lg-first d-flex flex-column gap-1"> 1041 <a href="#" class="btn btn-link p-0 text-decoration-none" title="@viewSpeakerInfoTranslate" onclick="event.preventDefault(); new bootstrap.Modal(document.getElementById('SpeakerModal_@speakerId')).show()"> 1042 <h5 class="text-start">@makeStringReadable(speakerName)</h5> 1043 </a> 1044 <h5>@speakerTagLine</h5> 1045 <div class="h-100 d-flex flex-column justify-content-between"> 1046 <div class="d-flex flex-column gap-3 justify-content-between overflow-hidden speaker-bio-container"> 1047 <p class="m-0 bio-text fs-lg-7">@makeStringReadable(bioText)</p> 1048 </div> 1049 <div class="d-flex justify-content-between align-items-center"> 1050 @if (speakerTypeList != null) 1051 { 1052 <div class="d-flex gap-2 mt-2"> 1053 @foreach (var cat in speakerTypeList) 1054 { 1055 foreach (var c in cat.categoryItems) 1056 { 1057 string badgePath = "/Files/Images/"; 1058 1059 if (c.name.Equals("Microsoft")) 1060 { 1061 badgePath += "microsoftIconBadge.png"; 1062 } 1063 else if (c.name.Equals("Sponsor")) 1064 { 1065 badgePath += "sponsorIconBadge.png"; 1066 } 1067 else if (c.name.Equals("MVP")) 1068 { 1069 badgePath += "mvpIconBadge.png"; 1070 } 1071 else if (c.name.Equals("Directions")) 1072 { 1073 badgePath += "directionsIconBadge.png"; 1074 } 1075 else 1076 { 1077 badgePath = badgePath; 1078 } 1079 1080 <img height="@iconBadgeHeight" width="@iconBadgeWidth" src="@badgePath" class="rounded-0"></img> 1081 } 1082 } 1083 </div> 1084 } 1085 <div class="mt-2"> 1086 <button class="btn btn-primary btn-sm" onclick="event.preventDefault(); new bootstrap.Modal(document.getElementById('SpeakerModal_@speakerId')).show()">@Translate("Read more")</button> 1087 </div> 1088 </div> 1089 </div> 1090 </div> 1091 <div class="h-100 g-col-lg-5 g-col-12 overflow-hidden rounded-7"> 1092 <a class="btn btn-link p-0 w-100" title="@viewSpeakerInfoTranslate" onclick="new bootstrap.Modal(document.getElementById('SpeakerModal_@speakerId')).show()"> 1093 <img src="@speakerProfilePicture" class="w-100 img-fluid rounded-7"></img> 1094 </a> 1095 </div> 1096 </div> 1097 </li> 1098 } 1099 </ul> 1100 1101 foreach (var speaker in speakers) 1102 { 1103 string speakerId = speaker.id; 1104 string viewSpeakerInfoTranslate = Translate("View") + " " + speaker.fullName + " " + Translate("info"); 1105 string speakerName = speaker.fullName != null ? speaker.fullName.ToString() : ""; 1106 string speakerBio = speaker.bio != null ? speaker.bio.ToString() : ""; 1107 string speakerTagLine = speaker.tagLine != null ? speaker.tagLine.ToString() : ""; 1108 string speakerProfilePicture = speaker.profilePicture != null ? speaker.profilePicture.ToString() : ""; 1109 string speakerCategories = speaker.categoryItems != null ? String.Join(",", speaker.categoryItems) : ""; 1110 var sessionsTranslate = speaker.sessions.Count() > 1 ? Translate("Sessions") : Translate("Session"); 1111 var speakerTypeList = speaker.categories.Where(cat => cat.name == "SpeakerType") ?? null; 1112 1113 <div class="modal fade modal-xl" id="SpeakerModal_@speakerId"> 1114 <div class="modal-dialog"> 1115 <div class="modal-content @theme rounded-7"> 1116 <div class="modal-body p-0" id="SpeakerModalBodyContainer_@speakerId"> 1117 <div class="close-container position-absolute p-3 end-0 m-3 bg-white rounded-7 z-index-9"> 1118 <button type="button" class="btn-close bg-dark z-index-9" data-bs-dismiss="modal" aria-label="Close"></button> 1119 </div> 1120 <div class="grid @theme gap-0 rounded-7"> 1121 <div class="h-100 g-col-lg-7 g-col-12 order-last order-md-first"> 1122 <div class="h-100 p-4 overflow-auto max-h-30-em"> 1123 <div> 1124 <h5>@makeStringReadable(speakerName)</h5> 1125 <p>@speakerTagLine</p> 1126 </div> 1127 <div class="d-flex flex-column gap-3 justify-content-between overflow-auto max-h-15-em"> 1128 <p class="m-0">@makeStringReadable(speakerBio)</p> 1129 </div> 1130 <div class="mt-4 d-grid"> 1131 <p class="m-0 fw-bold">@sessionsTranslate</p> 1132 @foreach (var session in speaker.sessions) 1133 { 1134 if (!string.IsNullOrEmpty(sessionDetailsPage)) 1135 { 1136 var sessionLink = sessionDetailsPage.IndexOf("?") > 0 ? sessionDetailsPage + "&session=" + session.id : sessionDetailsPage + "?session=" + session.id; 1137 <a class="btn btn-link text-start p-0 mb-2" title="@session.name" href="@sessionLink"> 1138 @session.name 1139 </a> 1140 } 1141 else 1142 { 1143 <p class="mb-2">@session.name</p> 1144 } 1145 } 1146 </div> 1147 @if (speakerTypeList != null) 1148 { 1149 <div class="d-flex gap-2"> 1150 @foreach (var cat in speakerTypeList) 1151 { 1152 foreach (var c in cat.categoryItems) 1153 { 1154 string badgePath = "/Files/Images/"; 1155 1156 if (c.name.Equals("Microsoft")) 1157 { 1158 badgePath += "microsoftIconBadge.png"; 1159 } 1160 else if (c.name.Equals("Sponsor")) 1161 { 1162 badgePath += "sponsorIconBadge.png"; 1163 } 1164 else if (c.name.Equals("MVP")) 1165 { 1166 badgePath += "mvpIconBadge.png"; 1167 } 1168 else if (c.name.Equals("Directions")) 1169 { 1170 badgePath += "directionsIconBadge.png"; 1171 } 1172 else 1173 { 1174 badgePath = badgePath; 1175 } 1176 1177 <img height="@iconBadgeHeight" width="@iconBadgeWidth" src="@badgePath" class="rounded-0"></img> 1178 } 1179 } 1180 </div> 1181 } 1182 </div> 1183 </div> 1184 <div class="h-100 g-col-lg-5 g-col-12"> 1185 <img src="@speakerProfilePicture" class="h-100 w-100 img-fluid rounded-7"></img> 1186 </div> 1187 </div> 1188 </div> 1189 </div> 1190 </div> 1191 </div> 1192 } 1193 } 1194 } 1195 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/slim-select/2.6.0/slimselect.css" integrity="sha512-ijXMfMV6D0xH0UfHpPnqrwbw9cjd4AbjtWbdfVd204tXEtJtvL3TTNztvqqr9AbLcCiuNTvqHL5c9v2hOjdjpA==" crossorigin="anonymous" referrerpolicy="no-referrer" /> 1196 <script src="https://cdnjs.cloudflare.com/ajax/libs/slim-select/2.6.0/slimselect.min.js" integrity="sha512-0E8oaoA2v32h26IycsmRDShtQ8kMgD91zWVBxdIvUCjU3xBw81PV61QBsBqNQpWkp/zYJZip8Ag3ifmzz1wCKQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> 1197 <script type="module" src="/Files/Templates/Designs/Swift/Assets/js/swiffy-slider.js"></script> 1198 <link rel="stylesheet" type="text/css" href="/Files/Templates/Designs/Swift/Assets/css/swiffy-slider.min.css"></link>