CFv5 form in a .php file?

entumas 21 Jul, 2017
Hi!
How can I print a CFv5 form in a .php file?
Thanks!
GreyHead 22 Jul, 2017
Hi entumas,

I'm not sure that you can - what exactly do you need to do?

Bob
entumas 22 Jul, 2017
I need to put a form directly in the php file that shows my article (show.php)
No modules, no shorcodes.
What php function should I call to be shown a form?
<?php SHOW_FORM ?>

Thanks
Max_admin 22 Jul, 2017
Hi entumas,

This is Joomla or WP ?

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
entumas 22 Jul, 2017
Joomla!, Max
entumas 23 Jul, 2017
I don't understand... CFv5 don't have a function to print the forms? πŸ˜‘
entumas 23 Jul, 2017
I have looked at the StackOverFlow link that you send me, but I also did not get it to work ...

Am I supposed to create a module to display the form?
Even so, I don't understand what to change.
GreyHead 23 Jul, 2017
Hi entumas,

ChronoForms is built to work with Joomla - you can show a form directly as a Joomla page; or you can use the ChronoForms plugin to show it in an article - or other components that support Joomla plugins; or you can use the ChronoForms module to show it in a template module location.

It is not designed to be called directly from a .php file

To use the StackOverFlow answer you would use the name of the ChronoForms module that you want to load.

Bob
entumas 23 Jul, 2017
What do you suggest is that I modify "dashboard_main" to "MY_FORM_NAME"?
In other words:
<?php
$modules  = JModuleHelper::getModules('MY_FORM_NAME');
$document = JFactory::getDocument();
$attribs  = array();
$attribs['style'] = 'xhtml';
foreach ($modules as $mod) {
	echo JModuleHelper::renderModule($mod,$attribs);
}
?>

It just don't work😟
GreyHead 23 Jul, 2017
Hi entumas,

No, you'd need to add the form to a module and call the module name there.

Why do you need to do this from a PHP file?

Bob
entumas 23 Jul, 2017
Yes, that's how I did it, but it don't work.

I need to show that form in a space where there is no position for it
entumas 24 Jul, 2017
I need to show a contact form into item of a event's plugin (RSEvents)
This form is to be viewed in a modal window, the modal window will open with a button.

Now I have created an HTML/custom module.
In this module I have created the modal window structure + the form call:
<div class="modal fade" id="modal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
	{chronoforms5}My_form{/chronoforms5}
</div>

But it seems that the shortcode don't work inside the HTML/custom module...

What function do you use to display the form on a page?

Thanks!
GreyHead 24 Jul, 2017
Hi entumas,

You can show it in a modal window using a link to the form URL - and add &tmpl=component to the end to show the form without the template. Please see this FAQ

Bob
entumas 24 Jul, 2017
I don't see this solving the problem... If I do what you show me in the last FAQ I are in the same. How do I show the "Open modal" button in the place I need? (into php file)

I don't understand one thing.
You are a company specialized in Joomla !. I have been able to do this that I ask them in WordPress without any problem. In the version of WordPress you offer a shortcode to show the forms where you want, either in the content or in a php file.
Because they do not offer the same facility for Joomla! ?

Thanks
GreyHead 24 Jul, 2017
Hi entumas,

As I have no idea what your .php file does or where it is executed I can't give you any help with getting it to output a link. That is possibly in most Joomla! extensions.

And, yes, you are right - Joomla! and WordPress handle some things in different ways.

Bob
Max_admin 13 Aug, 2017
Hi,

If the other extension support loading plugins then you can simply use {chronoforms5}form_name{/chronoforms5}, all major extensions support this feature.

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.