Copied to clipboard

Flag this post as spam?

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


  • John C Scott 473 posts 1183 karma points
    Jan 20, 2014 @ 14:15
    John C Scott
    0

    Template file isn't allowed for rendering

    When I try to use the renderTemplateFile javascript call with the following:

    var hc = TC.renderTemplateFile({ storeId: 1, templateFile: '/MacroScripts/hoverCart.cshtml', pageId: _nodeId, async: false });
    $("#pardiv").html(hc);

    hc is null and in the inspector in chrome I see that the Network response is:

    INNEREXCEPTION:
    System.Exception: Template file isn't allowed for rendering

    So I thought this would need to be ticked under 

    >Tea Commerce> Stores > Template Rendering

    But it is, you can see a picture here: https://www.dropbox.com/s/1tbwp0681z49ufv/templaterendering.png

    Is there anything else it could be?

    I'm using Umbraco v6.1.6 with the latest version of Tea Commerce

     

     

     

  • John C Scott 473 posts 1183 karma points
    Jan 20, 2014 @ 17:24
    John C Scott
    100

    It seems it was the slash that caused the problem.

    If the file doesn't exist (eg templateFile:'MacroScripts/foobar.cshtml') then you get exactly the same error.

    So changing templateFile:'/MacroScripts/hoverCart.cshtml' to templateFile:'MacroScripts/hoverCart.cshtml' and then everything worked fine :)

  • Anders Burla 2560 posts 8256 karma points
    Jan 20, 2014 @ 18:28
    Anders Burla
    0

    Hi John

    Great you got it solved!

Please Sign in or register to post replies

Write your reply to:

Draft