Hi,
the site I am building has a database collection which contains member information (Name, email address, etc). This is populated at Login and also by updating a profile using a form.
I then use a repeater to post it on a web page.
Unfortunately, when I add the email address field into my repeater, the only option I have is URL. It works but members cannot click the email displayed and open their mail application. The workaround to this is to add mailto: in front of the email address then members can click the email within the repeater.
Now I manually had the mailto: to every new member that registered to my site.
Can someone suggests how I can automatically add this mailto: without a manual intervention? or any other suggestions to make the email address clickable and open the mail app.?
Thank you!
Pierre Lacasse
You can format the email URL before assigning it to the appropriate element in the Repeater by using the Repeater’s onItemReady() function.
Hi Yisrael,
thank you for the answer.
I looked at the onItemReady() function and can’t figure it out.
Do you use this to add the mailto: to the email or to make the URL email element clickable?
Thank you for any help
Pierre
Hi,
can’t figured it out
This is the code on my page where the repeater is
Can someone help me with this coding. It would much appreciated
$w(“#repeater1”).forItems( [“#text10”], ($w, itemData, index) => {
In this section I would like to add mailto: at the beginning and post it to repeater1 as mailto:blabla@gmail.com as an example
} );
Hi Pierre,
I just made a test :
- create a collection with text column
- add a dataset to the page pointing to this collection
- add a repeater to the page, pointing to the dataset
- linked the text to the text column
- added an email adress in the first row of the collection
→ result (when I publish the site) : the mailto: is automatically added to the text filed content when it is an email.
Do you happen to be able to reproduce this simple behavior?
Jerome,
yes it works for me too. The mailto: isn’t visible but it is there because when you click on the email, it opens the mail app.
Thank you very much for your help
Merci pour ton aide!
As-tu beaucoup d’expérience avec Wix Code?
Pierre Lacasse
My pleasure.
Non pas trop, mais comme j’étais bloqué sur mon propre dev j’ai jeté un oeil à ton truc. Coup de bol 