MEC Location Name

Hi,

I’ve been through several forum threads about getting Modern Events Calendar data through dynamic conent, loopers and consumers and I can’t figure out how to get some MEC data:

How to access ALL data from Locations, Additional Locations, Organiser, Additional Organisers, Speakers and Sponsors? For instance, location address can be accessed through term meta indicating the therm ID. But not the name.

They’re all custom taxonomies, but they don’t appear as options on Curren Post Terms Provider Type. Is there any way to generate a custom provider type or something to loop through all data?

Being a bundled plugin, it would be great to have at least some kind of cheatsheet of how to access all plugin generated data.

Thank you.

Hi @Cesc,

Thanks for reaching out.
I would suggest you try to use the All Terms and check if that taxonomies are appearing or not. And also request you use the Query String option with the tax query to get the data. Please go through the following thread which may help you with this.


Thanks

Hi @tristup,

thank you for your answer. I’m afraid it doesn’t get to the solution, though.

The “All Terms” provider type does not present these ‘Modern Events Calendar’ custom taxonomies either.

Just to clarify, I’m not trying to loop MEC events with a specific location or organiser.

What i need is to find out how to access all the mec events data through dynamic content once I’ve set up a looper, in order to design any events list or slider I want, adding all the event data I need. Or even to completely design the MEC Event Single Layout using Cornerstone…

For instance, on a mec events looper you can get the ID of the event’s main location from the post meta through {{dc:post:meta key=“mec_location_id”}} . And you can get some data through dc:term:meta, as they are taxonomies, if you specify this ID, i.e the address or the url (key=“address/url”). But how you get the location NAME? {{dc:term:meta term="/mec-location specific ID/" key=“name”}} does not work. And how could you get it without having to specify the ID. A nested looper?

What about Additional Locations? What about Organisers, Speakers and Sponsors data?

This is the help I would need.

I know MEC is not WooCommerce and obviously Cornerstone does not have the same integration level for this plugin. But as it’s bundled with X and PRO, it would be nice to at least have some guidelines on how to access all the plugin generated data in the documentation.

Thank you very much.

Hey @cesc,

We did not intend MEC to be customized in anyway including the Layout Builder and bundled plugins are provided as-is. That means they are provided to offer more functionality to our users websites.

I’ll post this case in our tracker as a feature request. If there is enough interest, maybe our development team will provide integration like WooCommerce.

Thank you for understanding.

Hi, @christian

Thank you! I understand perfectly what bundled extensions are meant for. Needless to say, the quantity and quality of the bundled extensions are great!

Of course, not everything that exists has to be fully integrated. It would be impossible, anyway.

It’s just that on the one hand, a lot of plugins such as Modern Events Calendar have some ‘basic’ integration with page builders such as elementor, divi, etc. Just some sort of “placing blocks the way you want on the layout” and then apply CSS. It’s not great, it doesn’t cover everything, but it gives you some customization possibilities. It’s an easy starting point . Even if it’s just to custom layout the single posts.

And then, being PRO and Cornerstone as powerful as they are, it’s just frustrating that with a bundled plugin you cannot simply and easily access all the plugin generated data with the standard builder tools. At least to style its single layout or to pull out a simple looper for a list of events including the data you want. Nothing too fancy. The integration level of WooCommerce or ACF would be great, of course. But, you know.

Anyway. Sorry for complaining :sweat_smile:

It simply would be nice to have some kind of basic integration, and It’ll be great if the developer team can consider it.

Thanks again, to all the support team, for being there.

Glad to hear that, @cesc.

Just in case anyone is interested in having somewhere to start.

Put this to child theme’s functions.php, code snippets or similar:

function get_mec_location_data_for_shortcode($atts) {
    $atts = shortcode_atts(array(
        'query' => '',
        'field' => ''
    ), $atts);

    $term_id = $atts['query'];
    $field = $atts['field'];

    if (empty($term_id)) {
        return 'location id must be specified';
    }

    if (empty($field)) {
        return 'Choose field to show (name, address, url...)';
    }

    $value = '';

    if ($field === 'name') {
        $location = get_term($term_id);
        if ($location) {
            $value = $location->name;
        }
    } else {
        $value = get_term_meta($term_id, $field, true);
    }

    return $value;
}
add_shortcode('mec_location_data', 'get_mec_location_data_for_shortcode');

Then use the shortcode to output location data. For instance, inside a mec events looper:

[mec_location_data query="{{dc:post:meta key="mec_location_id"}}" field="name"]

Salut!

Hello @cesc,

Thanks for sharing to information.

Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.