Paul T. Rykiel
Paul T. Rykiel

Reputation: 1227

Trying to Render a form in Web Forms for Marketers in Sitecore

I have exhausted all of the my efforts on trying to figure out what I am doing wrong. I have WFFM in my previous company and it worked great, but all of the components were in place for me to render the forms effectively. So, now that I have loaed this myself, I have successfully created my form, placed it in System/modules/WebformsforMarketers/website I have created a base page, with default layout, I used the Presentation tab / details and I added the control for Forms, and I edited the control and placed my formID. i cannot get the form to render. is there any code snippets or examples that I can review or can someone give me some advice, I would very much appreciate it.

I also tried to create an .ascx file and this is the code

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SoftwareShipmentForm.ascx.cs"
    Inherits="MEAU.Web.Components.SRM.MySoftware.Modals.SoftwareShipmentForm" %>
<%@ Register TagPrefix="wffm" Namespace="Sitecore.Form.Core.Renderings" Assembly="Sitecore.Forms.Core" %>
<h3 class="pagetitle">
    <sc:FieldRenderer ID="pageTitle" runat="server" FieldName="BasePageTitle" />
</h3>
<wffm:FormRender FormID="{0BE02C18-1CB0-455D-82B3-B0E61B5B7442}" runat="server" />

Added this to the page... no luck.

Upvotes: 3

Views: 1648

Answers (1)

Younes
Younes

Reputation: 4823

What you can also do is:

  • Create a layout (with sublayouts or whatever) with a Form Placeholder ->
  • Create PlaceHolder Settings for this placeholder making the form available to add (allowed controls: Renderings / Form Renderer)
  • Place a form on the placeholder using presentation details on the item and set the placeholder key to the chosen key in your sc:placeholder
  • Set the datasource to your form in the rendering settings of the added form definition

This should do the trick. Obviously make sure you publish everything (form, placeholder settings, sublayout with placeholder, layout, all fields of your form -> use item publish with option smart on the form)

Upvotes: 1

Related Questions