Skip Navigation

[Resolved] Create daily date and time based colored bars with custom field input

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 7 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

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)

Author
Posts
#493930
TripleS-Mockup.PNG

I am trying to: Create a new daily custom page with custom post type data to set the color of time based bars via select fields with 5 values. The default value is "Undetermined"

This is a sample mockup page: hidden link (Also screen shot attached)

I expected to see: Daily page automatically created on first visit with default values of Undetermined and a gray color.

Instead, I got: I have not figured out the correct way to accomplish this task.

#494275

As far I understand your Goal, you want to display something conditionally to a value coming from a Select field.

This can be done with HTML conditional, where you wrap your Content To Be Displayed in HTML classes, that apply conditionally, related to the value from your Custom Field.
You then apply the colours by CSS to your HTML Classes.

This is elaborated here:
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/

An example can be:

[wpv-conditional if="( $(wpcf-select-field) eq '1' )"]<div class="green">content here</div>[/wpv-conditional]
[wpv-conditional if="( $(wpcf-select-field) eq '2' )"]<div class="red">content here</div>[/wpv-conditional]

And then you apply some CSS to the HTML class "red/green".

The forum ‘Types Community Support’ is closed to new topics and replies.