Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Daniel Lindstrom 454 posts 271 karma points
    Jul 24, 2012 @ 16:44
    Daniel Lindstrom
    0

    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.

  • Mike Chambers 635 posts 1252 karma points c-trib
    Jul 24, 2012 @ 18:00
    Mike Chambers
    0

    How about having a document parameter, overridetemplate that is a drop donw of the templates..

    then extend via application.base

    Page.MasterPageFile="LOOK UP THE SELECTED OVERRIDE TEMPLATE"

    As this is standard asp.net if won't take account of any umbraco structure limitations.

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Jul 25, 2012 @ 09:46
    Jeroen Breuer
    0

    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

Please Sign in or register to post replies

Write your reply to:

Draft