cms icon indicating copy to clipboard operation
cms copied to clipboard

Use singular nouns in default blueprint handles and titles

Open jacksleight opened this issue 3 years ago • 9 comments

The instructions say blueprint names should be singular: "Usually a singular noun, like Article or Product". However the default/fallback blueprint handle and title are copied from the collection, which is typically plural.

This is a bit annoying, and if you want it to be right you have to remember to change the file name after saving the default blueprint.

This PR changes the default blueprint handles and titles to use singular nouns.

~~If this was enabled by default I think it'd be a breaking change, as existing entries that are using a default/fallback blueprint will have the plural handle saved to the content already. That's why I made it a config option.~~

jacksleight avatar Apr 28 '22 15:04 jacksleight

Love it! I don't think you'd need the config option though. Just look for the plural file if the singular one doesn't exist.

aerni avatar Apr 29 '22 15:04 aerni

Oh I love this too! Let's get a review from @jasonvarga and hopefully get it merged it :D

jackmcdade avatar Apr 29 '22 17:04 jackmcdade

Yes yes and yes!

MariusSpring avatar Jun 07 '22 13:06 MariusSpring

I've updated this with @aerni's suggestion to remove the config option and just check for a singular blueprint instead. My implementation may not be the best way to do that, but it's certainly a much more elegant approach.

I've also had to update a couple of tests as they expected the default blueprint to match the collection name but they're now singular.

jacksleight avatar Jun 10 '22 14:06 jacksleight

Cool cool. I marked this as a draft since you had started making some changes. Mark it as ready when you're done. 🙂

jasonvarga avatar Jun 10 '22 15:06 jasonvarga

All ready now, had some test issues! 😄

jacksleight avatar Jun 10 '22 15:06 jacksleight

Is this ready to merge?

jackmcdade avatar Jun 20 '22 12:06 jackmcdade

Certainly ready for review. 👍

jacksleight avatar Jun 20 '22 12:06 jacksleight

Love it! 🔥

stefanbauer avatar Jun 22 '22 17:06 stefanbauer