Forums

Display results in an html view

JoCo 19 May, 2020
1 Likes
I've tried to display content from a database table in an html view.
First I've build a read data function called read_teams with model name teams.
Second i've build an html view named listTeams
Third in the event index i put {fn:read_teams} and {view:listTeams}
In the html view i put {var:read_teams.teams.captain} that i read in a previous topic.
It gives no result. What am i doing wrong?
Max_admin 20 May, 2020
what does {var:read_teams} show ?

You will need a table view to display the data correctly

And if you are starting your Connectivity work I would recommend that you use ChronoForms7 instead!
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
JoCo 20 May, 2020
Dear admin,
thank you for the quick respons.
read_teams is a function that retrieves all records from a database table.
I now have created also a tableview called table_teams.
Can you now tell me what the right syntax is to present the value in an html view?
Max_admin 20 May, 2020
There is a demo connection included and the FAQs page here shows some directions on how to do that!

But if you have sometime before using this table online then it's recommended to use v7 instead
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
JoCo 20 May, 2020
sorry admin, of course i examines all the demo's but there is no demo with an html view.
I found a topic in Forums but that not solved my problem.
It's strange. In v5 its so simple. It cannot be true that in v6 its so difficult. I just started with v6.
Please help me.
JoCo 20 May, 2020
I looked for v7 but in the download area there is no v7.
GreyHead 21 May, 2020
Hi JoCo,

Please click the Blog link above.

Bob
JoCo 21 May, 2020
Sorry Bob, but what do you mean with the Blog link?

To refer to my question in this topic.
I now have a result in my html view with the following syntax: {var:tableview_name.row.model.field_name} but........
It only shows the last record in de database table and not all of the records.
What i have to do to see all the records?

Jos
GreyHead 21 May, 2020
Hi Jos,

At the top right corner of this page there is a Blog link where you can download the beta version of CFv7.

Bob
JoCo 21 May, 2020
Oke Bob, i've got it.

and i find there also a solution for my topic?
JoCo 21 May, 2020
Bob, i am i little but confused.

I go to the blog link and the only compenent i see is chronoforms v7 beta but nothing about chronocennectivity and that is what we here talking about.
JoCo 21 May, 2020
But i install chronoformv7 and i will test it.
GreyHead 22 May, 2020
Hi Jos,

I believe that Max has included the features of CC in CFv7 so that you can build and display a table.

Bob
JoCo 22 May, 2020
Hi Bob,

i downloaded v7 but without any documention its very difficult. v7 will certainly not solve my problem.

Back to the beginning: how can i create a list of table rows in an html view in a table format.
As i already mentioned with this syntax {var:tableview_name.row.model.field_name} the html view show one table with the content of the last record in the database table. With i tried to achieve is a list of separate html tables for eache database record.
So what must be the syntax to show me the hole database table content in html tables.
If you can tell me that you definitely deserve a cup of coffee.
healyhatman 23 May, 2020
Have you tried following the demos for CC?
JoCo 23 May, 2020
Of course, non of the demo's used an html view. If you think there is please show me.
Max_admin 23 May, 2020
If you have v7 beta3 install then you can download and install this backup file, it will show you a list of the articles on your website, you can update the form to whatever you like![file=13049]table_test_23_May_2020_17_11_47.cf7bak[/file]
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
JoCo 24 May, 2020
I started with v7. It looks nice but it is the beginning.
There is an error shown in the form like: Your Global Email settings are not set, please open and configure ChronoForms7 Global Settings!
I looked for the Global Setting but i did not found it. Where i have to look ad with field is concern.
Max_admin 24 May, 2020
just open the v7 "settings" page then save it once!
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
JoCo 24 May, 2020
Oke, the error is solved.
To generate a simple table is easy if you have some experience with chronoconectivity.
I placed an custom view html with an html table (see below).
I want to display the same content as i see in the table list.
This is what i tried as syntax but an empty result.

What is the correct syntax to display the content from a database table?

{var:readdata_unitname.readdate_modelname.field_name}

<table>
<tbody>
<tr>
<td>Captain: {var:read_team.voorjaar.Naam}</td>
</tr>
<tr>
<td>Email: {var:read_team.voorjaar.Email}</td>
</tr>
<tr>
<td>Telefoon: {var:read_team.voorjaar.Telefoon}</td>
</tr>
</tbody>
</table>
Max_admin 24 May, 2020
this is on v7 or v6 ?
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
JoCo 25 May, 2020
v7
Max_admin 25 May, 2020
why do you use custom HTML ? you will need to loop with PHP and print the values, there is no shortcode for that!
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
JoCo 25 May, 2020
Oke, that is also a solution.
Yet the question remains why is that feature custom html present in chronoconnectitvityv5 and not in v7.
What is then the option in v7 to display the cells of the database table among each other and not side by side, php?.
That is why i like this feature in v5.
Max_admin 27 May, 2020
There is HTML node in v7 under "custom"

You need a table of field/value of a single record ? we now have a table for multiple records, that was the demo!
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
JoCo 28 May, 2020
I need a table of field/value of a single record (if it is possible).
Please send me a demo.
healyhatman 29 May, 2020
What does your debug say? Because it will show you all the data available.
JoCo 29 May, 2020
Hello healyhatman,
Here is part of the debug dump:
So now you can tell me exactly how i display the value [title] in this custom html code:

<table>
<tbody>
<tr>
<td><strong>Naam:</strong></td>
<td>{var:Article.title}</td>
</tr>
</tbody>
</table>

Array
(
    [pages] => Array
        (
            [requested] => form::page1
            [default] => form::page1
            [accepted] => Array
                (
                    [form] => Array
                        (
                            [form::page1] => true
                        )

                )

            [active] => form::page1
            [tokens] => Array
                (
                    [form::page1] => c7ae2daa-a3a0-4539-8186-6bc68d707f58
                )

        )

    [__lastsave] => 1590755162
    [_data] => Array
        (
            [form] => Array
                (
                    [option] => com_chronoforms7
                    [cont] => manager
                    [chronoform] => tabletest2
                )

        )

    [_vars] => Array
        (
            [form] => Array
                (
                    [read_data_1] => Array
                        (
                            [0] => Array
                                (
                                    [Article] => Array
                                        (
                                            [id] => 1
                                            [asset_id] => 55
                                            [title] => Kerstwens
                                            [alias] => kerstwens
healyhatman 29 May, 2020
If you only want one record you should be returning first matching not all matching. Otherwise, to display your only record you have there, you want {var:readdatanamehere.0.modelnamehere.fieldnamehere}
Max_admin 29 May, 2020
in v7, you enable the "Set Model Data" behavior in the "Read data" then you can use {var:Model.field}, but you should have the "Read data" set to select First record!
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
JoCo 30 May, 2020
Oke thanks, the first time i see a value in v7. That works perfect.
But now, for me, the last final step, how do i display this for multiple records?
Jos (that's my forst name 😀)
Max_admin 30 May, 2020
For multiple records you should use the listing table, it will ask for a data source then it will show the list!
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
JoCo 30 May, 2020
Thanks Max, i know.
The format of a listing table is :

Title1 Title2 Title3 Title4 Title5
Record1:xxxxx xxxxx xxxxx xxxxx xxxxx
Record2: xxxxx xxxxx xxxxx xxxxx xxxxx
Record3: xxxxx xxxxx xxxxx xxxxx xxxxx
etc..

But i need a listing table with this format:
Record1
Title1 xxxxx
Title2 xxxxx
Title3 xxxxx
Title4 xxxxx
Title5 xxxxx
Record2
Title1 xxxxx
Title2 xxxxx
Title3 xxxxx
Title4 xxxxx
Title5 xxxxx
etc...

Is this possible yes or no and if yes how in v7.
Max_admin 31 May, 2020
Answer
For this kind of list it's possible to use the HTML view, if you want multiple records then place it inside a "Repeater", your HTML view will have some code like what you have posted earlier:
<table><tbody><tr><td><strong>Naam:</strong></td><td>{var:Article.title}</td></tr></tbody></table>
if this does not work then please let us know!
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
JoCo 31 May, 2020
Oke Max,
that's it. It works perfect with the repeater in v7.
I will mark it as "answer".
Thanks for all the effort.

Jos
Max_admin 31 May, 2020
No problem!

Just a note though, after any new update and until the stable release you should make sure that all the form features work as expected, also after you open the form and save it, this is because some small changes are made, like a setting name or whatever

For example, the new update will unset the "Set Model data" behavior in your "Read data", and will change few fields events names, so if you use any of these then make sure you set them again!

Best regards
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
zest96 21 Sep, 2020
1 Likes
it's never too late, right?
Here is a working sample of HTML view (not table).
note the read data function is called: "read_article"
the Model is "Article"
the data get with: {var:your_read_function.Your_model.field_name}

you can use php too...
<div class="container clearfix">
<?php if ($this->get("read_article.Article.nominee_lastname")) {?>
<div id="first_nominee">
<h1>Details of Nominee</h1>
<div><b>Title</b> <span>{var:read_article.Article.nominee_title}{var:read_article.Article.nominee_title_other}</span></div>
<div><b>First Name</b> <span>{var:read_article.Article.nominee_firstname}</span></div>
<div><b>Middle Name</b> <span>{var:read_article.Article.nominee_middlename}</span></div>
<div><b>Last Name</b> <span>{var:read_article.Article.nominee_lastname}</span></div>
</div>
<?php } // end if nominee exist ?>
</div>
This topic is locked and no more replies can be posted.