# Country Filters

Country Filters power Location search and "Featured Country" functionality in Sponsorship Acquisition (opens new window). An array of Country Filters is maintained in the file src/js/combo-cart/data/sponsorship/sponsor-country-filters.js.

Each Country Filter consists of a name, label, class and filter for the country or region being defined. Below is the country filter for Ethiopia:

{
  name: 'Ethiopia',
  label: '    Ethiopia',
  class: '',
  filter: 'community/impactArea/countryOffice/locationID:990d2abb-c9a4-421d-9608-9421984e2c57'
}

# Description of Attributes

# name

Proper name of the country/region being defined (ex. Ethiopia).

# label

HTML content used in the <option/> element representing this country/region in the Sponsorship Acquisition Location dropdown.

# class

HTML class applied to the <option/> element representing this country/region in the Sponsorship Acquisition Location dropdown. Should be set to '' for country filters (ex. Ethiopia) and 'region' for regional filters (ex. Africa).

# filter

A 'path:guid' pair in which path refers to an ODS Location entity to filter by and guid refers to the ID of that Location.

For example, 'community/impactArea/countryOffice/locationID:990d2abb-c9a4-421d-9608-9421984e2c57' defines a filter that will return children whose Country Office (community/impactArea/countryOffice/locationID) is Ethiopia (990d2abb-c9a4-421d-9608-9421984e2c57).

Similarly, 'community/impactArea/countryOffice/fieldOffice/region/locationID:c7c002d7-40cf-4ad4-b593-ee7559588590' defines a filter that will return children whose Regional Field Office (community/impactArea/countryOffice/fieldOffice/region/locationID) is Africa (c7c002d7-40cf-4ad4-b593-ee7559588590).

Finally, raw ODATA queries may also be used in the filter attribute. For example, the filter for Nepal is startswith(community/impactArea/countryOffice/locationShortName, 'Nepal') eq true, which returns children with a Country Office name beginning with Nepal.