Events Made Easy › Forums › Bug fixed or feature request implemented › Using shortcode in Event Details = not working
Tagged: shortcodes in details/notes
- This topic has 6 replies, 2 voices, and was last updated 13 years, 10 months ago by Anonymous.
-
AuthorPosts
-
Thu 27 Jan 2011 at 16:32 #42483AnonymousInactive
I’m putting a shortcode in the event details to pull a post with relevant information. That works beautifully.
But, then I tried to add the <!–more–> tag so that I could just see an excerpt in the event list, instead of the whole long post.
It wasn’t working, so I did a little debugging. In events_manager.php, it gets to line 930, so it is seeing the #_EXCERPT placeholder., but when it searches for <!–more–>, it’s just searching the shortcode itself instead of the actual content of the post.
I believe with a regular post, I’d apply a filter to the_content to get it to interpret the shortcode first.
But I’m not that familiar with filters and eme is not actually getting the_content, so I’m not quite sure where to go with this. I see in eme_events.php, line 1210 is where $events gets all cleaned up, so I thought I’d try to do something there, but I’m not exactly sure what to do to get it to interpret shortcodes in the notes/details field.
Thu 27 Jan 2011 at 16:44 #46548FrankyKeymasterThe
<!--more-->
can only be in the event notes, nowhere else. And the event notes is a text field where you should type in normal info.Thu 27 Jan 2011 at 17:00 #46549AnonymousInactiveWell, the <!–more–> is in the post, and the shortcode to get the post is in event notes. And the shortcode works – it pulls the post in. EME just doesn’t filter the shortcodes before looking for <!–more–>
For now, I just put a link to the post. Hopefully, they’ll click the link in the notes instead of the Event link – which would take them to the single event page and THEN they’d have to click the link to get to the information.
I just thought that since shortcodes in notes worked and <!–more–> in notes worked, that for consistency’s sake – and a nice feature – they should work together.
Hmmm, maybe I’ll make a new shortcode that just pulls the excerpt into the notes – that might work.
Thu 27 Jan 2011 at 18:51 #46550FrankyKeymasterO, I see what you mean: the more-tag of a regular post and some kind of shortcode to get the content of a post in a page … sjeez, never done that before. Why don’t you use the event notes to give the information? Anyway, you can leave out the event link in your formatting …
Thu 27 Jan 2011 at 22:35 #46551AnonymousInactiveSorry I didn’t explain fully. BTW – finding where I’d need to add the code if I was going to modify the plugin, was really easy – very nice coding work – and great product.
Here’s the deal and why I’m trying to do it the way I’m doing it. It’s a little dinner theater with acting students giving the performance. They post a notice, like: Bios and Headshots due on Jan 30th. But there are about 2 pages of information and examples about how to create bios and the formats needed for headshots – so a lot of info to put in for an event and we will probably use the same info for the next theater production. So when I put the deadline on the calendar, it would be nice if people could see the info, without me having to copy and paste and then worry about updating it in two places.
Like I said, the shortcode to do this works great. But 2 pages of info in the middle of the events list is a bit confusing – and I need to keep the event links for the other events – rehearsals and performances.
Thanks for your responses. I appreciate it.
Thu 27 Jan 2011 at 22:47 #46552FrankyKeymasterIn your case, probably changing line 935 in events-manager.php
$replacement = $event[$field];
to
$replacement = do_shortcode($event[$field]);
should do it, no? I don’t see the harm of adding this for everybody …
Fri 28 Jan 2011 at 04:30 #46553AnonymousInactiveThanks, I’ll try that and see how that works out.
-
AuthorPosts
- The forum ‘Bug fixed or feature request implemented’ is closed to new topics and replies.