Is there anyway to assign a template to a document without first adding it to Allowed Templates (not using alttemplate or /templatealias.aspx).
I am pretty sure there used to be an addon that added that option on right click on a content node in the tree, many years ago, like u2.6 or 3.2 or something? This add on feature was only available to admins.
As a developer I often find myself creating templates that will only be used on a single content node. For example I have a AjaxDoc document type. To different instances of this I apply different templates that supply json data to jquery ajax calls, each template only being used on a single content node. Having to go and add this to allowed templates is annoying, especially as I'd then want to remove it to make sure it is not used anywhere else in the site.
I haven't tested this, but I think it should also be possible using the API. You might be able to set a new template using the Document object. That will not check if it's allowed or not so you can just set it.
Override Allowed Templates
Hello
Is there anyway to assign a template to a document without first adding it to Allowed Templates (not using alttemplate or /templatealias.aspx).
I am pretty sure there used to be an addon that added that option on right click on a content node in the tree, many years ago, like u2.6 or 3.2 or something? This add on feature was only available to admins.
As a developer I often find myself creating templates that will only be used on a single content node. For example I have a AjaxDoc document type. To different instances of this I apply different templates that supply json data to jquery ajax calls, each template only being used on a single content node. Having to go and add this to allowed templates is annoying, especially as I'd then want to remove it to make sure it is not used anywhere else in the site.
How about having a document parameter, overridetemplate that is a drop donw of the templates..
then extend via application.base
As this is standard asp.net if won't take account of any umbraco structure limitations.
I haven't tested this, but I think it should also be possible using the API. You might be able to set a new template using the Document object. That will not check if it's allowed or not so you can just set it.
Jeroen
is working on a reply...