Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

An exception has been thrown during the rendering of a template ("Array to string conversion")

admin first-time form

Started by vaidotas lipskas 9 years ago · 2 replies · 2030 views
9 years ago

Hello, i've been facing this error for a while and i cant find a fix to it. The code is below, maybe anyone knows how to handle it? Thank you in advance

57|690x453

and my blueprint is

YAML
title: Project
'@extends':
    type: default
    context: blueprints://pages

form:
  fields:
    tabs:
      type: tabs
      active: 2

      fields:
        content:
          fields:
                header.imgUrl:
                  type: text
                  label: First image link

                header.image:
                  type: file
                  label: First image
                  destination: 'user/themes/antimatter/images'
9 years ago

Try {{ image|first.path }} or {{ theme_url ~ '/images/' ~ image|first.name }}.

For some reason, I remember {{ image|first.path }} not routing correctly on subpages, so I included the second one. Both should work though.

👍 1
9 years ago

@bbricker87:
{{ theme_url ~ '/images/' ~ image|first.name }}

Both options seems working perfectly thank you ! :)

Suggested topics

Topic Participants Replies Views Activity
Forms & Blueprints · by Japhy, 2 weeks ago
2 269 4 days ago
Forms & Blueprints · by FrViPofm, 4 weeks ago
5 329 4 weeks ago
Forms & Blueprints · by Ton Haarmans, 6 years ago
13 2319 8 months ago
Forms & Blueprints · by Hugo Oliveira, 9 months ago
0 781 9 months ago
Forms & Blueprints · by Flachy Joe, 10 months ago
9 871 10 months ago