Skip Navigation

[Resolved] Toolset View's Output Editor's shortcodes visible in frontend

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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 4 replies, has 2 voices.

Last updated by katjaL 4 years, 7 months ago.

Assisted by: Shane.

Author
Posts
#1611911
Screenshot 2020-05-05 at 11.49.32.png

I have this view which I want to show only for logged in users. And if not logged in, I want to show the login form. I thought this code in the view's Output Editor would do the job:

[wpv-conditional if="( '[wpv-current-user info='logged_in']' eq 'false' )"]
[wpv-login-form]
[/wpv-conditional]

[wpv-conditional if="( '[wpv-current-user info='logged_in']' eq 'true' )"]
[wpv-filter-meta-html]
[wpv-layout-meta-html]
[/wpv-conditional]

But it does the job partly. For the logged out user it doesn't show the content (fine!) but it shows the login form as shortcode. And after logging in, the content of the view is there, but labels are as shortcodes (check attached image). So in a perculiar way this Output Editor field knows some Toolset shortcodes, but not all. Is this intentional?

#1612669

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Katja,

Thank you for getting in touch.

When you remove the conditional from the Output editor does the view display normally? I mean do the shortcodes start to render as intended?

Please let me know and we can take i from there.

Thanks,
Shane

#1612685

Hi Shane, thank you. Yes, everything looks fine without conditions.

#1612695

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Katja,

Thanks for confirming. Rather than wrapping the Output Editor shortcodes in the conditional, it would be better to wrap the view itself in the conditional.

This way you will hide the view in its entirety as the partial loading of the view could be the cause of the issue.

Try doing it like this,

[wpv-conditional if="( '[wpv-current-user info='logged_in']' eq 'true' )"]
[wpv-view name='my-view']
[/wpv-conditional]

Please let me know if this helps.
Thanks,
Shane

#1613247

Hi Shane, I can't use the nice blocks this way, but the code works, thank you 🙂