Answers.Body: <p>This is very, very simple to do... just put <strong>every single template</strong> into a specific folder, then prefix the folder with an underscore:</p>
  
  <pre><code>/craft/templates/_everything/
  </code></pre>
  
  <p>Template files beginning with underscores are hidden, similarly, template <strong>folders</strong> beginning with an underscore hide <strong>everything inside</strong>.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-04T20:52:49.153Z
Answers.Text: Yeah, but then aren't I prefixing every "include" with '/_everything/'? It just makes the code so ugly (and a big selling point of Craft to me was being able to keep the template markup nice and clean, and intuitive).
Answers.UserDisplayName: Jordan Lev
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-04T20:55:34.730Z
Answers.Text: Yes... but isn't that a small price to pay for being able to hide every single template? I (personally) don't think that it makes the code much uglier... and ultimately, the code is not what your customers are judging. :)
Answers.UserDisplayName: Lindsey D
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-04T21:04:22.933Z
Answers.Text: Yeah, but in this case *we* are the customers of CraftCMS, so couldn't the same argument be made that having a one-click option to not serve template files directly is a small price for P&T to pay? :) I know you're not P&T, so it's a rhetorical question (and I appreciate you taking the time to respond -- thanks).
Answers.UserDisplayName: Jordan Lev
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-04T21:16:41.177Z
Answers.Text: No problem. :)  If you want to suggest a `makeAllTemplatesPrivate` config setting, I'd recommended posting that to [feedback.buildwithcraft.com](http://feedback.buildwithcraft.com/).
Answers.UserDisplayName: Lindsey D
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-04T21:18:30.700Z
Answers.Text: On a side note, I'm surprised that changing the `privateTemplateTrigger` value had any impact on the CP. That's probably worth reporting as a bug.
Answers.UserDisplayName: Lindsey D
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-04T20:39:39.043Z
Answers.LastActivityDate: 2015-08-04T20:39:39.043Z
Answers.UserDisplayName: Lindsey D
Body: <p>I attempted to set the <a href="http://buildwithcraft.com/docs/config-settings#privateTemplateTrigger" rel="nofollow"><code>privateTemplateTrigger</code></a> to an empty string in my config/general.php file, because I don't <em>ever</em> want Craft to serve up a template file on its own just because a visitor happens to put in a URL that matches its name, and I was hoping to avoid prefixing every single file in my /templates directory with an underscore. Unfortunately doing so breaks several CP pages (like Globals and Plugins)...</p>
  
  <p>I'm guessing it's because some CP files are relying on this feature? Surely there must be some way to disable this "direct rendering of template files" thing that doesn't break the CP?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-08-05T19:28:35.730Z
Comments.Text: Per our conversation in the [comments on my answer](http://craftcms.stackexchange.com/a/10852/45), I reported this to P&T as a bug. Brad confirmed it as a bug, and said this... `"Fixed for the next release! And it also enables the behavior that he's looking for as well."` That being said, I'm gonna go ahead and close this thread as a "bug report". :)
Comments.UserDisplayName: Lindsey D
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-08-05T21:07:10.957Z
Comments.Text: Thanks. I don't know who you are but you are super helpful and I appreciate it!
Comments.UserDisplayName: Jordan Lev
Tags: <control-panel><routing>
Title: Prevent ALL templates from being rendered directly?
ThreadText: # Prevent ALL templates from being rendered directly?
  
  (Asked by: username_0 on 2015-08-04)
  
  I attempted to set the [`privateTemplateTrigger`](http://buildwithcraft.com/docs/config-settings#privateTemplateTrigger) to an empty string in my config/general.php file, because I don't *ever* want Craft to serve up a template file on its own just because a visitor happens to put in a URL that matches its name, and I was hoping to avoid prefixing every single file in my /templates directory with an underscore. Unfortunately doing so breaks several CP pages (like Globals and Plugins)...
  
  I'm guessing it's because some CP files are relying on this feature? Surely there must be some way to disable this "direct rendering of template files" thing that doesn't break the CP?
  
  **Tags:** control-panel, routing
  
  > **Comments:**
  > **username_1**: Per our conversation in the [comments on my answer](http://craftcms.stackexchange.com/a/10852/45), I reported this to P&T as a bug. Brad confirmed it as a bug, and said this... `"Fixed for the next release! And it also enables the behavior that he's looking for as well."` That being said, I'm gonna go ahead and close this thread as a "bug report". :)  
  > **username_0**: Thanks. I don't know who you are but you are super helpful and I appreciate it!  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-08-04. Score: 6
  
  This is very, very simple to do... just put **every single template** into a specific folder, then prefix the folder with an underscore:
  
  ```
  /craft/templates/_everything/
  
  ```
  
  Template files beginning with underscores are hidden, similarly, template **folders** beginning with an underscore hide **everything inside**.
  
  > **Comments:**
  > **username_0**: Yeah, but then aren't I prefixing every "include" with '/_everything/'? It just makes the code so ugly (and a big selling point of Craft to me was being able to keep the template markup nice and clean, and intuitive).  
  > **username_1**: Yes... but isn't that a small price to pay for being able to hide every single template? I (personally) don't think that it makes the code much uglier... and ultimately, the code is not what your customers are judging. :)  
  > **username_0**: Yeah, but in this case *we* are the customers of CraftCMS, so couldn't the same argument be made that having a one-click option to not serve template files directly is a small price for P&T to pay? :) I know you're not P&T, so it's a rhetorical question (and I appreciate you taking the time to respond -- thanks).  
  > **username_1**: No problem. :)  If you want to suggest a `makeAllTemplatesPrivate` config setting, I'd recommended posting that to [feedback.buildwithcraft.com](http://feedback.buildwithcraft.com/).  
  > **username_1**: On a side note, I'm surprised that changing the `privateTemplateTrigger` value had any impact on the CP. That's probably worth reporting as a bug.  
  
  ---
  
  