Worked perfectly!
I think we (you) managed to solve and document a common issue that may be useful to many, don't you think?
I will recap for the record.
1) I created 3 fields:
- A
primaryemailaddress field named
email (where users insert their email; this field is not shown on their profile, but only in the user registration form)
- A
radio field named
cb_showemail (where the users decide whether to show their email with Yes or No; this field is not shown on their profile, but only in the user registration form)
- A
delimiter field named as you like (this is the field that must be shown on users' profile)
2) In the wysiwyg text area inside the
delimiter settings, i activated the code visualization and wrote the following code:
[code:1][cb:if cb_showemail="Yes"]<a href="mailto:[email]">[email]</a>[/cb:if]
[cb:if cb_showemail="No"]<a href="index.php?option=com_comprofiler&task=emailUser&uid=[user_id]">Send E-mail</a>[/cb:if][/code:1]
3) In CB
General Config ->
General tab, from the
Email management dropdown, you have to set "Show only email" in order to make all the stuff working.
All the above will show the
email address+mailto link for the users that clicked on Yes from the radio button in registration form, and will show a "Send E-mail" link to
CB e-mail composition form for those who selected No from the radio button.
Btw if you wanna check the website were i applied this code the address is:
www.archivillage.it/
(Google translated website:
bit.ly/hmFnu4
)
tyvm for this and for developing CB