Home › Forums › Calendar Products › Events Calendar PRO › Display untruncated content in mobile calendar view
- This topic has 10 replies, 3 voices, and was last updated 7 years, 5 months ago by Josh.
-
AuthorPosts
-
November 8, 2016 at 1:11 pm #1189321ChrisParticipant
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
November 9, 2016 at 5:37 am #1189557JoshParticipantHey 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!
November 9, 2016 at 5:50 am #1189564ChrisParticipantJust 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.
November 10, 2016 at 7:31 am #1190285JoshParticipantHey 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!
November 10, 2016 at 8:49 am #1190420ChrisParticipantThanks 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.
November 11, 2016 at 12:33 pm #1191131JoshParticipantHey 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!
November 21, 2016 at 9:55 am #1195391ChrisParticipantHi Josh, any luck with this one yet?
November 22, 2016 at 11:25 pm #1196316JoshParticipantHey 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!
November 23, 2016 at 7:25 am #1196473ChrisParticipantYou are the MAN Josh! That 100% did the trick!
Thank you, thank you, thank you.
November 23, 2016 at 12:34 pm #1196702JoshParticipantHey 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!
-
AuthorPosts
- The topic ‘Display untruncated content in mobile calendar view’ is closed to new replies.