Image field not showing image in the panel

I’m using development branch. I know it’s not finished yet.

I have a structure field with an image field.

label: Bilder under
type: structure
style: table
entry: >
  {{image}}
fields:
  image:
    label: Bild
    type: image

Even if I have {{image}} it does not show the image, just the filename. Are there any plans to be able to show the image as well? Or is it possible with any other shortcode?

Very quick example

Something like this:

1 Like

Not currently. The image field stores the filename and the entry doesn’t know which field produced the value. If the entry snippets are implemented, you can control it yourself however.

1 Like

I found a workaround by adding a line in the structure field php original file :

In app/fields/structure/structure.php

Change this

public function entry($data) { if(is_null($this->entry) or !is_string($this->entry)) {

To this

public function entry($data) { $data->_fileUrl = $this->page->contentUrl() . DS; if(is_null($this->entry) or !is_string($this->entry)) {

In the entry field you can now have the full URL by writing this

entry: > {{_fileUrl}}{{image}}

1 Like

Nice workaround tristanbg.

I would recommend not changing the original line, but instead writing a field that is an extention of it (extend the structure class) - and while youre at it - release it as a field plugin so everyone can use it!

Actually @jenstornell made one ! :slight_smile: haha

2 Likes