How can I auto index a Field Name for Action loop?
If I have
antani.0.name
antani.1.name
how can I change 0 and 1 whit auto index?
I tried:
antani.[n].name
antani.n.name
antani.[#].name
antani.#.name
without success. Or there is another way?
My loop (loop_65) data provider is
{data:antani}
and my save data value is {var:loop_65.value.name}
Thank you for reply.
If I have
antani.0.name
antani.1.name
how can I change 0 and 1 whit auto index?
I tried:
antani.[n].name
antani.n.name
antani.[#].name
antani.#.name
without success. Or there is another way?
My loop (loop_65) data provider is
{data:antani}
and my save data value is {var:loop_65.value.name}
Thank you for reply.
Hi
If your Action loop has loop_name as a name, you can use loop_name.value to see you loop variables
For exemple:
Build a read data of your #__users table, name read_users, model users, selecting All matching records, Add limit = 3 records
Add a Loop named loop_name after your read data, with Data provider = {var:read_users}.
In the body of your loop, add a Basic Message: {var.pr:loop_name}
You can see that all the fields of your loop as a model named value, including an array named users (the read_users model).
So, {var:loop_3 value} return the users array for each user, {var:loop_3 value.users} return all the field of each user, {var:loop_3 value.users.username} return usernames of each user.
If your Action loop has loop_name as a name, you can use loop_name.value to see you loop variables
For exemple:
Build a read data of your #__users table, name read_users, model users, selecting All matching records, Add limit = 3 records
Add a Loop named loop_name after your read data, with Data provider = {var:read_users}.
In the body of your loop, add a Basic Message: {var.pr:loop_name}
You can see that all the fields of your loop as a model named value, including an array named users (the read_users model).
So, {var:loop_3 value} return the users array for each user, {var:loop_3 value.users} return all the field of each user, {var:loop_3 value.users.username} return usernames of each user.
No, I speek of another situation
I've a form with multiple data and I want so save these.
Is similar to this post
https://www.chronoengine.com/forums/posts/t108695/p394062/multi-save-record?startat=0
but I need to change index with a shortcode o similar.
I've a form with multiple data and I want so save these.
Is similar to this post
https://www.chronoengine.com/forums/posts/t108695/p394062/multi-save-record?startat=0
but I need to change index with a shortcode o similar.
Hi
Sorry, but I don't understand.
Edit:
But, if I add a message action in my loop action, I see a key for each row.
I can read this key by {var.pr:antani.key}.
So I think that it is possible to add a name including this key in a array of field.
Sorry, but I don't understand.
Edit:
But, if I add a message action in my loop action, I see a key for each row.
I can read this key by {var.pr:antani.key}.
So I think that it is possible to add a name including this key in a array of field.
In CC6 I have Antani[{[strong]data:_counter/0[/strong]}][name]. What is similar in CF7?
Ok, I have solved. I didn't now that I need to create Repeater, Multifield, and finally get field name antani.#repeater.name.
Thank you to Sam and its attachment Repeater_Demo_05_Nov_2020_14_15_28.cf7bak
that I found here https://www.chronoengine.com/forums/posts/t108628/explanation-of-cf7-repeater
Thank you to Sam and its attachment Repeater_Demo_05_Nov_2020_14_15_28.cf7bak
that I found here https://www.chronoengine.com/forums/posts/t108628/explanation-of-cf7-repeater
An in a table? i try Antani.#table_name.name without success.
Mi target need to be
Mi target need to be
[antani] => Array ( [0] => Array ( [id_listino] => 207 [nome] => Matrimonieere ) [1] => Array ( [id_listino] => 222 [nome] => Antani2 ) [2] => Array ( [id_listino] => 223 [nome] => Funziona
You need to login to be able to post a reply.