may be for public files you need to use mediafinder
widget
as we need to store this files anyways in public space so we can use mediafinder
as described here by author https://github.com/octobercms/october/issues/964
you can define extra fieldname
in table like for ex: banner(text)
and then you can use that field and mediafinder
combination to achieve SEO friendly names
.
column config :
fields:
... some fields
banner:
label: Banner
oc.commentPosition: ''
mode: file
span: auto
type: mediafinder
when you want show image you can use :
page code section
use HardikSatasiya\DemoTest\Models\Demo;
function onStart() {
$this['record'] = Demo::find(5);
}
page markup section
<img src="{{ record.banner|media }}" alt='extra-seo-name' />
rendered out put
<img src="/storage/app/media/drawing.png" alt='extra-seo-name' />