Copied to clipboard

Flag this post as spam?

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


  • OleP 67 posts 276 karma points
    Mar 01, 2018 @ 21:10
    OleP
    0

    Core scripts and styles are not loaded when rendering macro "renderUmbracoForm"

    If I use the built in "Form" or "Macro" grid component to add a form to a page, the core styles and scripts from the App_Plugin folder are loaded just fine.

    However, if I call RenderMacro directly in the template, the form is displayed fine, but the styles and scripts are not loaded, and therefore validation is broken.

    I simply load the form like this:

                   @Umbraco.RenderMacro("renderUmbracoForm", new { FormGuid = "4318cc19-fc21-4dd2-b092-37c4cb2ab93f", FormTheme = "Default", ExcludeScripts = false})
    

    I can reproduce this in a fresh Umbraco 7.9.2/Forms 7.0 installation.

    Is this default behaviour? If yes, how can I load the core styles and scripts manually?

  • Joshua Lemli 52 posts 234 karma points
    Mar 02, 2018 @ 17:21
    Joshua Lemli
    0

    Are you using ClientDependency.Core.Mvc and Html.RenderJsHere / Html.RenderCssHere in your calling view?

    When you say the styles and scripts "are not loaded" -- are they completely missing or are they giving bad HttpRequest status codes?

    Make sure the script paths are being referenced correctly, e.g. "~/scripts/myscript.js" not just "myscript.js".

    Do you have debug = "true" in your web.config? Are you properly clearing the Umbraco cache and your browser's cache? Have you tried bumping up the ClientDepenency.config version number?

  • OleP 67 posts 276 karma points
    Mar 04, 2018 @ 21:51
    OleP
    0

    I'm using Client Dependency framework yes. The script are not requested at all.

    I can reproduce this on a fresh Umbraco installation, so I think it's a bug. I make a ticket on the issue tracker here

    I can however load the scripts manually by rendering the "RenderUmbracoFormScripts" macro, but afaik they should load automatically when "ExcludeScripts" is set to false on the "renderUmbracoForm" macro.

  • Aleksander 45 posts 205 karma points
    Mar 06, 2018 @ 08:56
    Aleksander
    0

    I'm having the same issue, running umbraco 7.8.2 and umbraco forms 6.0.7

  • Aleksander 45 posts 205 karma points
    Mar 06, 2018 @ 09:06
    Aleksander
    100

    Scrap that. I had to set excludescripts = "0" then it worked just fine

Please Sign in or register to post replies

Write your reply to:

Draft