Forums

how to put related model array in column

Elita- 26 Dec, 2020
hi, to all CCv6 guru, just wonder if anybody knows how to put an array of the related model in one table column. To make everything more complicated, I need two fields combined:

The table list data in a column should have be like this -
row 1 ([5] => Array) - [Kontaktpersona][0][vards] [Kontaktpersona][0][uzvards], [Kontaktpersona][1][vards] [Kontaktpersona][1][uzvards]
row2 ([6] => Array) - [Kontaktpersona][0][vards]

so, what to put in column views? or should i write the php code?

To describe my need here is the debug for DB read (simplified):
Array
(
[read_submissions] => Array
(
[log] => Array
(
[0] => SELECT `Submission`.`aid` AS `Submission.aid`, `Submission`.`nosaukums` AS `Submission.nosaukums`(.....) FROM `#_CF_uznemumi` AS `Submission` ORDER BY `Submission.izveidots` DESC LIMIT 100;
[1] => SELECT `Kontaktpersona`.`aid` AS `Kontaktpersona.aid`, `Kontaktpersona`.`vards` AS `Kontaktpersona.vards`, `Kontaktpersona`.`uzvards` AS `Kontaktpersona.uzvards` FROM `#_CF_kontaktpersonas` AS `Kontaktpersona` WHERE `Kontaktpersona`.`nosaukums_aid` IN ('25', '24', '23', '22', '21', '20', '19', '18', '17', '16', '15', '14', '13', '12', '11', '10', '9', '8', '7', '6', '5', '4', '3', '2', '1');
)

[var] => Array
(

[5] => Array
(
[Submission] => Array
(
[aid] => 20
[nosaukums] => Firma
)

[Kontaktpersona] => Array
(
[0] => Array
(
[aid] => 21
[vards] => Jana
[uzvards] => Late
[nosaukums_aid] => 20
)

[1] => Array
(
[aid] => 22
[vards] => Jane
[uzvards] => Bright
[nosaukums_aid] => 20
)

)

)

[6] => Array
(
[Submission] => Array
(
[aid] => 19
[nosaukums] => Uznemums
)

[Kontaktpersona] => Array
(
[0] => Array
(
[aid] => 20
[vards] => fh
[uzvards] =>
[nosaukums_aid] => 19
)

)

)
Max_admin 03 Jan, 2021
Answer
A custom table field will be needed, and use something like this:
{var.join[,]:Model.[n].fieldname}
This syntax is for v7, but I think that it should also work on v6 since that's a custom table field!
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Twincarb 18 Jan, 2022
Elitakey, are you able to expand on Max's answer here, I think this is similar to what I am trying to do at the moment, both in CF7 & CC6 but not getting very far.
You need to login to be able to post a reply.