Skip to content

Commit

Permalink
#1039: Added base_url variable to twig variables
Browse files Browse the repository at this point in the history
  • Loading branch information
jekuaitk committed Mar 27, 2024
1 parent 9186e26 commit f96b25f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ before starting to add changes. Use example [placed in the end of the page](#exa
- [#84](https://github.com/OS2Forms/os2forms/pull/84)
Added digital post test command.
- [#95](https://github.com/OS2Forms/os2forms/pull/95)
Added `base_url` variable to Maestro notification twig.
Added `base_url` variable to twig templates.

## [3.14.1] 2024-01-16

Expand Down
10 changes: 10 additions & 0 deletions modules/os2forms_attachment/os2forms_attachment.module
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Site\Settings;
use Drupal\os2forms_attachment\Entity\AttachmentComponent;

/**
Expand Down Expand Up @@ -317,3 +318,12 @@ function os2forms_attachment_module_implements_alter(&$implementations, $hook) {
}

}

/**
* Implements hook_preprocess().
*
* Add 'base_url' variable to be used by templates.
*/
function os2forms_attachment_preprocess(&$vars) {
$vars['base_url'] = Settings::get('base_url');
}

0 comments on commit f96b25f

Please sign in to comment.