{% assign camps = 'Global' | Attribute:'ShortCodeMetricsCampuses','RawValue' | Split:',' %}
{% assign campsct = camps | Size %}
{% if campsct and campsct >= 0 %}
    {% assign pagepath = 'Global' | Page:'Path' %}
    {% assign activecampus = 'Global' | PageParameter:'CampusId' %}
    {% assign queryParams = 'Global' | Page:'QueryString'  %}
    {% assign addqueryParams = '' %}
    {% assign queryParamsct = '' %}
    {% if queryParams and queryParams != '' %}
        {% for item in queryParams %}
            {% assign kvItem = item | PropertyToKeyValue %}
                {% if kvItem.Key and kvItem.Key != 'CampusId' and kvItem.Key != 'PageId' %}
                    {% assign queryParamsct = queryParamsct | Plus:1 %}
                    {% assign uqp = kvItem.Value | EscapeDataString %}
                    {% if queryParamsct == 1 %}
                        {% assign addqueryParams = addqueryParams | Append:kvItem.Key | Append:'=' | Append:uqp %}
                    {% else %}
                        {% assign addqueryParams = addqueryParams | Append:'&' | Append:kvItem.Key | Append:'=' | Append:uqp %}
                    {% endif %}
                {% endif %}
            {% endfor %}
    {% endif %}
    {% if addqueryParams and addqueryParams !='' %}{% assign allqueryParams = '?' | Append:addqueryParams %}{% else %}{% assign allqueryParams = '' %}{% endif %}
    {% if addqueryParams and addqueryParams !='' %}{% assign campusqueryParams = '&' | Append:addqueryParams %}{% else %}{% assign campusqueryParams = '' %}{% endif %}
    {% if activecampus and activecampus != '' %}{% assign btnhue1 = 'btn btn-outline-primary' %}{% else %}{% assign btnhue1 = 'btn btn-primary' %}{% endif %}
    <div class="btn-group btn-group-toggle" role="group" aria-label="Campuses">
        <a href="{{ pagepath }}{{ allqueryParams }}"class="{{ btnhue1 }}"><span style="font-size: 16px;">All</span></a>
        {% for thiscampus in camps %}
            {% campus where:'Guid == "{{ thiscampus }}"' securityenabled:'false' %}
                {% if campus.Id == activecampus %}{% assign btnhue = 'btn btn-primary' %}{% else %}{% assign btnhue = 'btn btn-outline-primary' %}{% endif %}
                <a href="{{ pagepath }}?CampusId={{ campus.Id }}{{ campusqueryParams }}"class="{{ btnhue }}"><span style="font-size: 16px;">{{ campus.ShortCode }}</span></a>
            {% endcampus %}
        {% endfor %}
    </div>
    <br>
    <br>
{% endif %}