Display Additional Field in Event List Widget

Home Forums Calendar Products Events Calendar PRO Display Additional Field in Event List Widget

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #257608
    gosprout
    Participant

    Hi,

    I have added a custom additional field called “Link”. How do I enable it so that it displays in the Event List Widget? (What would the line of code be and which files would I add it to?)

    Thanks,
    Jen

    #262006
    Casey
    Participant

    Jen,
    Thanks for getting in touch! You should be able to perform a template override (take a look at our themer’s guide to learn how to do this) on ‘events-calendar-pro/views/pro/widgets/list-widget.php’ and use the ‘tribe_get_custom_field()‘ function to display your custom field.

    Here’s an example of how to use that function:


    echo tribe_get_custom_field( 'YOUR_FIELD_NAME' );

    Hopefully that points you in the right direction, but let me know if you have further questions. Thanks! πŸ™‚

    -Casey-

    #262285
    gosprout
    Participant

    Hi Casey,
    Thanks for the start… However, it didn’t work… I followed the themer’s guide, copied list-widget.php over to a tribe-events folder in my theme folder and added the following code at the end of the get-zip, get-organizer, get-phone, etc.:

    [code][/code]<?php if ( $link && tribe_get_custom_field( ‘Link’ ) != ” ) { ?>
    <span class=”Link”><?php echo tribe_get_custom_field( ‘Link’ ); ?></span>
    <?php } ?>[code][/code]

    But when I refresh my Widgets page, this Link option does not show up in the list of checkboxes.

    Thanks,
    Jen

    #263142
    Casey
    Participant

    gosprout,
    You’ll need to copy over the file to ‘YOUR_THEME_DIR/tribe-events/pro/widgets/list-widget.php.’ Give that a shot and let me know if you’re seeing your overrides after that. Thanks! πŸ™‚

    -Casey-

    #264805
    gosprout
    Participant

    Hi Casey,
    Updated the folder structure, but still no luck on getting it to show up on the widget.
    On a second note, I just realized there’s already a field for Event Website by default on the Edit Event page…can I just get that to show up on the list-widget.php? Really, that’s all I’m trying to do – my client simply wants title, date (no time), and the link to the external event website…

    Thanks,
    Jen

    #265075
    Casey
    Participant

    Jen,
    I’m not sure why that’s not working, but if you just want to display the Event Website, then take a look at the following functions:

    Give one of those a try and let me know if that does the trick. Thanks! πŸ™‚

    -Casey-

    #466431
    Casey
    Participant

    I just wanted to follow up and see if you’re all set here or if you still have further questions. Just let me know if you have further questions or if I should go ahead and close out this thread. Thanks! πŸ™‚

    -Casey-

    #666419
    Casey
    Participant

    Since I haven’t heard back from you here, I’m going to go ahead and close out this thread. Feel free to start a new thread if you have further issues. Thanks! πŸ™‚

    -Casey-

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Display Additional Field in Event List Widget’ is closed to new replies.