Hello. Can You confirm that this is a Bug? Thank you.
In actions I set an array..


and I want select only first line for dropdwon options, that is in a repeater



Why I've some options? Where I wrong?
This is row 3...


And this is row 4

In actions I set an array..

and I want select only first line for dropdwon options, that is in a repeater

Why I've some options? Where I wrong?
This is row 3...

And this is row 4

Hi
You can't do that
First, if your PHP Element array change for each line of Multiline Option, the php code has to be in the loop, before Dropdown
Second: to pass a var from php to CF7, you have to use this syntax:
$this->set("var_cf7", $varPhp);
So, in Dropdown Multine Line Options, you have to do that:
{var:var_cf7}
Third: CF7 array has to be an associative array.
For example, someone like this in PHP:
$carsPhp=array(0=>'Volvo',1=>'BMW',2=>'Saab');
$this->set("cars_cf7", $);carsPhp;
Then, in CF7, Multiline Options
{var:cars_cf7}
In this case, you have a dropdown, to choose between Volvo, BMW, Saab.
But I don't understand very well that you will.
May be...
first loop:choose between Volvo, BMW, Saab
Second loop; choose between Fiat,Mercedes, Porsche
Third loop: choose between Ferrari, Lamborghini, Porsche
Is it? In this case, you have to pass the row number to php to calculate between each row of the loop.
Good luck!
You can't do that
First, if your PHP Element array change for each line of Multiline Option, the php code has to be in the loop, before Dropdown
Second: to pass a var from php to CF7, you have to use this syntax:
$this->set("var_cf7", $varPhp);
So, in Dropdown Multine Line Options, you have to do that:
{var:var_cf7}
Third: CF7 array has to be an associative array.
For example, someone like this in PHP:
$carsPhp=array(0=>'Volvo',1=>'BMW',2=>'Saab');
$this->set("cars_cf7", $);carsPhp;
Then, in CF7, Multiline Options
{var:cars_cf7}
In this case, you have a dropdown, to choose between Volvo, BMW, Saab.
But I don't understand very well that you will.
May be...
first loop:choose between Volvo, BMW, Saab
Second loop; choose between Fiat,Mercedes, Porsche
Third loop: choose between Ferrari, Lamborghini, Porsche
Is it? In this case, you have to pass the row number to php to calculate between each row of the loop.
Good luck!
Sure, if you include this php element in the Repeater....
You have to include the php element in the repeater only if you will change the array for each loop to recalculate each time.
Want do you want exactly? In your picture, I don't see the source of the repeater.
You have to include the php element in the repeater only if you will change the array for each loop to recalculate each time.
Want do you want exactly? In your picture, I don't see the source of the repeater.
The cars was an example.
The repeater connect to a list of photo, every photo has a price list id.
I need a dropdown that get all lists of this price list id
Can you help me to find right way?
For example I've Photo Id 3277, his price list is 208, and for this Photo I need to get all formats/prices
that has price list = 208


In dropdown, option value will be id, and option text a combine of formato and prezzo
The repeater connect to a list of photo, every photo has a price list id.
I need a dropdown that get all lists of this price list id
Can you help me to find right way?
For example I've Photo Id 3277, his price list is 208, and for this Photo I need to get all formats/prices
that has price list = 208


In dropdown, option value will be id, and option text a combine of formato and prezzo

Hi
First, can you speak french?
Two: I think you don't have to use a repeater. I see 2 methods.
1 More easy, using 2 dropdowns
You read the table to build an array of (Photo_id=>liste_id) to load in a first dropdown.
When the visitor choose a photo, you know the liste_id. Using Ajax, you load an array like (liste_id=>format_price_id) to load in a second dropdown.
Then the visitor can choose a Format/Price in the second dropdown.
2 using Relations table + special field to build an array of (photo/list=>format_price).
So you have a dropdown like:
photo1/liste:Format_price1
photo1/liste:Format_price2
photo1/liste:Format_price3
photo1/liste:Format_price4
photo2/liste:Format_price1
photo2/liste:Format_price2
photo2/liste:Format_price3
photo2/liste:Format_price4
...
In the second method, if you have many photos, your dropdown list will be very very large!
First, can you speak french?
Two: I think you don't have to use a repeater. I see 2 methods.
1 More easy, using 2 dropdowns
You read the table to build an array of (Photo_id=>liste_id) to load in a first dropdown.
When the visitor choose a photo, you know the liste_id. Using Ajax, you load an array like (liste_id=>format_price_id) to load in a second dropdown.
Then the visitor can choose a Format/Price in the second dropdown.
2 using Relations table + special field to build an array of (photo/list=>format_price).
So you have a dropdown like:
photo1/liste:Format_price1
photo1/liste:Format_price2
photo1/liste:Format_price3
photo1/liste:Format_price4
photo2/liste:Format_price1
photo2/liste:Format_price2
photo2/liste:Format_price3
photo2/liste:Format_price4
...
In the second method, if you have many photos, your dropdown list will be very very large!
Ok. First, I'm sorry but I don't speak french.
So, I was working to second methods

So, I was working to second methods


I don't analyse your job in detail, but I see at least one big bug:
Not {var:read_immagini.0.Foto.cf_id} : you are reading only the firt line!
but {var:read_immagini.[n].Foto.cf_id} to read all lines.
Not {var:read_immagini.0.Foto.cf_id} : you are reading only the firt line!
but {var:read_immagini.[n].Foto.cf_id} to read all lines.
Yes Colnem, but, I should see only a element, 3277 only a time.
For ever element of repeater, this option increases by one.
first element = 1 (3277)
second = 2 (3277,3277)
then = 10 (3277, 3277,3277,3277,3277,3277,3277,....)
For ever element of repeater, this option increases by one.
first element = 1 (3277)
second = 2 (3277,3277)
then = 10 (3277, 3277,3277,3277,3277,3277,3277,....)
Ok I didn't't understand.
So it's more easy. And don't use a repeater.
You read your table xijdhd_cf_prodotti_formatti with Add Where conditions in SQL Statement: id_listino = {var:read_immagini.[0].Sottogalleria.id_listino}
Then, please, post me a copy of the result...
I'm waiting for you...
So it's more easy. And don't use a repeater.
You read your table xijdhd_cf_prodotti_formatti with Add Where conditions in SQL Statement: id_listino = {var:read_immagini.[0].Sottogalleria.id_listino}
Then, please, post me a copy of the result...
I'm waiting for you...
A Read data Element to read your table xijdhd_cf_prodotti_formatti with Add Where conditions in SQL Statement: id_listino = {var:read_immagini.[0].Sottogalleria.id_listino}...
The result will be an array of value that you can use to read the second table.
The result of the second table will'be used to build your var for the dropdown.
The result will be an array of value that you can use to read the second table.
The result of the second table will'be used to build your var for the dropdown.
I can't understand when you write "the second table".
See my work.
I haven't error written above, but I've prices of all list insert in Photos get.



See my work.
I haven't error written above, but I've prices of all list insert in Photos get.




I retake.
Table 1: Read Element with Add SQL STatement: cf_id = 3277 to read id_listino
Table 2: Second read Element table xijdhd_cf_prodotti_formatti with Add Where conditions in SQL Statement: id_listino = {var:read_immagini.[0].Sottogalleria.id_listino}
So your result will be only id=208....
Table 1: Read Element with Add SQL STatement: cf_id = 3277 to read id_listino
Table 2: Second read Element table xijdhd_cf_prodotti_formatti with Add Where conditions in SQL Statement: id_listino = {var:read_immagini.[0].Sottogalleria.id_listino}
So your result will be only id=208....
If it's good, In the dropdown:
Option Value = {Prezzi.id} (for the moment).
Option Text = {Prezzi.prezzo} (for the moment).
I believe that you expect somenone like a list of Format+Prize:
prezzo1 / 2.00
prezzo / 5.00
02 / 2.00
01 / 1.00
Isn't it?
If I'am wright: Option Text = {Prezzi.formato} / {Prezzi.prezzo}
Option Value = {Prezzi.id} (for the moment).
Option Text = {Prezzi.prezzo} (for the moment).
I believe that you expect somenone like a list of Format+Prize:
prezzo1 / 2.00
prezzo / 5.00
02 / 2.00
01 / 1.00
Isn't it?
If I'am wright: Option Text = {Prezzi.formato} / {Prezzi.prezzo}
Hi Colnem, thank you very much for your support.
And sorry, but I don't understand.
If I read this
I ask me: How can I read an array with Read Data? I Read Data I can only select a database table? There is another way that I don't know?
Remember that dropdown for Photo id 3277 (so with List 208) is different to Photo id 3278 (and with List 207).
Thank you so much.
And sorry, but I don't understand.
If I read this
A Read data Element to read your table xijdhd_cf_prodotti_formatti with Add Where conditions in SQL Statement: id_listino = {var:read_immagini.[0].Sottogalleria.id_listino}...
The result will be an array of value that you can use to read the second table.
The result of the second table will'be used to build your var for the dropdown.
I ask me: How can I read an array with Read Data? I Read Data I can only select a database table? There is another way that I don't know?
Remember that dropdown for Photo id 3277 (so with List 208) is different to Photo id 3278 (and with List 207).
Thank you so much.
I've said "Read data read an array"? I'm wrong. Sorry for my bad english language.
I would say "Read Data return always results in associative array"
See up at your pictures: read_immagini)=>Array, (read_prezzi)=>Array...
I would say "Read Data return always results in associative array"
See up at your pictures: read_immagini)=>Array, (read_prezzi)=>Array...
Hi Colnem, I read some times yours post, but I don't understand.
You say that I must not use repeater.
But I need to get a loop of items (Photos), there is another way?
Thank you so much if you can help me!!!
You say that I must not use repeater.
But I need to get a loop of items (Photos), there is another way?
Thank you so much if you can help me!!!
You need to login to be able to post a reply.