Jump to content

Recommended Posts

Posted

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!

Posted

I'm not sure what you are doing, but maybe it will work if you change $form->parent = $page; to $form->parent = $page->parent;

edit: adrian was faster :)

  • Like 1
Posted

Thanks adrian,

I'm seeing this though:

"Error: Exception: Method FormTemplateProcessor::addStatus does not exist or is not callable in this context"

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
  • Recently Browsing   0 members

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