i am struggeling with files in the panel and in the template.
my request is that i want to output a specific image of a page. if i understood it correctly, this works via “template”, right?
my blueprint looks like this:
during the upload i get an error message that the mime type is not allowed. but it is uploaded anyway and i can select it via “select”. why does this error message appear?
the “template”, which i specify is not set. the txt file remains empty. how do i get the template to be set?
does the query of a file really only work via the template option, if I don’t know the exact name?
is it possible to change the template of a file when i select another file in this files field?
it would be nice if you could answer another question for me.
the following code should give me the image with the templae “icon” from the latest blog article to show it on the home page. the conten from this article is shown, but the image is “unknown”. where is my fault?
The way you do it, $blogIcon will be a files collection, not a single image. Do you want to get the image(s) selected in the icon field, or just any random image with the icon template?
If you want to fetch the image(s) selected in the field, your template code must look different: