Event Fields - Which Are Available for Use in Templates?

The event details (Eab_Template::get_event_details($post)) contains a number of different elements that I'd like to have broken apart.

That is, I'd like to have the Venue and Edit Event but separated so I can display them where I'd like.

Is there a list of Event fields that I can use in my templates?

For instance, I managed to display Event Categories (with links to Events list for Category) and Groups (with links to Group Events) using the following:

<!--Display Categories-->
<?php
  $categories = get_terms('eab_events_category');
  $output_categories = array();
  foreach ($categories as $category):
	  echo '<a>slug . '">' . $category->name . '</a> ';
  endforeach;
?>
<!--Display Groups-->
<?php
	global $post;
	$group_id = get_post_meta($post->ID, 'eab_event-bp-group_event', true);
	if ($group_id) {
		$group = groups_get_group(array('group_id' => $group_id));
		if ($group) echo '<a>groups->slug . '/' . $group->slug . '/group-events/">' . $group->name . '</a>';
	}
?>

It would be very helpful to have the available fields documented so that we can easily find the.

  • aecnu

    Greetings misfist,

    Thank you for this great question and a significant item to bring up.

    That is, I'd like to have the Venue and Edit Event but separated so I can display them where I'd like.

    This is clearly not the intended use of the plugin.

    Is there a list of Event fields that I can use in my templates?

    Not that I am aware of, but of course we can see is the lead developer can shed any light here.

    Therefore I will see if I can get the lead developer in here with his invaluable insight into this plugin for his advice/advise for us.

    Though this may take a bit longer then a normal ticket, I will try to get him in here asap.

    Cheers, Joe

  • aecnu

    Greetings misfist,

    Thank you for your additional input and feedback, it is appreciated.

    I don't understand why the intended use of the plug-in would require having the event information displayed in a certain way.

    Anything outside of the out of the box working of the plugin to include display either falls under the category of custom coding or out of the box unintended use.

    The support we provide here is how to use the current features of our products and bug fixing, teaching someone to code PHP is a bit beyond that scope. - WPMU Dev Lead Developer Reference: The support we provide here is how to use the current features of our products and bug fixing, teaching someone to code PHP is a bit beyond that scope.

    And further clarified from my direct inline Boss:
    https://premium.wpmudev.org/forums/topic/gravity-forms-and-marketpress#post-243682

    These are the guidelines in which I am subject to working within if we like it or not with limited discretion.

    I admit I indeed used that discretion to try to help you as indicated above by asking the lead developer to come in here and offer his input into this ticket rather then impose the more strict guidelines of "out of the box" to this issue and your questions, and that decision still stands as you and I await the lead developer to come in here and offer his input.

    Why aren't they individual fields in the template by default?

    This is indeed another great question in which I hope we will get an answer to with the participation of the lead developer.

    Thank you for being a WPMU Dev Community Member!

    I hope that the lead developer makes an appearance in here sooner then later with his invaluable advice.

    Sincerely, Joe

  • Vladislav

    Hello,

    I see your point - in fact, as you probably noticed, the Events templating class depends on Events model classes for most of the data bits related to a particular event (including, but not limited to, event title, start/end times, event, etc). The model class (actually, a set of classes) is located in lib/class_eab_event_model.php, and documented there. To make use of it, just convert the $post global to an Eab_EventModel instance, like so:

    global $post;
    $event = ($post instanceof Eab_EventModel) ? $post : new Eab_EventModel($post);

    After this, you can use all the model convenience methods, e.g.:

    if ($event->has_venue_map()) echo $event->get_venue_location(Eab_EventModel::VENUE_AS_MAP, array('width' => '99%'));
    // ...
    $event->get_rsvps();
    // ..
    echo date(get_option("date_format"), $event->get_start_timestamp());
    echo date(get_option("time_format"), $event->get_start_timestamp());

    Etc.
    `

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.