The new release (1.2) gives us just what we have been waiting for -- the better control of the front end and ability to sort the columns.
But we seem to have run into one problem. We have some code that works fine for the "edit template" in the back end, but when we place the same code in the front end "record edit template" it doesn't seem to work.
This code is at the top of both "edit templates:"
This code is a few rows down in the table:
In the back end, the select drop down works just as we want it. In the front end, here is the actual html code that is produced:
I have looked for missing or extra quotes, comma, etc. I have even removed all of the code except the parts you see here, and I get the same bad results.
Any suggestions?
TIA,
George
But we seem to have run into one problem. We have some code that works fine for the "edit template" in the back end, but when we place the same code in the front end "record edit template" it doesn't seem to work.
This code is at the top of both "edit templates:"
<?php
$editor =& JFactory::getEditor();
JHTML::_('behavior.calendar');
?>
<br><br><table border=0>
This code is a few rows down in the table:
<tr><td><b>Room:</b><br><select name="Room">
<?php
$database->setQuery( "SELECT room FROM #__ctrooms" );
$rooms = $database->loadObjectList();
foreach($rooms as $room){
?>
<option value="<?php echo $room->room; ?>"><?php echo $room->room; ?></option>
<?php } ?>
</select>
<br> <br></td>
<td>Start publishing:<br><?php echo JHTML::_( 'calendar',date( 'Y-m-d' ),"publish_up","publish_up"); ?></td>
<td>Finish publishing:<br><?php echo JHTML::_( 'calendar',"Never","publish_down","publish_down"); ?>
</td></tr>
In the back end, the select drop down works just as we want it. In the front end, here is the actual html code that is produced:
<tr><td><b>Room:</b><br><select name="Room">
<option value="" >room; ?></option>
</select>
<br> <br></td>
<td>Start publishing:<br></td>
<td>Finish publishing:<br>
</td></tr>
I have looked for missing or extra quotes, comma, etc. I have even removed all of the code except the parts you see here, and I get the same bad results.
Any suggestions?
TIA,
George
Hi Geaorge,
for Joomla calendar on the frontend, you need this code:
http://www.chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&f=2&t=11467&p=16440&hilit=calendar+J1.5&sid=43c6ce4a5c1e9b48a388b10d8029a58c#p16433
regards
Max
for Joomla calendar on the frontend, you need this code:
http://www.chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&f=2&t=11467&p=16440&hilit=calendar+J1.5&sid=43c6ce4a5c1e9b48a388b10d8029a58c#p16433
regards
Max
Max:
Thanks for the suggestion on the calendar for the front end. It is basically functional and should only take a little more "tweaking."
But I am having trouble including php code in the "Front Permissions" "Record Edit Template." When I insert some code with the <?php and ?> tags, I am getting very little functioning code. When I look at the auto-generated code, some of the php code is not shown at all, some has [startphp] and [endphp] tags around it, and some gets converted to <?php and ?>. Needless to say, very little of that gives me the results I am looking for.
Is php code allowed in the front end template? If so, are there special rules on how it should be coded?
TIA,
George
Thanks for the suggestion on the calendar for the front end. It is basically functional and should only take a little more "tweaking."
But I am having trouble including php code in the "Front Permissions" "Record Edit Template." When I insert some code with the <?php and ?> tags, I am getting very little functioning code. When I look at the auto-generated code, some of the php code is not shown at all, some has [startphp] and [endphp] tags around it, and some gets converted to <?php and ?>. Needless to say, very little of that gives me the results I am looking for.
Is php code allowed in the front end template? If so, are there special rules on how it should be coded?
TIA,
George
Hi George,
Your code looks Ok to me - but clearly somewhere the <>s are gettting confused. Please try this slightly simpler version
Bob
Your code looks Ok to me - but clearly somewhere the <>s are gettting confused. Please try this slightly simpler version
<?php
$sql = "SELECT room FROM #__ctrooms;";
$database->setQuery( $sql );
if ( $debug ) { echo "sql: ".print_r($sql, true); }
$rooms = $database->loadObjectList();
foreach( $rooms as $room ) {
if ( $room->room ) {
echo "<option value='".$room->room."'>".$room->room."</option>";
}
}
?>
Bob
Hi George,
show me your PHP code to test with here, the PHP code should be replaced yes but it should work fine later!
Regards
Max
show me your PHP code to test with here, the PHP code should be replaced yes but it should work fine later!
Regards
Max
Bob:
I tried your code, but no improvement. I turned on debug and it never showed any effort to execute this query at all. Here is what the output html looked like for this part of the page.
As requested, I am sending the entire code to Max. Something seems to be impacting the php tags. Some of the php code disappears completely when you look at the auto-generated code.
Thanks,
George
I tried your code, but no improvement. I turned on debug and it never showed any effort to execute this query at all. Here is what the output html looked like for this part of the page.
<tr valign="top"><td width="150"><select name="Room">
<option value="".$room->room."" >".$room->room."</option></select><br></td>
As requested, I am sending the entire code to Max. Something seems to be impacting the php tags. Some of the php code disappears completely when you look at the auto-generated code.
Thanks,
George
Hi George,
I see where the problem is, I will try to find a fix for this issue, but the edit should work fine if there is no PHP there, or I think a PHP but outside DOM elements, because your PHP is inside the <select> element, this makes a problem!
Regards
Max
I see where the problem is, I will try to find a fix for this issue, but the edit should work fine if there is no PHP there, or I think a PHP but outside DOM elements, because your PHP is inside the <select> element, this makes a problem!
Regards
Max
Max:
Thanks for the quick feedback. I won't be able to try anything until tomorrow, but I will see what happens if I let the php code echo the select code. That should avoid the "php inside the select" problem.
George
Thanks for the quick feedback. I won't be able to try anything until tomorrow, but I will see what happens if I let the php code echo the select code. That should avoid the "php inside the select" problem.
George
Max:
I tried your suggestion, but now I get a parsing error on the eval'd code.
Here is part of the code from the front end template.
The auto-generated code for this portion is:
TIA,
George
I tried your suggestion, but now I get a parsing error on the eval'd code.
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /var/www/html/joomla/components/com_chronoconnectivity/chronoconnectivity.html.php(283) : eval()'d code on line 33
Here is part of the code from the front end template.
<tr valign="top"><td width="150">
<?php
echo "<select name='Room'>";
$sql = "SELECT room FROM #__ctrooms";
$database->setQuery( $sql );
$rooms = $database->loadObjectList();
foreach( $rooms as $room ) {
if ( $room->room ) {
echo "<option value='".$room->room."'>".$room->room."</option>";
}
}
echo "</select>"; ?>
<br></td>
The auto-generated code for this portion is:
<TD width=150>[startphp] echo "<SELECT ccnamex="Room">"; $sql = "SELECT room FROM #__ctrooms"; $database->setQuery( $sql ); $rooms = $database->loadObjectList(); foreach( $rooms as $room ) { echo "<OPTION value="" selected ccvaluex='".$room->room."' ccphpx="[startphp] if("{Room}" == "".$room->room."")echo "selected='selected'";[endphp]ccphpx">".$room->room."</OPTION>"; } echo "</SELECT>"; [endphp] <BR></TD>
If I counted right, all of the code shown here is line 33. Notice there are two [startphp] tags. I'm not sure what would have triggered the second one. I also noticed that all of the single quote marks are converted to double quote marks; I don't know if that is leading to the parsing error or not.TIA,
George
oh ok, I see now, will go through this more tomorrow!
regards
Max
regards
Max
Any solution to this?
I've run in to a similar issue with a select dropdown and the code to use an editor. The code works fine in admin and when creating a new record in the front end, just not in edit mode.
I've run in to a similar issue with a select dropdown and the code to use an editor. The code works fine in admin and when creating a new record in the front end, just not in edit mode.
Hi kavaXtreme,
I'm sorry but I was too busy with chronoforms and other work recently, a new version for Chronoforms will go out very soon (this weekend i hope) and then I will give more time to solve Connectivity's problems!
Cheers
Max
I'm sorry but I was too busy with chronoforms and other work recently, a new version for Chronoforms will go out very soon (this weekend i hope) and then I will give more time to solve Connectivity's problems!
Cheers
Max
No worries. I know you're plenty busy, but I just had to ask. 🙂
This topic is locked and no more replies can be posted.