# Harmonize User Guide

Harmonize is a time-series data platform that lets analysts store, compare, and visualize datasets with different frequencies and base years — without programming skills. The system consists of a **Windows application**, **MSSQL database**, **Excel add-in**, and a **web databank**. It is AI-friendly and open to integration with **Python** and **R**.

This guide covers how to **use** Harmonize day-to-day. For installation and deployment, see [INSTALL.md](INSTALL.md).



![Harmonize main window](images/Harmonize_main.png)


---

## Contents

### Desktop Applications
1. [Getting Started](#getting-started)
2. [Desktop Application](#desktop-application)
3. [Charts and Templates](#charts-and-templates)
4. [Common Base Year](#common-base-year)
5. [Functions and Aggregations](#functions-and-aggregations)
6. [Reports](#reports)
7. [Saved Selections](#saved-selections)
8. [Upload or Update Dataset](#upload-or-update-dataset-from-application)
9. [Tips and Techniques](#tips-and-techniques)
9. [Sorting and Ordering](#sorting-and-ordering)
10. [Menus and Languages](#menus-and-languages)
11. [Excel Add-in](#excel-add-in)
12. [Python and R](#python-and-r)

### Web Site
13. [Web Databank](#web-databank)
14. [Web API Domain Catalog](#web-api-domain-catalog)
15. [Web API Series Data](#web-api-series-data)
16. [Web URL Reference](#web-url-reference)
17. [Web Explorer](#web-explorer)
17. [Web Discover](#web-discover)
18. [Dashboard Chart](#dashboard-chart)
19. [KPI Dashboard Cards](#kpi-dashboard-cards)
20. [Table Reports](#table-reports)
21. [About Section](#about-section)
22. [Contact Section](#contact-section)
23. [Press Releases](#press-releases)
24. [Language and Domain Configuration](#language-and-domain-configuration)

---

## Getting Started

1. Launch **Harmonize.exe** — the connection string is shown in the bottom of the form.
2. The application lists all datasets accessible to your user in a tree on the left.
3. Double-click (or shift-click multiple) series to move them to the **selected area** (bottom grid).
4. In the selected area, choose interval, function, aggregation, base year, and chart style.
5. Click a **Chart** button to generate your visualization.

Datasets with write permissions are highlighted in **orange**. Right-click these to upload data or delete series.

---

## Desktop Application

The Harmonize desktop application is a Windows C# application that connects to your SQL Server database through stored procedures.

**Key areas of the interface:**

| Area | Purpose |
|---|---|
| Tree (left panel) | Browse datasets — grouped and searchable |
| Search bar | Wildcard search using SQL LIKE syntax (`%price%`) |
| Top grid | Series in the selected dataset |
| Bottom grid | Your selected series for charting/reporting |
| Chart buttons | Generate Chart, MultiChart, YearChart, or Report |
| Status bar | Connection info and status messages |

Search starts from your current position in the tree. Select "All" at the top to search across all datasets.



---

## Charts and Templates

Charts are rendered in your default browser using Highcharts. Three chart templates are available under the Chart menu:

### Chart (Alt+C)

The main template — all selected series in **one container**. Supports different chart styles (line, spline, area, column), zoom, and scrolling. Functions, aggregations, and common base year can be combined.

### MultiChart (Alt+M)

Each series gets its own **separate container** — approximately 3 charts per page, scroll down for more. The charts are independent and not synchronized on the x-axis.

### YearChart

An **overlay chart** where each year is shown as a separate line for comparison. Only use intervals containing data up to one year (e.g. `CurrentYear-1`, `CurrentYear-2`). Additional intervals can be added in the database.

### Inside Charts

All charts include a **hamburger menu** in the top-right corner with options to:
- View data as a table
- Download as CSV or XLS
- Save chart as PNG, SVG, or PDF

---

## Common Base Year

When comparing indexes with different base years (e.g. CPI 2015=100 vs PPI 2020=100), you can select a **common base year** to normalize them.

- The selected base year must have data observations in the series
- The common base year is displayed in the chart
- Can be combined with functions and aggregations

---

## Functions and Aggregations

### Functions

Apply transformations to your series:

| Function | Description |
|---|---|
| `Pct(n)` | Percentage change with lag n (e.g. `Pct(12)` = year-over-year for monthly data) |
| `Diff(n)` | Difference with lag n |
| `Mave(n)` | Moving average with window n |

Additional custom functions can be added to the database and will appear in the dropdown automatically.

### Aggregations

| Aggregation | Description |
|---|---|
| `AVG_MONTH` | Average by month |
| `AVG_QUARTER` | Average by quarter |
| `AVG_YEAR` | Average by year |
| `SUM_MONTH` | Sum by month |
| `SUM_YEAR` | Sum by year |
| `LAST_MONTH` | Last observation of month |

---

## Reports

- **User Report** button for quick horizontal and vertical reports
- Report tables are also available from **inside charts** via the hamburger menu
- Number of decimals and datetime format can be selected under the Options menu

---

## Saved Selections

Users can save and retrieve series selections for reuse:

1. Go to **File > Save Selection** to save your current chart definition as a `.csv` file
2. Later, load the selection to recreate the chart with **fresh data**

Selection types:
- **Dynamic intervals** — e.g. "CurrentYear" always shows the current year
- **Static intervals** — e.g. fixed to a specific date range

Be aware that changes in series names or access permissions since saving may cause issues.



---

## Upload or Update Dataset from Application

Users with write access to the database (orange color) can delete dataset contents (all series) or upload a **CSV** file into the database. The user will see a preview of the file before starting the import.

![CSV import file format](images/Import_csv_file_format.png)

---



## Tips and Techniques

- **Shift-click** to select multiple series at once from the dataset list
- **Right-click** in the selected area to apply interval, function, etc. to all series at once
- The **Order** column controls sort order in charts — click column headers to sort, or specify order numbers manually
- **Keyboard shortcuts:** Alt+C (Chart), Alt+M (MultiChart), Alt+R (Report)
- The application always extracts the **newest data** from the database before displaying
- **Options menu:** change number of decimals and datetime format
- The application works **without internet** — but needs access to your SQL Server for fresh data

---

## Sorting and Ordering

In the top grid, you can sort series on any column. The **Last Diff** column sorts by which series had the most/least change compared to the previous observation.

When viewing data as a table inside a chart, clicking column headers lets you quickly find maximum and minimum values for each series.

---

## Menus and Languages

The desktop application supports multiple languages (English, Norwegian, Ukrainian, Albanian, Hindi, Arabic, and more).

![Desktop languages](images/Desktop_languages.png)

- Language labels are defined in **Menues.csv**
- Do not remove lines or change the order — back up the original before editing
- The active language is configured in `connection.txt` (line 4)
- Some database options are in English and should **not** be translated — for example chart types (`line`, `spline`, `bar`, `column`), stacking modes (`normal`, `stacked`), and aggregation keywords. These are internal identifiers used by the system.

---

## Excel Add-in

The Harmonize SQL Add-in provides Get and Put functionality directly in Excel.
The excel-addin can also delete the complete history from one series.
It uses several of the same functionalities as the application, such as base years, intervals, and frequency forcing to show the gaps.

![Harmonize Excel Addin](images/Harmonize_xls_addin.png)


### Getting Started

1. After installation, the **Harmonize ribbon** appears in Excel
2. Select the top-left cell in your worksheet
3. Click **GetSerie** — a sample query is inserted

### Cell Format

Header cells use a pipe-delimited format:

```
HARMONIZE|DATASET:SERIESNAME|BaseYear|Interval|Aggregation|Convert|Sort
```

Example:
```
HARMONIZE|CPI:C00.IDX|2025|YearsLast5|NONE|OFF|asc
```

### Buttons

| Button | Action |
|---|---|
| GetSerie | Fetches data for the active cell's query |
| RefreshAll | Updates all `HARMONIZE|` queries in the sheet |
| PutSerie | Uploads data back to the database (requires write access) |
| DeleteSeries | Deletes a series from the database |
| TestConnect | Tests database connection |

### Upload from Excel

With **PutSerie** you can upload data to a dataset. You must have write access. You can also update the description and unit name (must be a valid unit defined in the database).
---

## Python and R

Python and R scripts connect directly to SQL Server and call the same stored procedures as the desktop app.

### Reading Data

Use `StpGetSeries` with the same parameters available in the application:

```python
cursor.execute("EXEC StpGetSeries @curvename=?, @basis=?, @myinterval=?, ...", params)
```

### Writing Data

Use `UTILS_PutTime` to upsert observations:

```python
cursor.execute("EXEC UTILS_PutTime @curvename=?, @valuedate=?, @value=?", params)
```

### Downloading External Data

Sample scripts for ingesting data from external sources:

| Script | Source |
|---|---|
| `download_cpi.py` | Consumer Price Index from SSB (EN + NO) |
| `download_ppi.py` | Producer Price Index from SSB (EN + NO) |
| `download_travel.py` | Travel statistics from SSB (EN + NO) |
| `ffi.py` | Generic CSV flat-file import |

These scripts download bilingual descriptions (English + Norwegian) and output CSV files ready for bulk import via `ffi.py` or the desktop app.

### Import Without Python or R

The same CSV files produced by these scripts can also be imported directly from the Harmonize desktop application — no Python or R installation required. Use **File > Import CSV** to load data into the database. Bulk import of multiple series from a single CSV file is supported from **version 1.9.9.1**.

See the `Py/` directory for all available scripts.

---

## Web Databank

The Harmonize Web Databank is a generic databank built on standard JSON files with fully customizable dashboards. Each statistical domain can have its own dashboard containing a highlight section (About), key-number cards, a chart template, a report template, and a contact section — all with multilingual support. End users can build and maintain dashboards without technical skills and without understanding JSON structures.

On top of the databank sits the **Explorer**, which lets end users compare any series from any statistical domain, in any frequency, on a single interactive chart. The **Discover** search works across all domains, enabling users to find and analyze series from different areas side by side.

The web databank is independent from the desktop application, but the desktop app generates the JSON series files and data catalog. On publish, all cards, tables, and charts are automatically updated, and the web becomes instantly searchable.

![Harmonize Web Databank](images/Databank.png)

Live example: [harmonize.no/databank](https://harmonize.no/databank/)

### How It Works

1. In Harmonize.exe, select your series and click **Save as Catalog Webfiles**
2. Choose a target folder (e.g. `www/databank/Prices_CPI/series/`)
3. The app generates JSON files and a `catalog.json` index
4. Deploy the folder to your web server
5. The domain automatically appears on the databank landing page

### Browsing the Databank

- The **landing page** lists all available statistical domains, sorted by last update
- Click a domain to see all its series with description, update time, and action buttons
- Each series has buttons for: **Explorer** (interactive chart), **Report** (table view), **JSON** (raw data), **CSV** (download)

### Language Toggle

A flag icon in the navigation bar switches between languages. Language 1 uses the `description` field, Language 2 uses the `desc2` field from the JSON files. Bilingual text in config files uses the `|` separator:

```
Consumer Price Index|Konsumprisindeksen
```

---

## Web API Domain Catalog

Each domain folder contains a `catalog.json` file that lists all available series. This file is generated by the Harmonize desktop app and serves as the index for the domain.

**URL pattern:** `/databank/{domain}/series/catalog.json`

**Example:** [/databank/Travel_Abroad/series/catalog.json](https://harmonize.no/databank/Travel_Abroad/series/catalog.json)

```json
[
  { "file": "gb.total.json", "name": "GB.TOTAL", "description": "United Kingdom - Outbound trips, total" },
  { "file": "dk.total.json", "name": "DK.TOTAL", "description": "Denmark - Outbound trips, total" },
  { "file": "se.total.json", "name": "SE.TOTAL", "description": "Sweden - Outbound trips, total" }
]
```

Each entry contains:
- **file** — the JSON filename in the `series/` folder
- **name** — the series identifier (dataset:series format)
- **description** — human-readable description (English)

The catalog is used by the databank landing page, the series browser, and the web explorer to discover available series. External applications can also use it to programmatically list what data is available in a domain.

---

## Web API Series Data

Individual series can be retrieved as JSON via the `getseries.php` endpoint. The response contains metadata, style definitions, and time series data ready for charting.

**URL pattern:** `/databank/getseries.php?domain={domain}&name={series}`

**Example:** [/databank/getseries.php?domain=Travel_Abroad&name=es.total](https://harmonize.no/databank/getseries.php?domain=Travel_Abroad&name=es.total)

```json
{
  "title": "Harmonize",
  "frequency": "MONTHLY",
  "decimals": 1,
  "series": [{
    "name": "ABROAD:ES.TOTAL",
    "description": "Spain - Outbound trips, total",
    "desc2": "Spania - Utenlandsreiser i alt",
    "unit": "ANT",
    "style": { "type": "column", "stacking": "normal", "color": "#AA4643" },
    "data": [
      [1640995200000, 203.0],
      [1648771200000, 389.0],
      [1656633600000, 255.0]
    ]
  }]
}
```

### Data Format

The `data` array contains `[timestamp, value]` tuples where:
- **timestamp** — milliseconds since epoch (UTC), e.g. `1640995200000` = 2022-01-01
- **value** — the observation value

This is the same format used by **Highcharts**, **ECharts**, **Plotly**, and other time-aware visualization libraries — the data can be passed directly to the chart without conversion.

### Style Properties

The `style` object carries chart rendering hints from the Harmonize desktop app:

| Property | Values |
|---|---|
| type | `spline`, `column`, `line`, `area` |
| stacking | `normal`, `null` |
| color | hex code (e.g. `#AA4643`) |
| lineWidth | 1-10 |
| yAxis | 0 (left) or 1 (right) |

### Bilingual Descriptions

Each series includes both `description` (language 1) and `desc2` (language 2), enabling multilingual applications without additional lookups.

---

## Web URL Reference

All databank pages and data are accessible via direct URLs. Replace `harmonize.no` with your own domain.

### Pages

| URL | Description |
|---|---|
| `/databank/series.php?domain={domain}&lang=1` | Dashboard for a domain (cards, charts, tables, series list) |
| `/databank/web_explorer.php?file={domain}/series/{file}.json&lang=1` | Interactive Explorer chart for a single series |
| `/databank/discover.php?q={search}&lang=1` | Cross-domain search with charting |
| `/templates/Chart.html?filename=../databank/{domain}/series/{file}.json` | Standalone Highcharts chart for a series |

### Data (JSON)

| URL | Description |
|---|---|
| `/databank/{domain}/series/catalog.json` | Domain catalog — list of all series |
| `/databank/{domain}/series/{file}.json` | Raw series data with metadata and observations |
| `/databank/getseries.php?domain={domain}&name={series}` | Series data via PHP endpoint |

### Examples (live)

```
https://harmonize.no/databank/series.php?domain=Prices_CPI_(2025)&lang=1
https://harmonize.no/databank/Prices_CPI_(2025)/series/c00.idx.json
https://harmonize.no/databank/web_explorer.php?file=Prices_CPI_(2025)/series/c00.idx.json&lang=1
https://harmonize.no/templates/Chart.html?filename=../databank/Prices_CPI_(2025)/series/c00.idx.json
https://harmonize.no/databank/discover.php?q=food&lang=1
```

### Parameters

| Parameter | Values | Description |
|---|---|---|
| `lang` | `1` or `2` | Language selection (1 = primary, 2 = secondary) |
| `domain` | folder name | Domain folder name, e.g. `Prices_CPI_(2025)` |
| `q` | search text | Search query for Discover (AND matching) |
| `filename` | relative path | Path to JSON file (for Chart.html template) |
| `file` | relative path | Path to JSON file (for Explorer) |

---

## Web Explorer

The Web Explorer is an interactive charting tool where users can combine **any series from any domain** in a single chart — no programming required.

Features:
- Browse and select series from all domain folders
- Mix series of different frequencies (monthly, quarterly, annual)
- Automatic frequency detection and date formatting
- Highcharts interactive chart with zoom and tooltips
- Download data as CSV, XLS, or chart as PNG/SVG/PDF
- View data as a table within the chart

Access via the **Explorer** button on any series, or directly at `/databank/web_explorer.php`.

![Web Explorer](images/Explorer.png)

---

## Web Discover

Web Discover is a cross-domain search and charting tool. Users type a query in natural language and instantly see matching series from all domains — then chart them with one click.

### How It Works

1. Type a search query (e.g. "spain travel", "food price", "CPI total")
2. Matching series appear as clickable chips — the search matches across series names, descriptions, and domain names
3. Click chips to select which series to chart, or use **Select all**
4. Press **Chart** (or Enter) to render one chart per selected series

Multiple words use AND matching — "spain travel" finds series containing both words.

### Features

- Searches across **all domains** in the databank simultaneously
- No domain selection required — results show which domain each series belongs to
- One Highcharts chart per series with zoom, tooltips, and export (PNG, CSV, XLS)
- Quick-start suggestions for common searches
- Shareable URLs: `discover.php?q=travel` links directly to a search
- Works purely against the existing `catalog.json` files — no server-side processing needed

### Access

Available via the **Discover** link in the databank navbar, or directly at `/databank/discover.php`.

![Web Discover](images/Discover.png)

---

## Dashboard Chart

Each domain folder can have a `chart.txt` file that defines a dashboard chart at the top of the series page.

![Dashboard Chart](images/Dashboard.png)

### Format

```
Chart Title|Kartittel (bilingual)
Start = -5Y
Deci = 1
series/myseries1.json Label EN|Label NO blue
series/myseries2.json Custom Name|Egendefinert red
```

- **Line 1:** Title (bilingual with `|` separator)
- **Start = YYYY-MM-DD:** Show data from a fixed date onward
- **Start = -NY:** Rolling interval — last N years (e.g. `-5Y`, `-3Y`)
- **Start = -NM:** Rolling interval — last N months (e.g. `-18M`, `-6M`)
- **History = N:** Show only the last N data points (use `Start` instead when mixing frequencies)
- **Deci = N:** Decimal places in tooltips (default: 1)
- **Series lines:** One per line with optional label and color

`Start` is recommended over `History` when combining series of different frequencies (e.g. weekly and monthly), since `History = 60` gives 5 years of monthly data but only 1 year of weekly data. `Start` trims all series to the same time range.

### Series Line Format

Each series line can include optional trailing keywords, parsed right-to-left:

```
filename [Label EN|Label NO] [colorname] [type] [stacking]
```

- **filename:** Auto-lowercased, `.json` auto-appended, `series/` auto-prepended. Cross-domain references supported: `OtherDomain/series/filename`
- **Label** (optional): Bilingual display name with `|` separator. If omitted, the description from the JSON file is used.
- **Color name** (optional): `blue`, `sand`, `olive`, `red`, `orange`, `navy`, `yellow`, `brown`, `khaki`, `teal`, `green`, `grey`, `black`. Named colors are defined in `lang-config.php` and can be customized per deployment.
- **Type** (optional): `line`, `spline`, `column`, `area`, `areaspline`, `bar`. Overrides the chart type from the JSON file.
- **Stacking** (optional): `null` (no stacking), `normal` (stacked), `percent` (100% stacked). Must be the last word on the line.

### Examples

Rolling 3-year travel chart with stacked columns:
```
Travel to Neighbours Abroad|Kortreiste utlandsreiser
Start = -3Y
Deci = 0
se.total Sweden|Sverige blue column normal
dk.total Denmark|Danmark red column normal
```

Mixed-frequency dashboard with cross-domain reference:
```
CPI, PPI & Reservoirs|KPI, PPI & Vannmagasin
Start = -5Y
Deci = 1
c00.idx CPI|KPI red spline null
snn0.idx PPI|PPI blue spline null
Energy_Reservoirs/series/no1.pct Reservoirs|Vannmagasin green areaspline null
```

Style properties from JSON files (chart type, stacking, line width) are applied automatically. Keywords in chart.txt override the JSON values — so you can change a spline to a stacked column without editing the JSON data.

---

## KPI Dashboard Cards

Card files (`card1.txt`, `card2.txt`, ...) create dashboard-style KPI cards on the series page.

### Format

```
Card Title|Korttittel
Type = pct
filename unit Label|Etikett
```

- **Line 1:** Title (bilingual)
- **Type** (optional): `pct` (default) for percentage with arrows, `num` for plain number
- **Deci = N** (optional): number of decimals. Default: 1 for `pct`, 0 for `num`
- **Metrics:** One per line — `filename unit label`
- **Units** support bilingual with `|`: `"People|Personer"`

The filename refers to a JSON file inside the domain folder. Cards can also reference series from **other domains** using a full path — for example, `CPI/series/c00.idx` pulls a CPI series into a Travel dashboard. This cross-domain capability lets you build summary dashboards that combine KPIs from multiple statistical domains.

### Card Types

| Type | Display | Use for |
|---|---|---|
| `pct` | Value with `%`, colored arrows (blue up, red down) | Percentage changes (YoY, MoM) |
| `num` | Plain number, no arrow or color | Index values, counts |

### Examples

Percentage card:
```
CPI Total|KPI Total
pct_12_c00.idx % YoY Change|Arlig Endring
pct_1_c00.idx % Monthly|Manedlig Endring
```

Plain number card:
```
PPI Total Index|PPI Total Indeks
Type = num
snn0.idx "" Index|Indeks
```

Cross-domain card (referencing a series from the CPI domain):
```
CPI Reference|KPI Referanse
Type = num
CPI/series/c00.idx "" Index|Indeks
```

Use `""` (empty quotes) for the unit when no suffix is needed.

---

## Table Reports

Table files (`table1.txt`, `table2.txt`, ...) define structured reports combining multiple series.

### Format

Each line has an indent level (0-3) and a type:

| Indent | Type | Description |
|---|---|---|
| 0 | `H` | Header row (bold, green background) |
| 0-3 | `S` | Series row — indent controls nesting depth |
| 0-3 | `SB` | Series row, bold |
| 0 | `T` | Text row — free text across full width (light background) |
| 0 | `TB` | Text row, bold |
| 0 | `F` | Footer row (italic, below table) — sources, footnotes |
| — | `--` | Comment (ignored) |

### Config Options

| Setting | Description |
|---|---|
| `History = N` | Show only last N date columns (default: 5) |
| `Decimals = N` | Override decimal places for all values |
| `DerivedC = pct(N) Label\|Etikett` | Add a % change column (lag N periods) |
| `DerivedC = diff(N) Label\|Etikett` | Add a difference column (lag N periods) |
| `DerivedC = pct(N) 2 Label\|Etikett` | With explicit decimal places |

H, T, and F lines support bilingual text with `|`. Series lines can include an optional description override.

### Superscript Footnotes

Use `(n)` in text, series descriptions, and footer lines to render superscript footnote markers:

```
1 S c01.idx.json Food & Beverages(1)|Mat og Drikke(1)
0 F (1) Including non-alcoholic beverages|(1) Inkludert alkoholfrie drikkevarer
```

This renders `(1)` as a superscript `¹` in both the table and the footnotes below.

### Example

```
History = 15
Decimals = 1
DerivedC = pct(1) Percent|Prosent
DerivedC = pct(12) YoY %|Årlig %
0 H Table 1. CPI Total and Main Groups|Tabell 1. KPI Total og Hovedgrupper
0 SB c00.idx.json
0 T Main Consumer Groups|Hovedgrupper KPI
1 S c01.idx.json Food & Beverages(1)|Mat og Drikke(1)
1 S c02.idx.json
1 S c03.idx.json
--1 S c04.idx.json   (commented out)
0 F Source: ssb.no harmonize.no(2)|Kilde: ssb.no harmonize.no(2)
0 F (2)www.Harmonize.no|(2)www.harmonize.no
```

![Table Report](images/Table.png)

Features:
- Frozen description column on horizontal scroll
- Derived columns (% change, difference) calculated automatically
- Superscript footnote markers `(n)` in descriptions and footers
- CSV download and print buttons
- **Chart** button — combined chart of all series in the table
- **Multichart** button — one chart per series
- Language toggle and Back button in the navbar

---

## About Section

Each domain folder can have an `about.txt` file that adds a descriptive paragraph at the top of the series page, between the header and the dashboard chart.

### Format

Bilingual text separated by `---`:

```
The Consumer Price Index (CPI) measures the average change in prices
paid by consumers for a representative basket of goods and services.
The index is published monthly by Statistics Norway.
---
Konsumprisindeksen (KPI) måler den gjennomsnittlige prisendringen
for en representativ kurv av varer og tjenester. Indeksen publiseres
månedlig av Statistisk sentralbyrå.
```

- Language 1 text above the `---` separator, language 2 below
- Displays as a full-width card with green left border
- If the file is missing or empty, no about section is shown

---

## Contact Section

Each domain folder can have a `contact.txt` file that adds contact cards at the bottom of the series page, before the footer.

### Format

Each contact is a block of lines (name, email, phone), separated by `---`:

```
Ola Nordmann
ola.nordmann@harmonize.no
+47 12 34 56 78
---
Kari Hansen
kari.hansen@harmonize.no
+47 87 65 43 21
---
Per Johansen
per.johansen@harmonize.no
+47 11 22 33 44
```

- First line of each block is the contact name (displayed bold)
- Email addresses become `mailto:` links automatically
- Phone numbers become `tel:` links automatically
- Any other lines are displayed as plain text
- Any number of contacts is supported (typically 2-5)
- The section heading ("Contact" / "Kontakt") switches with the language

---

## Press Releases

Each domain folder can have a `press/` subfolder with HTML and PDF press releases, organized by language.

### Folder Structure

```
Prices_CPI_(2025)/
  press/
    1_english/
      2026-09-09_Fuel_prices_up_in_September.html
      2026-07-09_Technical_operational_problems.html
    2_norwegian/
      2026-09-09_Drivstoffpriser_opp_i_september.html
      2026-07-09_Tekniske_driftsproblemer.html
```

### Naming Convention

- **Subfolder name:** first character is the language number (`1_english`, `2_norwegian`, etc.)
- **Filename:** date prefix `YYYY-MM-DD_` followed by a descriptive slug using underscores
- **Formats:** `.html` and `.pdf` are supported
- Underscores in filenames are displayed as spaces in fallback titles

### How It Works

- No config file needed — press releases are auto-discovered by scanning the `press/` folder
- Sorted newest first by filename (date prefix)
- Title is extracted from the HTML `<title>` tag; for PDFs, derived from the filename
- HTML press releases open inside the Harmonize layout (navbar, back button, footer)
- PDF files open directly in a new tab with a "PDF" badge in the listing
- The correct language subfolder is selected based on the current `?lang=` parameter
- Falls back to language 1 if the current language folder doesn't exist

### Writing Press Releases

Press release HTML files only need basic content — `<title>`, headings, and paragraphs. The `pressview.php` wrapper provides the Harmonize navigation and styling:

```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Fuel prices up in September</title>
</head>
<body>
<h1>Fuel prices up in September</h1>
<p><em>Published: 9 September 2026</em></p>
<p>The CPI rose 0.5 per cent from August to September...</p>
</body>
</html>
```

---

## Language and Domain Configuration

The databank supports two languages. Each country or installation decides which two languages to use — these can be **any** languages (e.g. English and Norwegian, English and Albanian, Arabic and French). The choice is made once during deployment by editing `lang-config.php`. For full technical details on this file, see [Language Configuration](INSTALL.md#language-configuration) in the Install Guide.

### Language Selector

A dropdown in the navigation bar lets users switch between languages on all databank pages. The URL parameter `?lang=1` (primary) or `?lang=2` (secondary) is preserved across page navigation.

### Bilingual Content in Config Files

All text-based config files (`chart.txt`, `card*.txt`, `table*.txt`, `about.txt`) use the pipe `|` separator for bilingual text:

```
English text|Norwegian text
```

Examples:
- Chart title: `Consumer Price Index|Konsumprisindeksen`
- Card label: `YoY Change|Årlig Endring`
- Card unit: `"People|Personer"`
- Table header: `0 H CPI Total|KPI Total`
- Table footer: `0 F Source: SSB|Kilde: SSB`
- About text: language 1 above `---`, language 2 below

### Domain Labels and Grouping

Domain folders can have bilingual display names and be organized into named subgroups on the landing page. This is configured in `lang-config.php` — see the [Domain Display Names](INSTALL.md#domain-display-names) section in the Install Guide for details.

For example, `Prices_CPI_(2025)` displays as "Consumer Prices CPI" and is grouped under "Prices and price indices".

### Named Color Palette

Named colors used in `chart.txt` are defined in `lang-config.php`:

| Name | Hex | Name | Hex |
|---|---|---|---|
| blue | #628DCB | navy | #1A3A70 |
| sand | #C7B491 | yellow | #e4d354 |
| olive | #89A54E | brown | #D6995C |
| red | #AA4643 | khaki | #CAC47F |
| orange | #f47835 | teal | #2b908f |
| green | #339966 | grey | #808080 |
| black | #333333 | | |

To change the color scheme, edit the `$colors` array in `lang-config.php` — all charts using named colors update automatically.

### Where Language Applies

| Component | Language 1 | Language 2 |
|---|---|---|
| Series descriptions | `description` from JSON | `desc2` from JSON |
| Domain names | First element in `$domains` label | Second element |
| Chart titles | Text before `\|` in chart.txt | Text after `\|` |
| Card labels & units | Text before `\|` in card*.txt | Text after `\|` |
| Table headers/footers | Text before `\|` in table*.txt | Text after `\|` |
| About text | Above `---` in about.txt | Below `---` |
| Contact heading | "Contact" | "Kontakt" |
| Press releases | `press/1_*/` folder | `press/2_*/` folder |
| UI labels | First element in `$labels` | Second element |
| Number formatting | `dec_point` / `thousands` per language | Different per language |
