Jump to content

FormTemplateProcessor posting to parent


Manaus
 Share

Recommended Posts

Hello,

I'm trying to hack some code for the FormTemplateProcessor module.

I have this page structure:

posts

  post 01

  post 02

  post 03

  post 04

  new post

I'd like to add the new post as a sibling of 'new' but I get the page always as its child. This is the code I'm using:

$form = $modules->get('FormTemplateProcessor');
$form->template = $templates->get('contact-form'); // required
$form->requiredFields = array('title', 'body');
$form->email = 'my@email.com'; // optional, sends form as email
$form->parent = $page; // optional, saves form as page
echo $form->render(); // draw form or process submitted form

Thanks for any suggestion!

Link to comment
Share on other sites

diogo - thanks for spotting that - I misread what he wanted and forgot that unpublished is the default.

As for the error - not really sure why that isn't working.

Not really advisable, but you could hack the module code:

https://github.com/ryancramerdesign/FormTemplateProcessor/blob/master/FormTemplateProcessor.module#L202

Comment out that highlighted line.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...