We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
After upgrading a site to Umbraco Forms v7.0.6 I encountered an issue with the date picker stylesheet (for Pikaday) missing from the page.
This happens when you not render the scripts with the form, but elsewhere on the page (as described here).
Create a form and make sure it includes a date picker field.
Insert a form in a view using the macro script, making sure to exclude the scripts:
@Umbraco.RenderMacro("renderUmbracoForm", new { FormGuid = Model.Form, FormTheme = "default", RecordId = Guid.Empty, ExcludeScripts = "1" })
(in this case Model.Form contains the GUID of the form, but you can also hardcode it for testing purposes).
Model.Form
Next up, render the form scripts further down the page:
@if (TempData["UmbracoForms"] != null) { foreach (var form in (List<Guid>)TempData["UmbracoForms"]) { Html.RenderAction("RenderFormScripts", "UmbracoForms", new { formid = form, theme = "default" }); } }
View the page and when highlighting the date picker you will notice all the styling is missing.
The issue is that the pikaday CSS is no longer included on the page. I noticed that the way it's added has changed in this latest version, using:
Html.AddFormThemeCssFile("~/App_Plugins/UmbracoForms/Assets/pikaday/pikaday.css");
(line 12 in Views\Partials\Forms\Datepicker.cshtml)
Views\Partials\Forms\Datepicker.cshtml
But then it's not rendered out anywhere.
I managed to fix it by modifying Views\Partials\Forms\Themes\default\Script.cshtml:
Views\Partials\Forms\Themes\default\Script.cshtml
@* Render references to javascript files needed by fields on the current page*@ if (Model.UseClientDependency) { foreach (var css in Html.GetThemeCssFiles(Model)) { Html.RequiresCss(css.Value); } foreach (var script in Html.GetThemeScriptFiles(Model)) { Html.RequiresJs(script.Value, Model.JavaScriptTagAttributes); } } else { @Html.RenderFormsStylesheets(Url, Model) @Html.RenderFormsScripts(Url, Model, Model.JavaScriptTagAttributes) }
(this is from line 41 in that file)
This fixes the issue and makes sure the Pikaday CSS does get loaded on the page.
The text was updated successfully, but these errors were encountered:
PR: https://github.com/umbraco/Forms/pull/234
Sorry, something went wrong.
No branches or pull requests
After upgrading a site to Umbraco Forms v7.0.6 I encountered an issue with the date picker stylesheet (for Pikaday) missing from the page.
This happens when you not render the scripts with the form, but elsewhere on the page (as described here).
Reproduction
Create a form and make sure it includes a date picker field.
Insert a form in a view using the macro script, making sure to exclude the scripts:
(in this case
Model.Form
contains the GUID of the form, but you can also hardcode it for testing purposes).Next up, render the form scripts further down the page:
View the page and when highlighting the date picker you will notice all the styling is missing.
Bug summary
The issue is that the pikaday CSS is no longer included on the page. I noticed that the way it's added has changed in this latest version, using:
(line 12 in
Views\Partials\Forms\Datepicker.cshtml
)But then it's not rendered out anywhere.
Workaround/fix
I managed to fix it by modifying
Views\Partials\Forms\Themes\default\Script.cshtml
:(this is from line 41 in that file)
This fixes the issue and makes sure the Pikaday CSS does get loaded on the page.
The text was updated successfully, but these errors were encountered: