KYMP, short for Kaupunkiympäristö ja liikenne, also formerly known only as Liikenne is a site that contains information about the city, its development, and transportation.
Env | Branch | URL |
---|---|---|
local | dev | http://helfi-kymp.docker.so/ |
production | main | https://hel.fi/fi/kaupunkiymparisto-ja-liikenne |
You need to have these applications installed to operate on all environments:
To install Drupal from scratch using existing configuration:
$ make new
To sync database from testing environment:
$ make fresh
This will log you inside the app container:
$ make shell
Modify the value of COMPOSE_PROFILES
environment variable from .env
file or start the project with COMPOSE_RROFILES=your-profiles make up
.
search
queue
A content type that includes a node for every district and subdistrict in Helsinki. The page layout closely follows the
standard page layout. Each district can be either a main district or a subdistrict, depending on the contents of the
Subdistricts (field_subdistricts
) field on the node. The content was initially created automatically from Helsinki
city districts and subdistricts and is manually adjusted over time.
A custom content type for the KYMP instance, closely related to the district content type. Each project is associated with an district via the entity reference field Project District (field_project_district). Projects can be categorized in various ways and follow a layout similar to the standard page. Projects can be searched using the District and Project Search.
A block in the sidebar of pages with the content type district lists subdistricts related to the
viewed district. The logic for this block is located in the custom module helfi_kymp_content
.
- Module: part of helfi_kymp_content
This paragraph lists the city development plans for people to see and comment.
- Module: helfi_kymp_plans
- API: https://ptp.hel.fi/rss/nahtavana_nyt/
- Cron: invalidate-tags-kymp
The paragraph has configurable title and description fields, but the rest of the logic is hardcoded. On page load, the
API is queried and the result is cached. The plans are then displayed in the block. A simple JavaScript is used to
toggle the visibility of the plans. The related JavaScript and PHP code can be found here.
The template for the paragraph is located in the hdbt_subtheme
.
Cron is used to clear the cached plans once an hour.
The District and Project Search tool allows users to search for city districts and development projects.
The District and Project Search is a React search that uses views listing (district_and_project_search
) as a fallback
when JavaScript is not enabled. All React searches are in the hdbt
theme, so most of the related logic is also found
there. The district_and_project_search paragraph has an editable title and description. When development on the feature
started the city districts were imported using helfi_kymp_migrations
module.
- Module: part of helfi_kymp_content
- React: district-and-project-search
- ElasticSearch: districts, districts_for_filters, projects, project_phases, project_themes and project_types indexes
Districts and subdistricts have been added to the Drupal database via the helfi_kymp_migrations
module. Projects are created manually by content creators. Searching for projects works like any other React search.
A Project List paragraph displays Projects based on the referenced District in
the Area field (field_project_list_district
). To link the block to the District and Project Search,
add the Search Link Parameters (field_search_link_parameters
).
The paragraph uses a view called Project List (project_list
)to filter desired projects based on the given contextual
filter, which is the District in this case. The paragraph also includes editable title and description fields.
An embedded external tool by HSL allows users to find bike routes within the HSL area.
The paragraph contains title and description fields, and includes an embedded iframe. This iframe is hardcoded into the
hdbt_subtheme
here
and is not configurable through the editor. The layout is constructed in the template using data provided by the
hdbt_subtheme
preprocess hook.
The Ploughing Schedule paragraph is a tool that allows website users to get an estimated snow ploughing schedule for a specific street.
This search functionality is built with React and does not have any fallback listing or similar feature. All
React-based searches are located in the hdbt
theme, where most of the related logic is implemented.
- Module: helfi_kymp_content
- Cron: street_data
- Street-data api: https://kartta.hel.fi/ws/geoserver/avoindata/wfs
- ElasticSearch: street_data -index
- React: hdbt/ploughing-schedule
Unlike other ElasticSearch implementations, the ploughing schedule does not use the Drupal database as a data source.
Instead, the data is directly fetched from an API and indexed into ElasticSearch. A cron job automatically indexes the
data into the street_data
index once a day. The UI is a simple React application.
This module depends on another test content creation module called helfi_test_content
. The purpose of this module is
to provide additional custom test content unique to this instance, allowing developers to test components without
manually creating content.
Most likely useless module to be disabled and removed. REMOVE THIS FROM DOCUMENTATION IF THE CUSTOM MODULE HAS BEEN REMOVED.