Home › Forums › Calendar Products › Events Calendar PRO › overriding public/template-tags/general.php
- This topic has 6 replies, 3 voices, and was last updated 12 years, 5 months ago by
Barry.
-
AuthorPosts
-
November 12, 2013 at 4:01 pm #75944
ironandsteel
ParticipantI need to change the behavior of tribe_events_event_schedule_details() which is in the-events-calendar/public/template-tags/general.php
I know that I can override views by placing a new version in my theme’s tribe-events folder, but can I do this with the aforementioned file? If so, I must not have the folder structure right.
Since I was unable to override the file, I figured I’d intercept the call to tribe_events_event_schedule_details call with add_filter. I have done this successfully with a dummy func that just returns a string, but when I duplicate the real function, I get an error. I suspect the code relies on something that it is not finding. The error is “Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.”So- what is the right way to override this function?
November 12, 2013 at 7:37 pm #76113Barry
MemberHi ironandsteel,
It sounds like you’ve got the right idea: you should define a function or functions that do what you want and then hook them in. I’m not sure why you are ending up with an internal server error, however – are you able to inspect the error log or else can you share the code you have put in place? We’d be happy to take a quick look, though we can’t offer any guarantees since we’re in custom development territory here.
Note also (though it may not meet your needs) as of 3.2 a new filter – tribe_events_event_schedule_details_formatting – is available which can be used to customize aspects of tribe_events_event_schedule_details() function’s output without intercepting and overriding it completely.
Thanks!
November 13, 2013 at 4:01 pm #76342ironandsteel
ParticipantI’m on a shared hosting environment so I don’t think I have the level of error log that I would like.
Anyway, yes I have noticed and started to use that new formatting hook in 3.2. Works great- the default format of date @ time is not very ideal, so I am using a br tag in place of the @. Next, I need to figure out how to break up the venue address, organizer onto new lines. Also, I need to show an additional field I added for admission fee- not found that yet.November 13, 2013 at 4:46 pm #76363nakturnal
ParticipantHi there,
I’m looking to do all of this same thing – editing the venue address, organizing the date/address/etc into a list format, etc. We were able to edit everything in the last version with just the template. Is this something that has been removed?Thank you much!!
November 13, 2013 at 7:33 pm #76374nakturnal
ParticipantHello again,
After looking through the Functions page I realized we can just replace the general timestamp function with custom details we want shown. Excellent! So I figured out how to add all the functions I wanted to the list format. Thanks for the link!The only thing I would recommend is on the Functions pages is to just show an example of the function in PHP. For instance, this link: http://docs.tri.be/Events-Calendar/function-tribe_get_start_date.html
I think it should also include an example of it in PHP like so:
Cheers and thanks!
November 13, 2013 at 7:34 pm #76375nakturnal
ParticipantSorry, last comment had PHP in it. Code would look like (include php tags around it):
echo tribe_get_start_date ( $event, false, ‘g:ia’);
November 14, 2013 at 8:40 pm #76574Barry
MemberWe do plan on improving and building the documentation up, so it will hopefully continue to grow and develop over time – great to see it being used.
There’s not too much more we can do re the original issue and it sounds like you’ve broadly got the correct idea in any case so I’ll go ahead and close this thread. For any further issues or questions please don’t hesitate to create new threads as required.
Thanks!
-
AuthorPosts
- The topic ‘overriding public/template-tags/general.php’ is closed to new replies.
