Routing templates thats start with an underscore More of a question than problem; I see this often - templates that start with an underscore. For example, _entry.html.

Reading the Craft docs:


  Note that if any of the URI segments begin with an underscore ('_'), Craft will return a 404, since template path segments that begin with an underscore are considered "hidden" from direct access


I guess I'm confused as to what I am hiding from. Is it so I can't directly browse right to the full path of that template?

mysite.com/something/something/_template.html

If you move the craft folder outside of the site root, I can't really get to that file can I? It just isn't obvious to me (yet) what the benefit is and when/where/why I need to start a template with and underscore.

Thank you!
Yes, prefixing a template's filename with an underscore does what it says on the box – any underscored template will be excluded from route mapping.

A typical use case is to use underscores for partials or wrappers, e.g. "_mainmenu.html" or "_baseTemplate.html" – essentially any template that doesn't make any sense to load up or access directly in the browser via that template's path.

This isn't a mandatory thing, but a good practice.