Hi !
I’ve got a problem with some image in template.
I create a “place.yml” in blueprints. In the blueprint, I’ve got a files field name “image”.
In blueprint =>
image:
label: Image
type: files
multiple: false
And in my template, I display the image like this :
<?php if ($image = $place->image()): ?>
<img class="cover" alt="<?=$image->alt()?>" title="<?=$image->title()?>" loading="lazy" src="<?=$image->resize(500)->url()?>" />
<?php endif; ?>
The image displayed is the old image uploaded in the panel.
I put two div above the image with var_dump in it on the page : Boulangerie, Pâtisserie, Bastarderie I The French Bastards - Boutiques I The French Bastards
You can see result :
var_dump($imgCover); => object(Kirby\Cms\File)#501 (20) {
["root"]=>
string(85) "/homepages/18/d736004790/htdocs/www/content/3_boutiques/1_saint-denis/saint-denis.jpg"
["hash"]=>
string(32) "1a16fc74a107a791f969dd8310cf5bf0"
["filename"]=>
string(15) "saint-denis.jpg"
["name"]=>
string(11) "saint-denis"
["safeName"]=>
string(11) "saint-denis"
["extension"]=>
string(3) "jpg"
["size"]=>
int(63557)
["niceSize"]=>
string(9) "62,07 KB"
["modified"]=>
string(25) "2024-11-20T08:33:17+01:00"
["mime"]=>
string(10) "image/jpeg"
["type"]=>
string(5) "image"
["isWritable"]=>
bool(true)
["isReadable"]=>
bool(true)
["dimensions"]=>
array(4) {
["width"]=>
int(448)
["height"]=>
int(448)
["ratio"]=>
float(1)
["orientation"]=>
string(6) "square"
}
["exif"]=>
array(8) {
["camera"]=>
array(2) {
["make"]=>
NULL
["model"]=>
NULL
}
["location"]=>
array(2) {
["lat"]=>
NULL
["lng"]=>
NULL
}
["timestamp"]=>
int(1732087997)
["exposure"]=>
NULL
["aperture"]=>
NULL
["iso"]=>
NULL
["focalLength"]=>
NULL
["isColor"]=>
bool(true)
}
["id"]=>
string(37) "boutiques/saint-denis/saint-denis.jpg"
["template"]=>
NULL
["url"]=>
string(100) "https://thefrenchbastards.fr/media/pages/boutiques/saint-denis/91e64c7fe3-1732087997/saint-denis.jpg"
["content"]=>
object(Kirby\Cms\Content)#547 (0) {
}
["siblings"]=>
object(Kirby\Cms\Files)#500 (4) {
[0]=>
string(37) "boutiques/saint-denis/saint-denis.jpg"
[1]=>
string(30) "boutiques/saint-denis/sd_1.jpg"
[2]=>
string(30) "boutiques/saint-denis/sd_1.png"
[3]=>
string(30) "boutiques/saint-denis/sd_1.tif"
}
}
And
var_dump($imgCover->toFile()); => object(Kirby\Cms\Field)#549 (1) {
["tofile"]=>
NULL
}
I don’t understand why this is the old image. Can you help me?
Thank