Using Chronoforms V5 to create an article

malla 21 Jul, 2014
Hi πŸ˜€
I've created a form with Chronoforms V5 and I want to create a Joomla article with the POST data of the form.

I've seen that with Chronoforms V4 there was an action called 'Submit Article' that permitted to create a new article on submit but in V5 one I didn't find this feature.

So, how can I create a Joomla article using POST data of the form?

Thank youπŸ™‚
Sorry for my english and congratulations for this beautiful extension!πŸ˜€
GreyHead 23 Jul, 2014
Hi malla,

There is no equivalent action yet for ChronoForms v5. It may come in the future BUT full support of article creation is quite a lot more complicated in Joomla! 3 with the changes in Categories and the introduction of Tags so that may not come very soon.

Meanwhile you could save to an article using a Custom Code action; or, possibly, use CFV4 for this form?

Bob
malla 24 Jul, 2014
Hi Bob,
thank you very much for your reply πŸ™‚

As you've suggested me, I've tried to create a form with CFv4 but this version gave me many errors, maybe because I've PHP 5.
For this reason I'm using CFv5 and my idea is redirecting to a new page(that I called prova.php) on Submit and, in this page, creating a new Joomla article.
I try to explain me better..

In CFv5 I've created a form and I've inserted a 'Redirect' action on submit tab. In the Redirect URL I've inserted: prova.php
Then, in prova.php I've added this code:
echo $form->data['descrizione'];

But I've an error: Undefined variable: form

Isn't possible to get POST data on the redirect url or am I doing wrong in getting POST data?

Thank you again,
Malla.
malla 24 Jul, 2014
Ok, I've resolved! I'm very happyπŸ˜€

The solution that I've adopted is the following:

In CFv5 I've also added the 'Custom code' action before the 'Redirect' action. In the custom code I've inserted:
<?php
$session = JFactory::getSession();
$session->set('data', $form->data);
?>


Then, in prova.php I've added:
$session = JFactory::getSession();
	$data = $session->get('data');
        echo $data['id'];
        

and, finally I create a Joomla article with this dataπŸ™‚

Thank you for your support Bob.
Malla
This topic is locked and no more replies can be posted.