Render Umbraco Forms in block element
# help-with-umbraco
d
How to render a umbraco forms inside a block element. I have tried the following inside my partial view form.cshtml @inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockGridItem> @await Component.InvokeAsync("RenderForm", new { formId = @Model.Content.PickAform, theme = "default", includeScripts = false } Nothing is getting rendered. Any help please?
Got it working. Here is what I had to do 1. The block element should be at \Views\Partials\blockgrid\Components\form.cshtml @inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockGridItem> @(await Component.InvokeAsync("RenderForm",new { formId = Model.Content.PickAform, theme = "default", includeScripts = false })) 2. Then under \Views\Partials\Forms\Themes\ place the default folder which can be download from here https://docs.umbraco.com/umbraco-forms/v/10.forms.latest/developer/themes This got the umbraco forms working for me!
d
This is probably worth asking HQ to be included in docs