sylvainjule / kirby-imageradio

Add illustrations to Kirby's radio buttons. Kirby 3 and 4.
59 stars 6 forks source link

text: option not work #8

Closed pfrlv closed 5 years ago

pfrlv commented 5 years ago

Option like a text: "Pic: {{ file.filename }} Size: {{ file.modified('d Y') }}" — not work for me. I see only filename always 😕. Kirby 3.1.1

sylvainjule commented 5 years ago

Kirby will only render one brackets-string. I guess it's not specific to this plugin and would produce the same output in other core-fields?

You'd have to make it a file method:

'fileMethods' => [
    'toInfos' => function() {
        return 'Pic: ' . $this->filename() . ' Size: '. $this->modified("d Y")';
    },
}

Then:

text: '{{ file.toInfos }}'
sylvainjule commented 5 years ago

Closing this issue since it'll most likely fix your problem. Please feel free to reopen if it doesn't.