extra fields for venues

Home Forums Calendar Products Events Calendar PRO extra fields for venues

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #669467
    screenrage
    Participant

    What is the best way to add custom fields to Venues? What is provided out of the box in the Pro version seems very limited and there is no custom fields option like in the events section. I need to add probably 5-6 extra fields, some being check boxes some holding values.

    thanks
    SR

    #673551
    screenrage
    Participant

    I need to add things like twitter and Facebook URLs and whether a venue has WiFi and is handicap accessible.

    Thanks

    #675245
    Brian
    Keymaster

    Hello,

    Unfortunately, there is no way within the Events Calendar to add custom fields to the Venues.

    However, it is a custom post type so you could use a plugin such as Advanced Custom Fields to add in custom fields and then use custom templates in your theme to show the custom fields you add there.

    If you need help in that direction let us know and we can give you information to get you going.

    Thanks.

    #677271
    screenrage
    Participant

    Yes please.

    I’ve seen this type of a request many times in these forums so I’m curious why no one wrote a tutorial or at least some type of a help file on how to accomplish this.

    Additionally it seems that Events Calendar Pro is not consistent in this respect; the Events part of it had custom fields functionality yet the Venues one does not. Why is that?

    thanks
    SR

    #681070
    Brian
    Keymaster

    SR,

    Here is a brief overview of a way to add custom fields to the Venue or Organizer Post Types in the Events Calendar using Advanced Custom Fields(ACF) Plugin.

    Add ACF to your site and activate the plugin.

    Click on Custom Fields in the side menu and Add New

    Since this is for Venues look for the Location Box.

    Make sure Post Type is selected in the first dropdown and set it equal to tribe_venue.

    This will now make the Custom Fields you create in this group show only on the Events Calendar Venue Edit Page.

    To create your first text field, click Add Field and fill in the information and then publish.

    There are some many different options to do in ACF so it make take you a couple tries to get all the fields as you want them, here is a link to all their documentation:

    Resources on creating groups:

    Creating a Field Group

    All the Documentation for ACF

    http://www.advancedcustomfields.com/resources

    That will create all the fields so you can enter information in the Admin.

    To display on the Front End of your site you will need to move to your theme and edit the single-venue.php found in the pro plugin. Here is out guide on making template edits:

    https://theeventscalendar.com/support/documentation/events-calendar-themers-guide/

    Once you have that file in your theme you can use ACF function to display fields where you would like them.

    The basic function is:

    $value = get_field( "text_field" );

    echo "Text:". $value;

    Here is more information on using get_field()

    get_field()

    I would recommend doing one test field and getting it created and showing on the venue edit page, then add a value to it and working on getting that value to show on the single-venue.php template. Then you should have the process down and can do the customization the way you would like.

    As for why there is no additional fields in the Settings tab I do not have an answer. I will though bring it up with the developers and see if that can be added as a feature in a future release.

    Thanks!

    #712067
    screenrage
    Participant

    Thanks Brian. I’ll give this a try and if I have any followup I’ll post them here.

    SR

    #712078
    screenrage
    Participant

    Hey Brian,
    I’m not seeing single-venue.php in any of the Events Calendar Pro plugin folder. Has that changed by any chance in the latest version (which I’m using)?

    thanks
    SR

    #714158
    screenrage
    Participant

    Ok Brian,
    I got it working but it did not like using a variable, kept returning “array” instead of what was stored in the field.

    So I used the_field(my_field) and it worked.

    Is there a reason why you recommended I use a variable and then display its value?

    thanks
    SR

    #716941
    Brian
    Keymaster

    I was just giving an example and not sure exactly how everything would be setup. So there was not a reason, but glad you were able to work it out.

    Since the issue is resolved I am going to go ahead and close this ticket. If you have a similar issue or another in the future, please do not hesitate to create a new ticket.

    Thanks!

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘extra fields for venues’ is closed to new replies.