How add additional fields in event-list-widget

Home Forums Calendar Products Events Calendar PRO How add additional fields in event-list-widget

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1328030
    Rainer Klar
    Participant

    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-cer

    #1328704
    Cliff
    Member

    Hi, 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.

    #1328713
    Rainer Klar
    Participant

    Hi 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 for

    Geistige und körperliche Entschlackung
    14. Oktober, 09:30 bis 18:30

    I 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
    #1330345
    Cliff
    Member

    If 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.

    #1330397
    Rainer Klar
    Participant

    Hi 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,
    Rainer

    #1330516
    Cliff
    Member

    They 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.

    #1331370
    Rainer Klar
    Participant

    Hi 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
    #1331944
    Cliff
    Member

    I 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.

    #1341865
    Support Droid
    Keymaster

    Hey 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

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘How add additional fields in event-list-widget’ is closed to new replies.