Skip Navigation

[Resolved] Conditional Output on View

This support ticket is created 4 years, 7 months 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.

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by bahadirM4302 4 years, 7 months ago.

Author
Posts
#1345251

I am trying to build a conditional output on view. I want to show view results on different content templates according to post type.

for example if post type is "A" i want to show this post in "A content template" and if post type is "B" i want to show this post in "B content template" in a same view results.

<wpv-loop>
[wpv-conditional if="( '[wpv-post-type]' eq 'izlenim' )"][wpv-post-body view_template="liste-icerik-skin"][/wpv-conditional]
[wpv-conditional if="( '[wpv-post-type]' eq 'kisa-film' )"][wpv-post-body view_template="liste-icerik-kisa-skin"][/wpv-conditional]
</wpv-loop>

with above conditions page shows only "kisa-film" with right content template option. But 'izlenim' type posts are missing.

hidden link

thank you.

#1345289

You would use the wpv-post-type shortcode in the condition as you did already, and if the post type is really in the view, it will work.

Maybe the View does not query both post Types?
Or the [wpv-post-type] value is not precisely izlenim, instead maybe izlenims or similar?

#1351151

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.