Hi,
This question is already present in other posts * **
However, they were about version 5, but I'm asking about version 6π
On a php file located in the 'view' folder of a Joomla module, I have to insert a form built with chronoformsv6.
Reading the old posts, I found this php code:
I believe that instead of 5 I have to put 6.
My question is: where do I have to insert the name of the form that I want to include?
* https://www.chronoengine.com/forums/posts/t99179/display-form-from-template-file.html?keywords=display%20form%20from%20template%20file
** https://www.chronoengine.com/forums/posts/t100292/load-form-in-php-file.html?keywords=display%20form%20from%20template%20file
This question is already present in other posts * **
However, they were about version 5, but I'm asking about version 6π
On a php file located in the 'view' folder of a Joomla module, I have to insert a form built with chronoformsv6.
Reading the old posts, I found this php code:
JPluginHelper::importPlugin('content', 'chronoforms5');
$dispatcher =& JDispatcher::getInstance();
$form = $dispatcher->trigger('render_item', array('profile-information'))[0];
echo $form;
I believe that instead of 5 I have to put 6.
My question is: where do I have to insert the name of the form that I want to include?
* https://www.chronoengine.com/forums/posts/t99179/display-form-from-template-file.html?keywords=display%20form%20from%20template%20file
** https://www.chronoengine.com/forums/posts/t100292/load-form-in-php-file.html?keywords=display%20form%20from%20template%20file
Hi Armand,
I did not write this code but try to replace "profile-information" with the form alias in your v6 ?
The cleanest solution is to run Joomla content plugins on the module and use the Chronoforms6 plugin syntax, and have the plugin installed and enabled of course.
Best regards,
Max
I did not write this code but try to replace "profile-information" with the form alias in your v6 ?
The cleanest solution is to run Joomla content plugins on the module and use the Chronoforms6 plugin syntax, and have the plugin installed and enabled of course.
Best regards,
Max
Of course, but Chronoforms plugin does not work in php fileπ (view/default.php)
so I try this codeπ
so I try this codeπ
Hi Armand,
Please try this code then:
Best regards,
Max
Please try this code then:
$mainframe = \JFactory::getApplication();
$contentParams = \JComponentHelper::getParams('com_content');
$dispatcher = \JDispatcher::getInstance();
$type = 'content';
\JPluginHelper::importPlugin($type);
$context = '';
$rowPlg = new \stdClass();
$rowPlg->text = '{chronoforms6}form-alias{/chronoforms6}';
$results = $mainframe->triggerEvent('onContentPrepare', array($context, &$rowPlg, &$contentParams, 0));
echo $rowPlg->text;
Best regards,
Max
This topic is locked and no more replies can be posted.
