Display untruncated content in mobile calendar view

Home Forums Calendar Products Events Calendar PRO Display untruncated content in mobile calendar view

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1189321
    Chris
    Participant

    In mobile view, when the event description is shown beneath the calendar I need it to show the entire content. Not a truncated version.

    This didn’t work, but it explains what I need:
    Original code:
    <div class="tribe-event-description"> [[=raw excerpt]] </div>

    What I need:
    <div class="tribe-event-description"> [[=content]] </div>

    Thank you

    #1189557
    Josh
    Participant

    Hey Chris,

    Thanks for reaching out to us!

    Before we dig further into this one, would you want this to show just for the mobile view listing of events or are you wanting it to show there as well as within the tooltips on the full version of the calendar?

    Thanks!

    #1189564
    Chris
    Participant

    Just mobile. We aren’t currently using the tooltips, but if we decide to we would want the excerpt displayed there as the event content would be too much.

    #1190285
    Josh
    Participant

    Hey Chris,

    Thanks for following up here and clarifying.

    You can accomplish this by making some adjustments to two files after moving them into your current theme following our Themer’s Guide – month > mobile.php and month > single-event.php. You can find details instructions on adding additional meta to be available in the javascript templates within that single-event.php file there.

    However, to start you would add the following to your single-event.php file there:

    
    $content = array();
    $content['content'] = $post->post_content;
    

    From there, you can run the additional information through tribe_events_template_data() function to make it available for the javascript templates.

    Finally, you can switch the “excerpt” use in the mobile.php file to be “content”.

    Let me know if this helps.

    Thanks!

    #1190420
    Chris
    Participant

    Thanks Josh, but it didn’t work. Here is what I did:

    1) Properly copied /views/month/single-event.php to my child theme (mobile.php was already there and working properly)

    2) Added the following 2 lines of code you provided to lines 29 and 30 where the rest of the post data is saved in variables:

    $day      = tribe_events_get_current_month_day();
    $event_id = "{$post->ID}-{$day['daynum']}";
    $link     = tribe_get_event_link( $post );
    $title    = get_the_title( $post );
    $content = array();
    $content['content'] = $post->post_content;

    3) Changed line 35 of mobile.php from
    <div class="tribe-event-description"> [[=raw excerpt]] </div>
    to
    <div class="tribe-event-description"> [[=content]] </div>

    Oddly, in that top codeblock, I don’t see the “excerpt” being gathered but yet it’s called.

    #1191131
    Josh
    Participant

    Hey Chris,

    Thanks for following up here.

    The tribe_events_template_data() still also needs to come into play there. Will need to do some further experimenting there to see how to fully make that available there for the templates like “excerpt” is.

    Thanks!

    #1195391
    Chris
    Participant

    Hi Josh, any luck with this one yet?

    #1196316
    Josh
    Participant

    Hey Chris,

    On the single-event.php file, at the top of the div section at the very bottom of the file, you should see something like:

    
    echo esc_attr( tribe_events_template_data( $post ) );
    

    To that, you’ll want to also pass the new “$content” variable through that function like:

    
    echo esc_attr( tribe_events_template_data( $post, $content ) );
    

    Let me know if this helps.

    Thanks!

    #1196473
    Chris
    Participant

    You are the MAN Josh! That 100% did the trick!

    Thank you, thank you, thank you.

    #1196702
    Josh
    Participant

    Hey Chris,

    No problem. Happy to help!

    I’m sorry I missed that piece the first time around.

    I’ll go ahead and close this thread for now. If you have any further questions, please don’t hesitate to open a new one.

    Thanks!

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Display untruncated content in mobile calendar view’ is closed to new replies.