Home › Forums › Calendar Products › Events Calendar PRO › Display Additional Field in Event List Widget
- This topic has 7 replies, 2 voices, and was last updated 9 years, 7 months ago by Casey.
-
AuthorPosts
-
June 28, 2014 at 8:21 am #257608gosproutParticipant
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,
JenJune 30, 2014 at 6:03 am #262006CaseyParticipantJen,
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-
June 30, 2014 at 9:00 am #262285gosproutParticipantHi 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,
JenJune 30, 2014 at 7:41 pm #263142CaseyParticipantgosprout,
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-
July 1, 2014 at 10:10 am #264805gosproutParticipantHi 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,
JenJuly 1, 2014 at 11:58 am #265075CaseyParticipantJen,
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:- tribe_get_event_website_url( $event ) – Gets only the URL of the website field
- tribe_get_event_website_link( $event, ‘Link’ ) – Displays the Website URL as a link with a label that you specify
Give one of those a try and let me know if that does the trick. Thanks! π
-Casey-
July 20, 2014 at 9:05 pm #466431CaseyParticipantI 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-
August 14, 2014 at 8:13 am #666419CaseyParticipantSince 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-
-
AuthorPosts
- The topic ‘Display Additional Field in Event List Widget’ is closed to new replies.