We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 39eb208 commit 4311b08Copy full SHA for 4311b08
blueprints/fields/og-image.php
@@ -1,11 +1,13 @@
1
<?php
2
3
-use Kirby\Cms\App;
+use Kirby\Toolkit\Str;
4
5
-return function () {
+return function ($app) {
6
$blueprint = [
7
'type' => 'files',
8
'multiple' => false,
9
+ 'uploads' => [],
10
+ 'query' => Str::contains($app->path(), 'site') ? "site.images" : "page.images" // small hack to get context for field using api path
11
];
12
13
if ($parent = option('tobimori.seo.files.parent')) {
@@ -21,10 +23,6 @@
21
23
'template' => $template
22
24
25
- if (!isset($blueprint['query'])) {
- $blueprint['query'] = "page.images";
26
- }
27
-
28
$blueprint['query'] = "{$blueprint['query']}.filterBy('template', '{$template}')";
29
}
30
0 commit comments