Forums

reworking old chronocontact form

jimwin 01 Jun, 2015
Hi there,

I'm trying to update an old website I put together years ago from Joomla 1.5 to 3.4, and I've having some difficulty with the differences in the newer versions of Chronoforms / Chronoconnectivity.

With the old version I had a Chronoform to select a date, and search the database for records with that date. I've not been able to link the chronoform to the chronoconnectivity form so I can filter the results from the database table. Please can you assist?

Also, with the old chronoconnectivity form, I was using a mootools "smoothbox" to reveal the full match details for each individual match. The mootools doesn't seem to be available any more, is there an alternative to this method?

Many thanks,
jimwin 03 Jun, 2015
Hello again,

I've managed to get a lot further, after a great deal more searching 🙂

I have changed the old "smoothbox" for a modal, but I am having trouble with the modal window.
I found that modals wouldn't work in either a chronoform or a chronoconnectivity page until I found a post suggesting to change the chronoform "style" to None (note my template already incorporates bootstrap). WIthout this, the modal appears, but stays greyed out.

I haven't been able to find a way to set the style within chronoconnectivity though, can anyone make any suggestions? I've tried adding the following code to the start of the body code:
<?php
// load the Joomla! modal code
JHtml::_('behavior.modal'); 
// Over-ride the default CF CSS for a modal link
$jdoc = \JFactory::getDocument();
$style = "
#modal_a {
  display: inline;
  position: relative;
}";
$jdoc->addStyleDeclaration($style);
?>
and also adding a (style="") to the modal <div> but this doesn't seem to work.

Thanks for any assistance,
Jim
GreyHead 03 Jun, 2015
Hi Jimwin,

You may not need that code in ChronoConnectivity - it's needed with ChronoForms because CF adds some modal styling of it's own and I doubt that CC does.

If you do add it then it should go in the Header, not the body, so that it is only loaded once on the page. Can you post a link to a page where you are testing this? It's easier to see what is happening (or not) with a real example to look at.

Bob
jimwin 03 Jun, 2015
Thanks Bob,

The page with the issue is:
http://www.eddpl.co.uk/j3/index.php?option=com_chronoconnectivity5&cont=lists&act=index&ccname=test

I've just removed the php code above. As you can see, it looks fine until you click the "Details" button. The modal opens, but everything stays grey, and you cannot select anything. The same thing was happening withing CF until I changed the Style to None.

Many thanks,
Jim
GreyHead 03 Jun, 2015
Hi Jim,

Please try adding this CSS
.modal-backdrop.in {
    z-index: 1000;
}
What is happening is that the template CSS is giving the background the same z-index 1040 as the content; if you put the background back a bit then it shows up correctly.

Bob
jimwin 03 Jun, 2015
Sorry, I'm being a little thick here. 😶

Is that in the CSS for bootstrap, or somewhere in the CC?
GreyHead 03 Jun, 2015
Hi Jim,

Any CSS that loads in the page - you can put it in the CC Header as
<?php
$jdoc = \JFactory::getDocument();
$style = "
.modal-backdrop.in {
    z-index: 1000;
} ";
$jdoc->addStyleDeclaration($style);
?>

Bob
jimwin 03 Jun, 2015
That's brilliant, thanks for that Bob, it's working perfectly!

I just need to work out how to pass data from a CF to the CC, and I think I'm in business.

Regards,
Jim
jimwin 03 Jun, 2015
OK, I'm still having a few problems getting this working.

I have a CF that I'm trying to use to select database records based on date selected in the form.
The On Submit has a CC Connection action, configured for my CC name, with a blank action.

My CC has a condition statement
<?php
return array('matchlist.date1' => $form->data['date1']);
?>
but when I select a date and submit on the CF, I'm directed to the CC but get no records?

I've enabled debugging on CC and CF, and I can see the data array of CF values after submitting the form.

Any idea what I'm missing?
GreyHead 04 Jun, 2015
Hi Jimwin,

I can't work out how all the bits join up but if that is a CC condition then it won't work as I don't think that CC uses $form->data['']. I know that the row data is in $row, but I don't recall where the basic form data is.

If you temporarily add this to the Header box you will get a **big** data dump. Viewing that in the page source should let you pin down the code you need to use
<?php
echo'<div>$this: '.print_r($this, true).'</div>';
?>

Bob
jimwin 04 Jun, 2015
HI Bob,

yes, that's certainly a **big** data dump! I've looked through it for the values input in the CF, but it's not showing that.

It's currently joined together, the following way:
CF1 (submit) allows a member to complete a form, enter data into the database and produces an email.
CF2 (search) is a search form, allowing a member to select a date to search. In the old form (chrono from 2008!) this was configured with a submit URL matching the Chrono connectivity URL.
Finally there is a CC, which is a results page based on the POST data from CF2.

On the old version, I was able to do this by specifying:
WHERE date1 like '<?php echo $_POST['date1']; ?>%'
and mtype = '<?php echo $_POST['mtype']; ?>'
in the WHERE SQL field of the CC.

I'm starting to wonder if I might be better off to change the design, and join the search for and the results CC into one CC page, using my search HTML in the header section?

Would that be a better way of accomplishing this?
GreyHead 04 Jun, 2015
Hi Jimwin,

Yes . . . (though using $_POST in the Conditions box will probably still work.)

Bob
jimwin 04 Jun, 2015
Thanks Bob,

I just discovered about still using the $_POST myself, and I'm able to display records based on one field! 🙂

I've tried to convert the statement from before:
WHERE date1 like '<?php echo $_POST['date1']; ?>%' and mtype = '<?php echo $_POST['mtype']; ?>'

into the format CC likes. I can get:
<?php return array('matchlist.date1' => $_POST['date1']);?>

to work for a single value, but I think my syntax is slightly out for the "LIKE" and the "AND"
I currently have:
<?php return array('matchlist.date1 like' => '%$_POST['date1']%', 'matchlist.mtype' => $_POST['mtype']);?>

but this is just returning all records again.
GreyHead 04 Jun, 2015
Hi Jim,

I think it needs some more quotes for the % part:
<?php
return array(
  'matchlist.date1 LIKE' => '%'.$_POST['date1'].'%',
  'matchlist.mtype' => $_POST['mtype']
);
?>

Bob
This topic is locked and no more replies can be posted.