Skip Navigation

[Resolved] Sortable table list view with data from the Events Calendar post types

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 3 replies, has 2 voices.

Last updated by Beda 7 years, 6 months ago.

Assisted by: Beda.

Author
Posts
#451387

I am trying to: Create a sortable table list with data output taken from the Events Calendar events, organizer and venue custom post types. I asked a question in their forum and got an interesting answer. Find my support topic here: hidden link

Now I'm trying to figure out how I can use their functions in the WordPress backend with views to output the right data into the columns of the sortable table list I'm creating. Is it possible without editing the php code templates. And can I, as I hope, do it in an much more convenient way using the power of the views plugin? Can I for example add tribe_get_start_date into a views shortcode or something to get it printed out in my table list view on the front end? If so, then how?

Thank you in advance for helping me out! Toolset rocks.

#451722

1. You can use their functions to as example create some Custom ShortCodes, that you can then use in the View's Loop or any Content Template to output those values.

2. You can activate the Hidden Fields you mention in their Forum under Toolset > Settings > Front-End-Content > Hidden custom fields

==> Those would then appear in the Query Settings of the View as well as in the "Fields and Views ShortCodes" GUI in the section "Post field".

==> If you then insert those Fields (it will be a ShortCode generated by Views) it will display what those fields hold as value.

==> BUT it will not convert those fields or somehow allow manipulation of those values, it is just "what we get from the database, we display"

This are the possibilites I see you can approach.

#453088

Thanks a lot Beda. That's a great answer,
I will have to go with alternative the 1:st then. I've already tried the 2:nd alternative and it didn't work for me because the output is not formatted the way I need it to be. As far as I know it's not possible to customize the output with that alternative, just display the preformated content of that field. Please correct me if I'm wrong.

To go with alternative 1 I still need to figure out how to format the output to make it work. So my next question is how then do I format the shortcode to output the right values?

I've found this old topic that got me started: https://toolset.com/forums/topic/create-shortcode-to-display-event-date-tribe-event-plugin/ and it got me almost there.

I followed along with it and changed it slightly using the parameter from the Events Calendars functions reference.
hidden link
This is what it looks like (but it doesn't work):

add_shortcode('start-date', 'start_date_shortcode');
function start_date_shortcode() {
return tribe_get_start_date($date_format = ’j F ’);
}

All I'm able to show is the standard output using the exact code from the old topic. But I want to show an output customized by for example the php date parameters hidden link. What am I doing wrong?

#453305

1. Yes, when you use the "Posts Fields" option, we can not do great formatting on the ShortCode itself, as we never know what comes from the Database.

As example, complex Checkboxes or other complex Fields can then present very unexpected output

2. This question should be directed to the makers of the Event Tribe Plugin, we can not assist Custom Code based on 3rd party API's.

As far I see their DOC says "$date_format" is the parameter that will allow you to output different Date Formats:
"Allows date and time formatting using standard PHP syntax"
hidden link

Just an example from the PHP DOC:

// Prints something like: Monday 8th of August 2005 03:12:46 PM
echo date('l jS \of F Y h:i:s A');

If these formats do not work it's not Toolset's "fault" as Toolset simply prints what your ShortCode returns.

And the Shortcode, in your case, returns what their Function is supposed to pass.

You could check this even without Toolset, and see how and what formats work, and then report this to the makers of that Plugin, maybe they have some restrictions on formats

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