I am trying to set up a file blueprint that works both for images and videos (as you can only assign one type of template in a section, correct?). Now, as the metadata I require for each are slightly different, I would like to show some fields/sections only conditionally depending on the file being an image or video.
Is there any way to do this? What would the syntax look like?
I don’t think you can trigger the conditional stuff based on file type. you could put tabs in the meta and put the video stuff in one tab and image fields in the other.
Personally i just use two sections, and set the template on each respectively. I leave the video one in list mode so it doesn’t take much room, and set the images one to cards. I normally put these under a "Media’ tab in the main page blueprint.
alternatively you could put a toggle field in the meta for toggling between video and image, and trigger the fields the way.
thirdly, you could use an upload hook to set the desired template in the files meta based on the file type. Its a bit of a cheat but should work.