I’m working on a Hotspots on Map FormWidget. I have the functional version ready, but I want to get advice on how you would solve the image of the map. Now I statically add the path to the image from the theme assets.
(zdravim snipi)
yes, I thought that I would make a model setting with mediafinder and create a twig function that would return the path to the area for working in twig
One idea is to make the form widget depend on an attachOne relation defined on the model.
Then save the image to this relation, here is how you can set the relation as the image
$model->avatar = (new File)->fromFile('/path/to/somefile.jpg');
$model->avatar = (new File)->fromData('Some content', 'sometext.txt');
$model->avatar = (new File)->fromUrl('https://example.tld/path/to/avatar.jpg');