Home › Forums › Calendar Products › Events Calendar PRO › How add additional fields in event-list-widget
- This topic has 9 replies, 2 voices, and was last updated 6 years, 8 months ago by Rainer Klar.
-
AuthorPosts
-
July 29, 2017 at 11:37 pm #1328030Rainer KlarParticipant
Hi there,
although I studied a lot of threads and tutorials, I can’t get the clou of it.
I want to display an additional field – event format – in my event-list widget.I copied already wp-content/plugins/the-events-calendar/src/views/widgets/list-widget.php to a new created directory following a tutorial:
/wp-content/themes/lifestyle-pro/tribe-events/pro/And now I don’t know how to modify the file.
Would you please show me the needed code?thank you very much in advance!
kind regards,
Dan-cerAugust 1, 2017 at 5:21 am #1328704CliffMemberHi, Rainer.
Thanks for your detailed question. It looks like you’re on the right track, although I’d make sure that you’re using a child theme to avoid losing your tribe_events directory when you do a theme update.
Could you please provide a link to an event that has this Additional Field added to it? Although we don’t help with such customizations, per our Scope of Support / Terms, it might help me advise you in this area.
August 1, 2017 at 5:50 am #1328713Rainer KlarParticipantHi Cliff,
yes of course – here is the link.On the bottom of the page above the footer you will find the Additional Field “Veranstaltungsformat
Tages-Seminar”.
On the right sidebar you will find the events-list. Look forGeistige und körperliche Entschlackung
14. Oktober, 09:30 bis 18:30I want to have “Tages-Seminar” displayed there.
- This reply was modified 6 years, 9 months ago by Rainer Klar. Reason: link wasn't displayed yet
- This reply was modified 6 years, 9 months ago by Rainer Klar. Reason: I had to find out the logic of your link-insert-formula
- This reply was modified 6 years, 9 months ago by Rainer Klar. Reason: Still struggling with link insert
August 3, 2017 at 12:46 pm #1330345CliffMemberIf I understand that page’s content correctly, you might be trying to override the wrong file.
Please try overriding /wp-content/plugins/events-calendar-pro/src/views/pro/widgets/modules/single-event.php instead
As far as how to get Additional Fields data for an event, please reference tribe_get_custom_fields()
Please let me know how this goes for you.
August 3, 2017 at 2:06 pm #1330397Rainer KlarParticipantHi Cliff,
thank you for your suggestions. I found the files, but don’t know, what exact code I should add to /wp-content/plugins/events-calendar-pro/src/views/pro/widgets/modules/single-event.php
On the page you linked is just
Function: tribe_get_custom_fields
and
array tribe_get_custom_fields ( int $postId = null )
But that doesn’t seem complete code to me.
kind regards,
RainerAugust 3, 2017 at 8:21 pm #1330516CliffMemberThey are incomplete; you need to reference those functions for what you choose as the best way to implement this customization. Referencing this snippet might be helpful to get you started.
If there’s a code snippet you’d like me to put some eyes on or something else I can help you with.
August 6, 2017 at 5:28 am #1331370Rainer KlarParticipantHi Cliff,
I tried to modify your snippet to my certain modified-field:<?php /** * for theeventscalendar/specific-additional-fields/ * */ function tribe_get_custom_fields( $data ) { $field_name = 'Veranstaltungsformat'; array( $data ) } add_filter( 'tribe_get_custom_fields' );
Is that correct? I have no idea about setting ‘array’, I just copy any codes given to me. In this case the field-name is ‘Veranstaltungsformat’. This field should be displayed in the calendar-widgets.
- This reply was modified 6 years, 9 months ago by Rainer Klar. Reason: deleting double code
August 7, 2017 at 10:46 pm #1331944CliffMemberI really appreciate your effort, but I can tell the code is malformed.
Additionally, there’s a bit more you’d need to do to accomplish what you’re wanting (e.g. targeting just a specific widget’s output).
You may want to ask your developer or reference our documentation and list of known customizers.
August 29, 2017 at 9:36 am #1341865Support DroidKeymasterHey 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 -
AuthorPosts
- The topic ‘How add additional fields in event-list-widget’ is closed to new replies.