From ba2c8177f8e780d8b5488cae3b9b5ce42c4708e4 Mon Sep 17 00:00:00 2001 From: Flavio Copes Date: Wed, 12 Oct 2016 18:33:57 +0200 Subject: [PATCH] Simplify how we determine if it's a page, fix https://github.com/getgrav/grav/issues/1100 --- themes/grav/templates/forms/fields/file/file.html.twig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 %}