Tell us what you are trying to do?
I am trying to produce a row of social media icons linked to social media profiles associated with a custom post (Advisors) just under the headshot.
1. I would like to show a particular social media icon if and only if there is a link associated with the corresponding field. Divi does have conditional logic for images but the custom fields created by Toolset are not coming up to utilize in that conditional logic. Would have have to create a view or a content template inside Toolset to display the icons in Divi?
2. I would like to produce a row (rather than a stack which is what I currently have). I know this might be a separate issue, but I include this detail here in case it is relevant to the right way to do (1) above.
Is there any documentation that you are following?
No.
Is there a similar example that we can see?
hidden link
What is the link to your site?
hidden link
Hello,
I suggest you try these:
1) Create a content template
Display those social icons depends on each custom field value with shortcode [wpv-conditonal]:
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/checking-fields-and-other-elements-for-emptynon-empty-values/
Style and format those icons into a row with custom HTML/CSS codes
2) In the single Advisors post, display above content template with a Toolset content template block:
https://toolset.com/block-item/content-template/
Since you are using Divi theme, you can display the content template with shortcode [wpv-post-body], for example:
[wpv-post-body view_template="my-ct"]
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-post-body
I am having difficulty setting up the conditional block. For some reason I am not getting the custom fields for the custom post type Advisors. I need to test the value of the Facebook field to see if the link is empty or not.
Do I need to do something special to access those fields here?
Thank you so much.
I assume you are using Divi builders to design your website, The Toolset conditional block is based on WordPress built-in Blocks editor, Divi builder is different page builder from Blocks editor, it is not recommended use two different page builders to design the same page, see our document:
https://toolset.com/course-lesson/using-toolset-with-divi/#how-to-use-divi-and-toolset-together
Divi provides its own custom editor for building pages. Toolset on the other hand uses WordPress’s built-in Block Editor. In general, you cannot mix elements from these two editors.
I suggest you setup the shortcode [wpv-conditonal] with classic editor to avoid more unexpected results. See the document I mentioned above:
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/checking-fields-and-other-elements-for-emptynon-empty-values/
I am using the block editor to create the content template you recommended.
Here is a Loom video of what I am doing and where I am expecting to see the Toolset fields within the Conditional block and where I am not seeing them.
Please let me know what I am doing wrong.
hidden link
Please try these, edit the content template you mentioned above, in the top, find the option "View with:", find and select any "Advisors" post, save the content template, and test again.
Oddly, I do not get any Advisor posts as an option, see screenshot attached.
I have setup a demo in your website:
1) Edit the content template
hidden link
In section "Usage", enable option "Advisors", save
2) In option "View with:", choose one of "Advisors" post, see my screenshot view-with2.JPG
3) Disable option "Advisors" of step 1), save
4) Find and edit the conditional block, setup it with custom field "Facebook", see my screenshot conditional-block2.JPG
Hmm. So what was I doing wrong that I wasn't able to retrieve the Facebook field for the condition on my own. Was it selecting Advisors under Usage temporarily in the sidebar that allowed me to select the right fields in the conditional? Originally I didn't get them (see screen shot attached 6 messages above #2316763).
Now that I can set up the conditionals in this starter template, I was mostly able to complete the configuration and now have each of the icons showing conditionally with the image URL from the appropriate field.
I have a question about the image link but I will create a new thread.
To resolve this thread, I would just like to understand why I couldn't get the correct fields for the conditional block when I first tried this myself.
Thanks so much.
Yes, you are right.
You just need to enable the option of "Usage" temporarily in the sidebar, so you will be able to select the right fields in the conditional block
My issue is resolved now. Thank you!