Calendar Format for Monthly Menu Plan

Home Forums Calendar Products Events Calendar PRO Calendar Format for Monthly Menu Plan

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1329611
    Anthony Hunter
    Participant

    Hi,

    I have the same need as the person who posted the following forum request a few months back for a Monthly Menu Calendar.

    Special formatting for monthly menu plan.

    “how can I make it so the entire food list as it is entered into the event description shows in the calendar day box in the month view?”

    I would prefer if the link to the event is not clickable if possible.

    Thanks in advance!!

    #1330521
    Jennifer
    Keymaster

    Hi Anthony,

    Thanks for reaching out! I think the easiest way to do this would be to assign a specific category, such as “food”, to these events. From there, you could customize the plugin to get this type of calendar. We are currently not able to do customizations, but I wrote up a quick example for you to get you started…

    The idea is to modify the main events query to exclude this category, and then use a shortcode on another page to display only the “food” events. Keep in mind though that shortcodes use the same view templates as the default calendar. So, a possible solution would be to modify the template (by following these instructions) that outputs the info for each event onto the month view – you could add in a condition to check if the event has the category “food”, and if so, display the description underneath it. That template can be found at wp-content/plugins/the-events-calendar/src/views/month/single-event.php. You could replace this code that is currently in the template:

    with the following:

    ID );
    $description = get_the_content();
    $title = ( $food ) ? $title : '' . $title . '';
    ?>

    Then, you can add this to your functions.php file in your child theme to exclude these events from the main calendar:

    add_action( 'pre_get_posts', 'tribe_exclude_events_category' );
    function tribe_exclude_events_category( $query ) {

    if ( ! is_singular( 'tribe_events' ) ) {

    if ( ! is_tax( Tribe__Events__Main::TAXONOMY ) && empty( $query->query_vars['suppress_filters'] ) ) {
    $query->set( 'tax_query', array(

    array(
    'taxonomy' => Tribe__Events__Main::TAXONOMY,
    'field' => 'slug',
    'terms' => array( 'food' ),
    'operator' => 'NOT IN'
    )
    ) );
    }
    }
    return $query;
    }

    You can then use this shortcode on the page you’d like to display the calendar on: [tribe_events view=”month” category=”food”]

    Finally, if you’d like to also remove the tooltip from the food calendar, you can add this to the Additional CSS area under Appearance > Customize or to your style.css file in your child theme:

    .tribe-events-category-food .tribe-events-tooltip {
    display: none !important;
    }

    Please note that this is just a starting point, and you may want to add some additional styling. Also, this example uses the category slug “food”. So, you’ll need to create an event category with the slug “food” or change the slug in the above example to match the slug for the category you’d like to use.

    I hope it helps! Please let me know if you have any questions.

    Thanks,

    Jennifer

    #1340356
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Calendar Format for Monthly Menu Plan’ is closed to new replies.