Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7712203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:34:13+00:00 2026-06-01T01:34:13+00:00

Currently, templates\wffm\forms folder has Insert Options like Form Folder & Form object. This is

  • 0

Currently, templates\wffm\forms folder has Insert Options like “Form Folder” & “Form” object. This is great for people that use the base “Form” template. In my case, I’ve got people who’d like to use a base payment form with hidden fields and other actions I’ve created.

I’d like to add my custom form “MyPaymentForm” to the Insert Options so it will be on display for all form users to select as their base form. The problem is that this is a form with fields and not a template so Insert Options will not let me add it.

  • I’d like my payment form with base fields to be a template for each group that uses it. For example, all will use the base fields but will also have custom fields in relation to their department.

Can you recommend a way I can serve up “MyPaymentForm” to users so that it is reusable for different groups?

Thanks,
Chris

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T01:34:15+00:00Added an answer on June 1, 2026 at 1:34 am

    I would recommend using a Command Template to accomplish what you’re asking. A Command Template is essentially a bit of custom logic that can be assigned to Insert Options.

    In your case, you could create a Command Template named ‘MyPaymentForm’ (or whatever you come up with) and then assign that Command Template to the Insert Options field of any template/item you wish. When a user right clicks to ‘Insert->’ and your Command Template is available, the user can click your ‘MyPaymentForm’ command template and your custom code will be executed.

    The action behind your command template could be as simple as creating a copy of your base form and inserting it in the content tree where the user executed the command template.

    Here is an example of command template code that could accomplish what you’d like. This is completely untested, but the concept is there.

    namespace MyNameSpace
    {
        public class CopyPaymentFormCommand : Sitecore.Shell.Framework.Commands.Command
        {
            public override void Execute(Sitecore.Shell.Framework.Commands.CommandContext context)
            {
                if (context.Items.Length == 0)
                    return;
    
                Sitecore.Data.Items.Item destinationItem = context.Items[0];
                if (destinationItem == null)
                    return;
    
                //retrieve the base MyPaymentForm item
                Sitecore.Data.Items.Item myPaymentForm = destinationItem.Database.GetItem("MyPaymentForm GUID");
                if (myPaymentForm == null)
                    return; // instead of just exiting here, you may want to log an error first
    
                //copy the MyPaymentForm item to the location in the content tree from which the command template was triggered
                Sitecore.Data.Items.Item copyOfMyPaymentForm = myPaymentForm.CopyTo(destinationItem, "MyPaymentForm");
    
                //perform any necessary post-processing of your newly copied item
            }
        }
    }
    

    After creating your custom code, you’ll need to wire up Sitecore to recognize and use your command.

    1. Add a “command” element to the file /App_Config/Commands.config, like so:

    <command name="mycustomcommands:forms:copypaymentform" type="MyNamespace.CopyPaymentFormCommand, MyAssemblyName" />
    

    2. Next, create a Command Template item in your /sitecore/Templates section. You can do so by right-clicking the relevant folder under /sitecore/Templates and using Insert->Insert From Template, then select the “/sitecore/Templates/System/Branches/Command Template” data template.

    3. Next, in your newly created Command Template item, populate the Command field (contained in the Data section) with this text:
    mycustomcommands:forms:copypaymentform(id=$ParentID)
    note: the command name matches the command name defined in the Commands.config file

    4. You now have a Command Template that can be assigned as an Insert Option. To do so, simply edit the __Standard Values item of any template you choose and select Assign Insert Options. In the Insert Options dialog, browse to the Command Template item you created and add it to the ‘Selected’ list of insert options.

    Now, when a user attempts to insert a new item underneath an item with the template containing your command template insert option, they will have the option to click on your command template. Doing so will trigger your command template code, which will in turn create a copy of your payment form in the location from which the user executed the command.

    For more information on command templates, see this document on the SDN (specifically, Chapter 4): http://sdn.sitecore.net/upload/sitecore6/datadefinitioncookbook-usletter.pdf

    Hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am doing a Django tutorial on Templates. I am currently at this code:
Currently, I have this: void ClassA::aFunction(QVector<ClassB *> items) { //stuff } I would like
I currently have two apps: app1/ app2/ templates/ app1.html app2.html In app1.html, I'm including
Currently since I want to access user information in all my templates, I always
I'm currently using NVelocity to render some email templates. I'm curious how I can
I'm currently experiencing with the new c++0x variadic templates, and it's quite fun, Although
I currently use C for numerical computations. I've heard that using C++ Expression Templates
I'm a newbie on grails. I am now currently working on my scaffolding templates
I'm currently working on a class with a lot of templates and being able
I'm currently trying to build a class hierarchy automatically by using C++ templates. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.