I’ve stumbled on some curious behavior and am likely opening walls where I’m not supposed to.
For example, if I create a /blueprints/sections/files.yml blueprint that holds a group of files sections for pdfs, images, videos, and general files:
sections:
images:
type: files
info: "{{ file.dimensions }} ({{ file.niceSize }})"
image:
cover: true
size: small
layout: cardlets
help: "Curated display images only. Uses 'image' template."
So, for example, I could call them in a page blueprint like this:
sidebarSections:
videos:
extends: sections/files.videos
pdfs:
extends: sections/files.pdfs
images:
extends: sections/files.images
files:
extends: sections/files.files
It works, mostly, but even though in the section file i’ve declared what type of section ‘images’ is, it doesn’t work. I need to declare what type of section it is in the page blueprint that calls it. I know I mentioned this above.
It seems like I can not, however, define what template that section will use (for when I’m uploading files) in the page blueprint, but that it can’t be defined in the extended section file.
So:
files:
extends: sections/files.images
template: image
The template: image bit is supposed to restrict what template is applied to the file on upload. But if I define the template in the section file, it doesn’t work. You have to add it to the extends code like above.
This applies to several things, including help text, fetch, queries, etc. Essentially when you do this you end up not saving any time. It’s a notable difference between extending a fields file versus the sections files.
Best bet in this case is to go back to splitting up the section extends into separate files. That method works more reliably and as expected.
Conclusion
So, I wanted to document this but it seems super niche, edge case stuff.
I’m really not a dev so when I am exploring how to do these things I feel like i’m moving in a way that wasn’t developed for. But I’m learning nonetheless, and that’s good. I’m finding the walls, and feel like I can see better, actually.
Next
Again, next step is to actually convert everything over to the blueprint layout idea as shown in the Docs (linked above) and hope that the overrides I do for that saves me a ton of time and repitition.