I am trying to list table fields using HTML.
My index event is:
{fn:read_contacts_x_users}
{view:html7}
And the html7 view is:
<table>
<tr>
<th>Username</th>
<th>Name</th>
</tr>
<tr>
<td>{var:read_contacts_x_users.Contacts.username}</td>
<td>{var:read_contacts_x_users.Contacts.name}</td>
</tr>
</table>
Where read_contacts_x_users is the function and Contacts is the model name. I have tried various combinations here and nothing works. I get the header row but nothing else.
What am I doing wrong?
Karen
My index event is:
{fn:read_contacts_x_users}
{view:html7}
And the html7 view is:
<table>
<tr>
<th>Username</th>
<th>Name</th>
</tr>
<tr>
<td>{var:read_contacts_x_users.Contacts.username}</td>
<td>{var:read_contacts_x_users.Contacts.name}</td>
</tr>
</table>
Where read_contacts_x_users is the function and Contacts is the model name. I have tried various combinations here and nothing works. I get the header row but nothing else.
What am I doing wrong?
Karen
Well for a start you'd surely want a loop, to make a row for each entry, right?
And why not just use the TABLE view instead of making a manual one?
And why not just use the TABLE view instead of making a manual one?
I'll see if I can figure out how to make a loop.
Why not use a TABLE view? - I am try to learn how to do a printer friendly page and I understand you have to format it with an HTML view.
What I really want to do is construct a form (which I know how to do) and then print the form. Can you point me in the right direction on the printing part?
Thanks,
Karen
Why not use a TABLE view? - I am try to learn how to do a printer friendly page and I understand you have to format it with an HTML view.
What I really want to do is construct a form (which I know how to do) and then print the form. Can you point me in the right direction on the printing part?
Thanks,
Karen
Bob,
I have constructed a very simple form in CF6. I should explain that this is not a fill-in form but is intended for the user to print and then mail in. Yes I know this is dark ages, but that is just how things work at the moment.
Right now the form has just has just a custom HTML section:
<div id="print_div">
<p>Preferred Course:_____________________________________</p>
<p>Alternate Choice: _____________________________________</p>
</div>
And a button
Then in the Setup in the Submit section I copied in the jQuery code in the FAQ:
<?php
$jdoc = \JFactory::getDocument();
$script = "
jQuery(document).ready(function(jQ){
function printPage()
{
var html, css, csss_file, printWin;
css = \"\";
css = \"<style type='text/css'>\"+css+\"</style>\";
css_url = '';
if ( css_url !== '' ) {
css_url = \"<link rel='stylesheet' type='text/css' href='\"+css_url+\"' media='print' />\";
}
html = '<html><head>'+css+css_url+'</head>'+jQ(id).html()+'</html>';
printWin = window.open('', '', 'left=100, top=100, width=600, height=400, toolbar=0, scrollbars=0, status=0' );
printWin.document.write(html);
printWin.document.close();
printWin.focus();
printWin.print();
printWin.close();
}
var id;
id = '#print_div';
jQ('#print_button').css('visibility', 'visible');
jQ('#print_button').click(printPage);
});
";
$jdoc->addScriptDeclaration($script);
?>
On Submit I am getting an error message:

Any suggestions?
Karen
I have constructed a very simple form in CF6. I should explain that this is not a fill-in form but is intended for the user to print and then mail in. Yes I know this is dark ages, but that is just how things work at the moment.
Right now the form has just has just a custom HTML section:
<div id="print_div">
<p>Preferred Course:_____________________________________</p>
<p>Alternate Choice: _____________________________________</p>
</div>
And a button
Then in the Setup in the Submit section I copied in the jQuery code in the FAQ:
<?php
$jdoc = \JFactory::getDocument();
$script = "
jQuery(document).ready(function(jQ){
function printPage()
{
var html, css, csss_file, printWin;
css = \"\";
css = \"<style type='text/css'>\"+css+\"</style>\";
css_url = '';
if ( css_url !== '' ) {
css_url = \"<link rel='stylesheet' type='text/css' href='\"+css_url+\"' media='print' />\";
}
html = '<html><head>'+css+css_url+'</head>'+jQ(id).html()+'</html>';
printWin = window.open('', '', 'left=100, top=100, width=600, height=400, toolbar=0, scrollbars=0, status=0' );
printWin.document.write(html);
printWin.document.close();
printWin.focus();
printWin.print();
printWin.close();
}
var id;
id = '#print_div';
jQ('#print_button').css('visibility', 'visible');
jQ('#print_button').click(printPage);
});
";
$jdoc->addScriptDeclaration($script);
?>
On Submit I am getting an error message:
Any suggestions?
Karen
If you don't need them to fill anything in why bother with a form at all? Make a pdf and just have them download it
There will be some variability in the information presented on the form. Some of the form info will come out of a table.
OK that makes more sense then.
The code you used doesn't go in the "Submit" section. It should go in a Custom HTML block in the Design tab.
The code you used doesn't go in the "Submit" section. It should go in a Custom HTML block in the Design tab.
I did what you suggested and it was working until it wasn't. The print button doesn't appear now. Here is what I have in the Custom HTML Design block:
<div id="print_div">
<p>Preferred Course:_____________________________________</p>
<p>Alternate Choice: _____________________________________</p>
</div>
<?php
$jdoc = \JFactory::getDocument();
$script = "
jQuery(document).ready(function(jQ){
function printPage()
{
var html, css, csss_file, printWin;
css = \"\";
css = \"<style type='text/css'>\"+css+\"</style>\";
css_url = '';
if ( css_url !== '' ) {
css_url = \"<link rel='stylesheet' type='text/css' href='\"+css_url+\"' media='print' />\";
}
html = '<html><head>'+css+css_url+'</head>'+jQ(id).html()+'</html>';
printWin = window.open('', '', 'left=100, top=100, width=600, height=400, toolbar=0, scrollbars=0, status=0' );
printWin.document.write(html);
printWin.document.close();
printWin.focus();
printWin.print();
printWin.close();
}
var id;
id = '#print_div';
jQ('#print_button').css('visibility', 'visible');
jQ('#print_button').click(printPage);
});
";
$jdoc->addScriptDeclaration($script);
?>
What now?
<div id="print_div">
<p>Preferred Course:_____________________________________</p>
<p>Alternate Choice: _____________________________________</p>
</div>
<?php
$jdoc = \JFactory::getDocument();
$script = "
jQuery(document).ready(function(jQ){
function printPage()
{
var html, css, csss_file, printWin;
css = \"\";
css = \"<style type='text/css'>\"+css+\"</style>\";
css_url = '';
if ( css_url !== '' ) {
css_url = \"<link rel='stylesheet' type='text/css' href='\"+css_url+\"' media='print' />\";
}
html = '<html><head>'+css+css_url+'</head>'+jQ(id).html()+'</html>';
printWin = window.open('', '', 'left=100, top=100, width=600, height=400, toolbar=0, scrollbars=0, status=0' );
printWin.document.write(html);
printWin.document.close();
printWin.focus();
printWin.print();
printWin.close();
}
var id;
id = '#print_div';
jQ('#print_button').css('visibility', 'visible');
jQ('#print_button').click(printPage);
});
";
$jdoc->addScriptDeclaration($script);
?>
What now?
I don't see a button in that code
OK. My bad. I forgot to copy the button code.
Now that the button is back I have another issue. In Firefox I can enhance the button (change the color, placement, etc.). But Chrome ignores my CSS. Is the Semantic UI overriding the CSS?
Now that the button is back I have another issue. In Firefox I can enhance the button (change the color, placement, etc.). But Chrome ignores my CSS. Is the Semantic UI overriding the CSS?
I doubt it. Clear Chrome's cache and hard reload.
That worked. thanks.
In a table list how can I get the contents of a cell to wrap? Or alternatively how can I put a horizontal scroll bar at the bottom of the list?
Thanks again,
Karen
In a table list how can I get the contents of a cell to wrap? Or alternatively how can I put a horizontal scroll bar at the bottom of the list?
Thanks again,
Karen
have a look at the semantic ui documentation it's in there somewhere in layout I think. Midnight here
This topic is locked and no more replies can be posted.