Skip to content
Snippets Groups Projects
Commit 90d34241 authored by FORESTIER Fabien's avatar FORESTIER Fabien
Browse files

Add doc for static pages

parent 8d18a97f
No related branches found
No related tags found
2 merge requests!14Doc webapp,!13Doc webapp
# Static pages
Some pages of the application such as `Accessibility` or `Approach` only contains editorial content. Our need was to be able to easily update the content of those pages and that this action could be realized by a non technical person.
This is why we choosed to use a CMS ([Ghost](../../off-the-shelf-apps/cms.md)) that makes the entry of editorial content easy with a well designed interface. Each page is identified by a unique slug (ex: `mentions-legales`) that can be used to identify them.
[Elasticsearch](../../off-the-shelf-apps/elasticsearch) is the entrypoint we use to retrieve datasets and articles, so we decided to homogenize the way we collect data and to have one unique entrypoint. Indeed, we decided to index the static pages as well in elasticsearch. Doing so we also anticipate a need that might come in the futur that would be the research in all the application.
In the Angular application, there is one unique component that handles the display of those pages: `cms-page.component.ts`. We defined a different path for each page but all are associated with this component (see `editorialisation-routing.module.ts`). In order to retrieve the right content the component reads the path of the current url. Then it uses a particular property of the environment variable (see environment files) that contains the mapping between the angular paths of the pages and their slug in Ghost. Finally, a request is made to elasticsearch with the page's slug to retrieve its content and then display it.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment