1: #set ($showTitle = true) 2: #set ($primary = true) 3: #set ($useIcons = false) 4: #set ($useThumbnails = false) 5: #set ($listClass = "list-unstyled") 6: #set ($class = "nav-link") 7: #set ($flex = true) 8: #set ($flexClass = "d-sm-flex") 9: #set ($flexFill = false) 10: #set ($alignment = "flex-column") 11: #set ($flexFill = true) 12: #set ($ariaLabel = "") 13: #set ($groupLinks = false) 14: 15: #if ($request.getParameter("groupLinks") == true) 16: #set ($groupLinks = true) 17: #end 18: 19: #if ($request.getParameter("showTitle") == false) 20: #set ($showTitle = false) 21: #end 22: 23: #if ($request.getParameter("primary") == false) 24: #set ($primary = false) 25: #end 26: 27: #if ($request.getParameter("useIcons") == true) 28: ## This is designed to set the label field as a FontAwesome class selector. 29: #set ($useIcons = true) 30: #end 31: 32: #if ($request.getParameter("useThumbnails") == true) 33: ## This is designed to use page thumbnails as logos prepending the menu navbar items. 34: #set ($useThumbnails = true) 35: #end 36: 37: #if ($request.getParameter("flexClass")) 38: #set ($flexClass = $request.getParameter("flexClass")) 39: #end 40: 41: #if ($request.getParameter("class")) 42: #set ($class = $request.getParameter("class")) 43: #end 44: 45: #if ($request.getParameter("listClass")) 46: #set ($listClass = $request.getParameter("listClass")) 47: #end 48: 49: #if ($request.getParameter("flexFill") == false) 50: #set ($flexFill = false) 51: #end 52: 53: #if ($request.getParameter("alignment")) 54: ## Examples: justify-content-center | justify-content-end | flex-column | flex-column-reverse | flex-row | flex-row-reverse 55: #set ($alignment = $request.getParameter("alignment")) 56: #end 57: 58: #if ($request.getParameter("ariaLabel")) 59: #set ($ariaLabel = $request.getParameter("ariaLabel")) 60: #if ($primary == true) 61: #if ($ariaLabel.toLowerCase().contains("sports")) 62: #set ($ariaLabelWords = $ariaLabel.split(" ")) 63: $request.setAttribute("sportsGender", $ariaLabelWords[0]) 64: #end 65: 66: #end 67: #end 68: 69: 70: ##=====================## 71: ## BUILD LIST ELEMENTS ## 72: ##=====================## 73: 74: #set ($level = 1) 75: 76: #macro (printAnchor $anchorclass) 77: #if ($anchorclass == "sportmenu-row-link") 78: #set ($anchorclass = "${anchorclass} px-lg-2") 79: #set ($level = $request.getParameter('level')) 80: #if ($level == 3) 81: #set ($sportsGender = $request.getAttribute('sportsGender')) 82: #end 83: #end 84: 85: #set ($isBrand = false) 86: #set ($brands = ["facebook", "twitter", "instagram", "youtube", "flickr", "twitch", "tiktok"]) 87: #foreach ($brand in $brands) 88: #if ($entry.label.toLowerCase().contains($brand)) 89: #set ($isBrand = true) 90: #end 91: #end 92: 93: <a class="$anchorclass dropdown-item#if($entry.targetURL.length() == 0) disabled#end" href="$entry.targetURL" #if ($website.isExternalLink($entry.targetURL)) target="_blank" #end #if (!$entry.hideTitle && $entry.title.length() > 0) title="$entry.title" aria-label="$!sportsGender $ariaLabel $entry.title" #else aria-label="$!sportsGender $ariaLabel $entry.label" #end > 94: #if (($useIcons == true || $isBrand == true) && ($page.url.contains("/sports/") || $page.url.contains("/Team_Pages/"))) 95: <span class="fab fa-${entry.label.toLowerCase()}"></span> 96: <span class="sr-only">$entry.label</span> 97: #elseif ($useThumbnails == true) 98: $website.includeAgain("${entry.targetURL.replace('/index','/navbar-secondary')}?tmpl=navbar-thumbnail-custom&label=${entry.label}") 99: ${entry.label} 100: #else 101: ${entry.label} 102: #end 103: </a> 104: #end 105: 106: #macro (printGroupLinks) 107: <div class="${flexClass} justify-content-between list-unstyled flex-row"> 108: <div class="flex-grow-1"> 109: #printAnchor("sportname text-left font-weight-bold col px-lg-2") 110: </div> 111: #if ($entry.secondaryURL.length() > 0) 112: <div class="sports-row-quick-links d-none d-sm-block"> 113: #set ($level = $tool.math.add($request.getParameter("level"), 1)) 114: #set ($alignment = "flex-row") 115: #set ($flexClass = "d-flex") 116: 117: <div class="submenu level-${level}" data-secondary-url="${entry.secondaryURL}"> 118: 119: #if ($entry.secondaryURL.contains("tmpl=")) 120: #set ($secondaryURL = ${entry.secondaryURL}) 121: #else 122: #set ($poweredby = ${entry.secondaryURL}) 123: #set ($extraparams = "") 124: 125: #if ($entry.secondaryURL.contains("?")) 126: #set ($poweredby = $entry.secondaryURL.toString().split("\?").get(0)) 127: #set ($extraparams = $entry.secondaryURL.toString().split("\?").get(1)) 128: #end 129: #set ($secondaryURL = "${poweredby}?tmpl=navbar-yamm-template&groupLinks=true&primary=false&flex=${flex}&alignment=${alignment}&flexClass=${flexClass}&flexFill=${flexFill}&justify=${justify}&level=${level}&ariaLabel=${tool.esc.url($entry.label)}&${extraparams}") 130: #end 131: $website.includeAgain("${secondaryURL}?groupLinks=true") 132: </div> 133: </div> 134: #end 135: </div> 136: #end ## printGroupLinks 137: 138: #macro (printLinks) 139: <ul class="${listClass} ${flexClass} ${alignment}"> 140: #foreach ($entry in $entries) 141: #set ($class="") 142: #if ($entry.match) 143: #set ($class = "match active") 144: #end 145: 146: #if ($entry.secondaryURL.length() > 1) 147: #if ($entry.match) 148: #set ($class = "has-nav match active") 149: #else 150: #set ($class = "has-nav") 151: #end 152: #end 153: 154: <li class="#if($class.length() > 0)${class}#end#if($inline) list-inline-item#end#if($flexFill) flex-fill#end #if($foreach.hasNext && !$groupLinks) border-bottom #end group-links-${groupLinks}"> 155: #if ($entry.secondaryURL.length() > 0) 156: #printGroupLinks 157: #else 158: #printAnchor("sportmenu-row-link") 159: #end 160: </li> 161: #end 162: </ul> 163: #if ($wiki.valid())$wiki#end 164: #end ## printLinks 165: 166: ##============## 167: ## BUILD MENU ## 168: ##============## 169: 170: #if ($entries.size() > 0) 171: #if ($primary) 172: <div class="navbar-yamm-group" role="menubar" data-module="nav"> 173: #if ($page.title.length() > 0 && $showTitle) 174: <h4>$page.title</h4> 175: #end 176: #printLinks 177: </div> 178: #else 179: #printLinks 180: #end 181: 182: #end ## size check