Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1039: Added overwriteables templates for flow pdfs #315

Merged
merged 5 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions web/sites/default/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,15 @@
*/
$settings['base_url'] = 'http://nginx:8080';

/**
* Flow notification pdf template.
*
* HTML template for PDF notifications (digital post). If the template is a path, e.g.
* themes/custom/os2forms_selvbetjening_theme/templates/pdf/os2forms-selvbetjening-maestro-notification-pdf-html.html.twig,
* the template will be loaded from this path.
*/
$config['os2forms_forloeb.settings']['templates']['notification_pdf'] = 'themes/custom/os2forms_selvbetjening_theme/templates/pdf/os2forms-selvbetjening-maestro-notification-pdf-html.html.twig';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉


/**
* Load local development override configuration, if available.
*
Expand Down
11 changes: 5 additions & 6 deletions web/themes/custom/os2forms_selvbetjening_theme/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,22 @@ Two templates, `os2forms-attachment--webform-submission.html.twig` and
`os2forms-selvbetjening-maestro-notification-pdf-html.html.twig`, are used to render os2forms attachment and maestro notification (pdf) html,
respectively (the templates are used to render PDF files sent as Digital post).

The maestro notification pdf template should be configured on
`admin/config/system/os2forms_forloeb` as
The maestro notification pdf template is configured in `settings.php` as

```sh
themes/custom/os2forms_selvbetjening_theme/templates/pdf/os2forms-selvbetjening-maestro-notification-pdf-html.html.twig
```

or in `settings.local.php` as
which you can override in `settings.local.php` as

```sh
$config['os2forms_forloeb.settings']['templates']['notification_pdf'] = 'themes/custom/os2forms_selvbetjening_theme/templates/pdf/os2forms-selvbetjening-maestro-notification-pdf-html.html.twig';
$config['os2forms_forloeb.settings']['templates']['notification_pdf'] = 'path/to/template';
```

whereas the os2forms attachment template automatically should be used.
The os2forms attachment template should automatically be used.

To allow usage of a common stylesheet in the two templates you
can configure `base_url` in `settings.local.php`
can override the default value (see `settings.php`) in `settings.local.php`:

```php
$settings['base_url'] = 'http://nginx:8080';
Expand Down
Loading