# Brandwonden Patient Portal Website

## Development setup
Requires DDEV.

- clone this repository (f.e. type command `git clone URL` in your projects folder)
- go to your project's directory (f.e. type command `cd patient-portal-website`)
- run `ddev start` to create and start the containers
- run `ddev exec composer install`
- import a database dump from another environment; for example `ddev import-db --file=dumpfile.sql.gz`
- download assets from the other environment (web/assets/images/)
- add a SCSS file watcher in PHPStorm
    - arguments: `--style compressed $ProjectFileDir$/dev/scss/main.scss`
    - output paths to refresh: `$ProjectFileDir$/web/css/main.css`
    - working directory: `$FileDir$`
    - select `create output from stdout`

## Update SCSS from frontend developer

- Copy the content of his src directory into the dev directory, except for the assets. (overwrite existing files, merge existing directories; make sure not to remove our dev/scss/_custom.scss file)
- Copy the assets folders from the dist directory into web/assets/ (except images, unless there are images updated that we don’t manage in Craft like the favicon or SVGs)
- Add the following line at the bottom of the dev/scss/main.scss file: `@import "_custom.scss";`

## Create new component entry types

- Add the new entry type in the Craft settings. Choose an appropriate icon. Use the "Sky" color if the entry type is based on other entries. (like for example a list of testimonial entries) Otherwise, use no color.
- If the entry type also has to be used for the generic content, for a single page:
-- Modify the "Content" field: add the entry type in the "Building blocks" group if you chose the Sky color, or in the General group if it's not based on other entries.
-- Modify the "Generic content" entry type: Add the new entry type description to the "hint" text.
- Add a template for the new entry type under templates/generic-content/entry-types/. The filename should be the same as the entry type handle, with .twig as extension. The entry content can be accessed in the template with the `entry` variable. (for example `{{ entry.title }}`)