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

  • Home
  • SEARCH
  • 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 8285059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T11:20:46+00:00 2026-06-08T11:20:46+00:00

I am trying to render a form with template with the following: function FacebookForm($fbFields)

  • 0

I am trying to render a form with template with the following:

function FacebookForm($fbFields) {

        $actions = new FieldSet(
            new FormAction('doFaceBookForm', 'Register')
        );

        $memberfields = singleton('XEUser')->getMemberFormFields();

        $fields = new FieldSet();
        $reqFields = array();
        foreach($fbFields as $key => $value){
            switch($value){
                case 'Gender':
                    $fields->push($memberfields->fieldByName('Gender'));
                    $reqFields[] = 'Gender';
                    break;
                case 'DateOfBirth':
                    $fields->push($memberfields->fieldByName('DateOfBirth'));
                    $reqFields[] = 'DateOfBirth';
                    break;
            }
        }
        $validator = new RequiredFields($reqFields);

        $form = new Form($this, 'FaceBookForm', $fields, $actions,$validator);
        $form->disableSecurityToken();

        return $form->renderWith(array('FacebookController','Page'));
        //return $form;

    }

When I just return $form my form appears but in the default contentController.ss so I created a new template and added return $form->renderWith(array('FacebookController','Page'));. When I do this, I get everything that should be in the page but with no styles being applied at all and the form doesn’t even appear. Here is my FacebookController template:

<div id="left">

    <h2>Thankyou for signing up with your Facebook account</h2>
    <p>The following details could not be obtained from your Facebook account, please enter them now.</p>
    $form
</div>

<div id="right">

</div>

can anyone shed any light on this?

  • 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-08T11:20:49+00:00Added an answer on June 8, 2026 at 11:20 am

    Try using the name of the method in your template:

    $FacebookForm

    Alternatively, you could subclass the Form class and use a custom forTemplate() method. More info below.

    See:

    • http://doc.silverstripe.org/framework/en/topics/forms
    • http://doc.silverstripe.org/framework/en/tutorials/3-forms
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In trying to render a form im getting: NameError in Deals#new Showing /Users/nelsonkeating/Desktop/ReminDeal1/app/views/deals/_form.html.erb where
Im trying to render a django template from a database outside of djangos normal
I am following alloy-complex-form-examples from github trying to learn nested forms and I just
I'm trying to embed the login form of FOSUserBundle in a template with this:
I'm trying to render a form that I've just generated from an entity, but
I am trying to render the magento contact form into a .phtml file, but
I'm trying to render a mooml template I created on the fly and am
I'm trying to render the Devise edit password form within another view because I
Im new to Django and I am trying to create a form that contains
I'm trying to create a form which will add a new text box every

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.