add plugin web2print

This commit is contained in:
isUnknown 2026-03-09 10:14:02 +01:00
parent 1f024a7e71
commit d3b9220931
17 changed files with 596 additions and 2 deletions

View file

@ -0,0 +1,33 @@
<?php
Kirby::plugin('studio-variable/web2print', [
'fields' => [
'web2print' => [
'props' => [
'cssPath' => function($cssPath = null) {
return $cssPath;
}
],
'computed' => [
'htmlPageString' => function() {
return $this->model()->render();
},
'cssPath' => function() {
return $this->cssPath ?? 'assets/css/style.css';
},
'printFormat' => function() {
return $this->model()->printFormat()->value() ?? 'A4';
},
'pageId' => function() {
return $this->model()->id();
}
]
]
],
'routes' => [
require __DIR__ . '/src/routes/web2print.php',
],
'blueprints' => [
'tabs/web2print' => __DIR__ . '/src/blueprints/tabs/web2print.yml'
]
]);