Skip Navigation

[Resolved] Raw Views Output

This thread is resolved. Here is a description of the problem and solution.

Problem:
I need to get only the values returned by the View, but Views Loop adds some default HTML around the actual output.
What can I do?

Solution:
Toolset Views cannot be used to produce a clean Loop output (Data providing), but is only inteded to be used to display data, as such, it has some default HTML around every Loop, and that will make it impossible to use "raw" values.

What you can do is use Custom PHP code as elaborated in the below linked ticket.
https://toolset.com/forums/topic/views-result-array-as-shortcode-parameter/

This is something that falls under Custom Coding, and there is a feature requeset (no ETA) to construct a Data Provider method for Views

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

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by fernandoS-3 7 years, 6 months ago.

Assisted by: Beda.

Author
Posts
#523557

Hi!

I have two views generated sums:
View01 => sumValue01
View02 => sumValue02

I need compare values to show form01 or form02:
if sumValue01 > sumValue02 then
{ form01 } else { form02 }

I'm using use shortcode, but the value of shortcodes isn't maintained between views.

Thank's.

#523691

Toolset Views cannot be used to produce a clean Loop output (Data providing), but is only inteded to be used to display data, as such, it has some default HTML around every Loop, and that will make it impossible to compare "raw" values.

What you can do is use Custom PHP code as elaborated in the below linked ticket.
https://toolset.com/forums/topic/views-result-array-as-shortcode-parameter/

That will allow you to return raw output of a View loop, but you will eventually be better served with a Custom ShortCode that gets the data you need, and then outputs a clean raw value.

Then to use the ShortCodes or functions in a HTML condition you need to follow this DOC:
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/using-custom-functions-in-conditions/
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/using-shortcodes-in-conditions/ > Checking Custom shortcodes

#523766

Beda, thank you.

I'm started use session to save values. And, ASAP, I'll try https://wordpress.org/plugins/wp-session-manager/.