Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why must placeholders be lowercase?

I've been curious about this for a while so I thought I would ask it here on stack. I was told to always lowercase my Sitecore placeholders by a consultant helping out on one of my projects.

I was new to Sitecore at the time, so I took it in stride and never really questioned it. However, as I've become more familiar with the system and how extensible and modular it can be, I really can't imagine why this would be a requirement..?

There doesn't appear to be any documentation on the subject, however, Sitecore themselves seem lowercase their placeholders in every example site I've ever seen.

The topic is metioned a few times on the web including right here on stack, however, the question remains: WHY?

like image 518
Derek Hunziker Avatar asked Nov 17 '25 19:11

Derek Hunziker


2 Answers

You may be referring to a specific version of Sitecore that had a bug in it. There is currently no requirement for using only lowercase. I suspect when Sitecore's dependency injection / layout engine runs, is compares the placeholder keys on the layout to the controls bound and ignores the cases when matching up placeholder keys.

like image 102
Mark Ursino Avatar answered Nov 20 '25 09:11

Mark Ursino


I isn't a requirement that I've ever heard about and on multiple projects I've had placeholders that aren't all lower case, typically I use camel casing for those.

like image 45
Kyle Heon Avatar answered Nov 20 '25 10:11

Kyle Heon