Forum

Thread tagged as: Problem, Field-Types

File field type not working correctly with Blocks?

Using Perch Runway 2.8.2, we don’t seem to be able to successfully use field type “file” within blocks. By way of example, if we set up a simple one region document library page, assign the default file.html template to that region and enable multiple items, we can add/change/delete files on the page as expected. However, if we wrap the contents of file.html into a block like this…

<perch:blocks>  
    <perch:block type="document" label="Document">
    <a href="<perch:content id="file" type="file" label="File" order="2" />"><perch:content type="text" id="desc" label="Title" order="1" required="true" title="true" /></a>
    </perch:block>
</perch:blocks>

…and use that template for the region instead, we get strange results. We can upload and add files to the page, but when we go back to edit the page and re-save, all of the existing file references are reset to null. The titles are still there but Perch has no record of a file having previously been selected or uploaded to that field.

Are file fields fully supported within blocks – or are we doing something wrong?

Andrew Rayner

Andrew Rayner 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Is it working with images?

Yes, all works fine with images. Already using those...

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, we'll take a look and see what we can come up with. It's surprising as files and images are essentially the same, but we'll look into it.