Home › Toolset Professional Support › [Resolved] Custom field for email not working consistently
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | - |
- | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | - |
Supporter timezone: Asia/Kolkata (GMT+05:30)
This topic contains 11 replies, has 3 voices.
Last updated by Minesh 1 year, 4 months ago.
Assisted by: Minesh.
Using views and custom fields.
On the Teams page we have a Views grid with team members. Previously imported or created Team Member entries have no problem creating an email link in the custom field. But Email address links are not appearing on New Members added today. Using the email field and this config: mailto:name@company.com
Do you know why this field would not be working
Hello,
I urgently need help with this matter.
Thank you
Languages: English (English ) Spanish (Español )
Timezone: Europe/London (GMT+00:00)
Hi there
the email field should store email addresses, and "mailto:name@company.com" isn't an email address (it includes the mailto link protocol).
You should enter email addresses like "name@company.com".
I'm not sure why one instance worked using this format, but you should enter pure email addresses (it might be a good idea to activate validation for the email field in its settings).
If it still doesn't work after making that change, let us know.
It was originally a url field as I need this to be a mailto: link to the person's email. Not simply a display of same
It's really strange that for old records its working and for new one its not.
Can you please share problem URL where I can see the issue as well as admin access details.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
I checked the admin access details you shared with me but unfortunately its not working at this end.
Can you please send me working admin access details.
I have set the next reply to private which means only you and I have access to it.
somehow the conditional is break and it does not work as expected maybe as you have changed the field type or could be other possible reason.
As a workaround, I've remove the image block and instead of that I've added the "Fields and Text" block and to that block I've added the following HTML content:
<figure class="wp-block-image tb-image tb-image-dynamic tb-image-frame-none" data-toolset-blocks-image="6ea00af41043b43b4ae187354a54956c" data-initialised="true"> <a href="[types field='office-email-link' output='raw'][/types]"><img decoding="async" width="64" height="61" loading="lazy" src="<em><u>hidden link</u></em>" alt="" class="wp-image-29204"></a></figure>
Where as you can see we are assigning the dynamic office email link field value using the shortcode:
- [types field='office-email-link' output='raw'][/types]
In addition to that I've added the following CSS code to your view's "Custom JS and CSS" tabs "Custom CSS" box:
.tb-fields-and-text .wp-block-image img { box-sizing: border-box; height: auto; max-width: 100%; vertical-align: bottom; height:25px !important; }
Can you please confirm it works as expected now:
- hidden link
Hello Minesh,
First, I would like to be clear that this field HAD BEEN working, stopped working, and THEN I changed things.
And although your fix certainly looks like it should work, it does not. It has not solved the problem at all.
Newly added team members' email is not being added to the href and the image is not being loaded.
We might have to understand why that conditional is breaking.... this site needs to go live this week. I am concerned that it will not be stable.
It seems as you added the mailto: in the URL field it's casing the problem with conditional block.
For now to ensure both old and newly added entries the conditional should work, I've added the "Fields and Text" block and within that I've added the following conditional statement and removed the conditional block that was used to check the email field.
[wpv-conditional if="( '[types field='office-email-link' output='raw'][/types]' ne '' )"] <figure class="wp-block-image tb-image tb-image-dynamic tb-image-frame-none" data-toolset-blocks-image="6ea00af41043b43b4ae187354a54956c" data-initialised="true"> <a href="[types field='office-email-link' output='raw'][/types]"><img decoding="async" width="64" height="61" loading="lazy" src="<em><u>hidden link</u></em>" alt="" class="wp-image-29204"></a></figure> [/wpv-conditional]
Then I've added the following new profile:
- hidden link
On the frontend page, you can search form "Minesh" and I can see its displaying the email field for newly added entry as well.
=> hidden link
You can go for life - it should work without any issues 🙂
Ah! Perhaps it is true that this should not have worked at all given the way I initially set it up? Oh dear!
I will review what you you have written in hopes that I learn something 🙂
Thank you for fixing this.
You can always free to use [wpv-conditional] shortcode if you face issues with conditional block.
More info:
- https://toolset.com/documentation/legacy-features/views-plugin/conditional-html-output-in-views/
Glad to help and you are welcome to mark resolve this ticket.