1. Alfresco Content Services 5.2 Documentation, Content Model Guide: The cm:templatable aspect is defined in the out-of-the-box content models. This aspect adds the cm:template association, which links a node to its presentation template node. The logic for document.template relies on this association being present. (See: Alfresco 5.2 Docs, systemdictionary.xml model definition for cm:templatable).
2. Default Alfresco Share Template Source Code: The default FreeMarker template for the document details page (document-details.get.html.ftl) in Alfresco 5.x explicitly uses this expression. The relevant code snippet is:
freemarker
...
#if>
This demonstrates the canonical method for checking and including a presentation template. (Source: tomcat/webapps/share/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/components/document-details/document-details.get.html.ftl).
3. Alfresco Content Services 5.2 Documentation, Web Scripts: The documentation on web scripts explains that controllers (.get.js files) prepare a model for the view (.get.html.ftl file). The controller for the document details page resolves the template and places it in the model, making it accessible via the document root object. (See: Alfresco 5.2 Docs, Developing -> APIs -> Web Scripts -> Architecture and framework).