diff --git a/themes/grav/templates/forms/fields/file/file.html.twig b/themes/grav/templates/forms/fields/file/file.html.twig index 8085ad4c..5b87b40e 100644 --- a/themes/grav/templates/forms/fields/file/file.html.twig +++ b/themes/grav/templates/forms/fields/file/file.html.twig @@ -30,7 +30,8 @@ {% set files = global.files %} {% set config = global.grav.config %} {% set route = global.context.route() %} - {% set type = global.context.content() is not null ? 'pages' : global.plugin ? 'plugins' : global.theme ? 'themes' : 'config' %} + {% set type = get_class(global.context) == 'Grav\\Common\\Page\\Page' ? 'pages' : global.plugin ? 'plugins' : global.theme ? 'themes' : 'config' %} + {% set blueprint_name = global.blueprints.getFilename %} {% if type == 'pages' %} {% set blueprint_name = type ~ '/' ~ blueprint_name %}