Front End Global Variables - NCIOCPL/cgov-digital-platform GitHub Wiki

These are the minimum global variables required for all microsites; they provide environment-specific links to APIs, and content. Depending on the needs of specific application modules, additional variables may need to be defined.

Setting up the global variables requires the site_admin role. To set them

  1. Log in to the CMS
  2. In the admin menu, go to Configuration > System > Frontend Globals Config Editor
  3. Copy and paste the following structure exactly as shown.
  4. Click the Save button.

You will need to clear the cache (or at the least, invalidate the main nav — "Hit the 'IA button'") for the new values to be rendered on all pages.

{
    "exitDisclaimerHref": {
        "en": "https://www.cancer.gov/policies/linking",
        "es": "https://www.cancer.gov/espanol/politicas/enlaces"
    },
    "general": {
        "apiServer": "https://webapis.cancer.gov"
    },
    "glossaryConfig": {
        "apiServer": "https://webapis.cancer.gov/glossary/v1/"
    },
    "sitewideSearchConfig": {
        "searchApiServer": "https://webapis.cancer.gov/sitewidesearch/v1/"
    }
}

This is a JSON (JavaScript object) structure and must be entered as-shown. (Quotation marks, colons, and curly-braces are significant.)

values:

  • exitDisclaimerHref - English and Spanish links to NCI's linking policy. This is used to populate the links in the exit disclaimer icon that appears next to links that go to non-government web sites.
  • general - URL of the web API server.
  • glossaryConfig - Full URL of the glossary API. Used by glossary pop-ups.
  • sitewideSearchConfig - Full URL of the sitewide search API.