How to use Joomla-framework in form-template

Torty 02 Nov, 2009
Hello,

I want to use $JSite::getMenu() in my form template (stored in the field "form code").
My first trys fails. Inside the formcode I try this:
...<?php 
  jimport("joomla.application.application");
  $menu = &JSite::getMenu();
?>...

But then I click on the Save-button I see a white page with the form until my <?php tag and nothing else. I can't see my mistake.

How can I use Joomla-framework classes / methods in my form template?
GreyHead 02 Nov, 2009
Hi Torty,

This works OK
<?php
if ( !$mainframe->isSite() ) return;
$menu =& JSite::getMenu();
print_r($menu);
?>

You need the isSite() check to stop ChronoForms trying to evaluate the form code on save ( a faulty feature).

Bob
Torty 02 Nov, 2009
Thx.
This topic is locked and no more replies can be posted.