Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Forms & Blueprints

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 · 1786 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 Ton Haarmans, 5 years ago
13 1138 4 months ago
Forms & Blueprints · by Hugo Oliveira, 5 months ago
0 61 5 months ago
Forms & Blueprints · by Flachy Joe, 6 months ago
9 135 6 months ago
Forms & Blueprints · by Augustus, 7 months ago
7 110 7 months ago
Forms & Blueprints · by Julien, 7 months ago
10 129 7 months ago