Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

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 · 2142 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 Anna, 2 days ago
2 53 16 hours ago
Forms & Blueprints · by Anna, 3 days ago
7 82 16 hours ago
Forms & Blueprints · by Anna, 1 week ago
5 186 6 days ago
Forms & Blueprints · by TomW, 1 month ago
3 379 1 month ago
Forms & Blueprints · by Japhy, 2 months ago
2 595 2 months ago