Skip Navigation

[Closed] Help creating view to display conditional content in single post template

This support ticket is created 4 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Tagged: 

This topic contains 3 replies, has 2 voices.

Last updated by Christian Cox 4 years, 1 month ago.

Assisted by: Christian Cox.

Author
Posts
#1797445
name doesn't match to post.PNG

Tell us what you are trying to do? I am trying to create a view that shows name fields conditionally using fields and text in a view to insert into elementor single post template.
I have prefix, suffix and middle name fields that some people do not have. I want to display only the fields that have data for the post.
I want to use the elementor template as the blocks is so difficult to style

<div class="tb-fields-and-text" data-toolset-blocks-fields-and-text="1"><p style="text-align: center;">[wpv-conditional if=" ( ( $(wpcf-title) != '' ) ) " ][types field='title'][/types][/wpv-conditional] [types field='first-name'][/types] [wpv-conditional if=" ( ( $(wpcf-middle-name) != '' ) ) " ][types field='middle-name'][/types][/wpv-conditional][types field='last-name'][/types] [wpv-conditional if=" ( ( $(wpcf-suffix) != '' ) ) " ][types field='suffix'][/types][/wpv-conditional]</p></div>

Is there any documentation that you are following? following this tutorial reading the documentation and viewing the video
hidden link

I did one view with the query for post id as in tutorial, but it did not return the current posts information. I tried another view without the query filter and it also did not return the current post information. I cannot find any way to edit the query information if it doesn't work. I don't know if it is possible based on this link https://toolset.com/forums/topic/change-query-filter-in-a-views-set-by-toolset-block/

Is there a similar example that we can see? Working example in tutorial here:
hidden link

Not working for me here:
Link to the elementor draft single template is here:
hidden link
Link to the view/page is here:
hidden link

What is the link to your site? hidden link

#1799383

Hello, does the View work on the front-end of the site (when the post is published), but not in the Elementor preview?
Can you take a screenshot of the View's post ID Query Filter and share it here for me to review?

#1801985

I'm having so many problems that I think I need a contractor. I the view works in preview, but not when I have the query filter added.

#1802229

Sorry to hear this is frustrating. I'll be glad to take a quick peek if you'd like to share login credentials in the private reply fields here.

The topic ‘[Closed] Help creating view to display conditional content in single post template’ is closed to new replies.