Last modified: 2014-09-20 18:13:06 UTC
Preview page with this template should be enabled on protected pages, this is useful when checking for issues with old versions of the protected template.
TemplateSandbox doesn't pay any attention to the protection status of the page. MediaWiki itself doesn't show the edit form in this situation. Since the edit form isn't shown in this situation, it would be difficult to show TemplateSandbox on these pages. If MediaWiki were changed to show the edit form in these situations, TemplateSandbox would automatically show up.
As a workaround for this problem, there's a hidden form field called wpTemplateSandboxTemplate that controls which template is replaced. If you want to preview a different version of a protected template, put your new code on some other page, change wpTemplateSandboxTemplate to the name of the protected template, and then proceed normally. I wrote a script at https://en.wikipedia.org/wiki/User:Jackmcbarn/advancedtemplatesandbox.js that will turn the hidden field into a text field to make this easier.