Hi, I would like to create an employee list with corresponding data and emails as ACF.
I used a email field in ACF and a cwicly repeater to let it pop up un my site. That works fine but I would like the email clickable (mailto:)
I tried different methods but I couldn’t achieve it.
Does somebody have any Ideas how to achieve this?
Edit:
I have an ACF field (containing e-mail in some form).
I would like this field to appear as a clickable link <a href="mailto:my@field.com">my@field.com or something else</a>
Do you have a live site?
What’s your exact approach?
Do you use dynamic attributes?
Not aware of a current solution which can give you mailto:my@field.com, by only inserting my@field.com.
You would need to prepend mailto: inside your email field every time but can’t say for sure.
There might be some code snippet which can inject that for you on page load.
I have a custom post type (CPT UI) that contains my staff members.
Each staff member has several fields ACF and also a field for email.
This email field should only contain an e-mal with no code, hence the question.
So I am currently trying to display a dynamic email as a clickable link.
For the solution, I am using a query to filter by the staff I want.
If I want the content to display only the clickable email, I use a header and use the dynamic content to display it. Then I use the code from @Louis to add the clickability (href).
If I want to add something other than just the email, I would wrap that with the header in a div and link that as href.
Hi, just ran into a new problem.
What if I have a repeater and now want to get one field of that repeater block?
So for example the repeater User has a the fields: user_name, user_email and so on…
With the solution above I tried mailto:{acffield=user_email}, but this doesn’t work.
So I thought this might be some kind of inheritance and tried multiple symbols to reference that inheritance… / \ , ; and so on… example: mailto:{acffield= user/user_email}
I checked out the ACF Sub Field page. But I am really bad with code and couldn’t find a clue.
But I am not sure for what the Title is for, couldn’t find it in the DOCS.
I then pasted the reference in the link field to get my href (mailto) and added the location of the ACF group.
This works, I also reset the Title field because I do not know what it is for
Have to look into return functions for nested groupings never used them.
Finally got the email address working as a link with mailto: added.
My setup:
A post template page with the authors email address added as a button block with the text ‘email’ used as the link.
ACF fields set up as a group (field name = contributor_1) which has the authors name, title, email (field name = email_address), linkedin address.
On the button I linked it using:
Type = URL
Source = Static
in the 'Search or type url field, add = mailto:{acf_group_field=contributor_1=email_address}
Sorry to bump this thread, but I might be missing something. I’m trying the mailto:{acffield=yourfieldnamehere } solution on a query with frontend rendering on, and it doesn’t seem to get the email from the custom field. I just get an <a href="mailto:"></a> and nothing else. I’ve double, triple, quadruple-checked the field name.