Use Additional Field to Display Event Icon

Home Forums Calendar Products Events Calendar PRO Use Additional Field to Display Event Icon

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #945969
    David Ruszkowski
    Participant

    Hello, forgive me if this has been asked before, but what I have is an additional field with the selections “Open (spots still available)” or “Closed (event is full)”. I have created a couple of icons depicting the status. What I want to do is show an “open” icon if the event is open and “closed” if it is closed.

    On a normal post I would think I could do this by just calling custom field values in my page template. I’m curious how I can call these additional fields in the single event template.

    Thanks so much.

    #946052
    Brian
    Member

    Hi,

    Thanks for using our plugins.

    I can help point you in the right direction on this.

    You can follow our themer’s guide:

    https://theeventscalendar.com/knowledgebase/themers-guide/

    That will show you how to edit the single event template with custom coding in your theme.

    Let me know if that helps.

    Thanks

    #946064
    David Ruszkowski
    Participant

    OK so I found this script for calling the regular fields in a template…

    <p>Organized by: <?php echo tribe_get_organizer(); ?></p>

    That works fine, but when I try and substitute “organizer” with the name of my additional field it breaks the layout. Now my question, how would the plugin define the slug for my additional field? The field name is “Hunt Status”.

    Also I am guessing there will be a different way to set up this code, kind of like the difference between…

    <?php include 'header.php';?> AND <?php get_header(); ?>

    Hopefully that makes sense.

    Thanks,
    Dave

    #946127
    Brian
    Member

    Are you using the Events Calendar Pro’s additional fields? or Another Plugin or coding to create them?

    For ours you can use this coding to display the fields:

    https://gist.github.com/jesseeproductions/3ba8c5679e188946988e

    Replace ‘Community Field’ with the name of your field.

    Does that work?

    #946128
    David Ruszkowski
    Participant

    OK I have made a little progress on this, however I still can’t seem to get it to work.

    I found some code for showing additional fields in modules/meta/additional-fields.php.

    Here is what I have now in single-event.php…

    <div class="tribe-events-single-event-description tribe-events-content entry-content description">
    <?php _e( 'STATUS:', 'tribe-events-calendar-pro' ) ?><?php foreach ( $fields as $name => $value ): ?><?php echo $value ?>
    <?php endforeach ?>
    <?php the_content(); ?>
    </div>

    Basically this should show all the fields but it doesn’t seem to be working.

    Any help you could offer to what I might be missing would be appreciated.

    Thanks,
    Dave

    #946129
    David Ruszkowski
    Participant

    Sorry I just saw your reply… I will try that.

    Thanks so much,
    Dave

    #946134
    David Ruszkowski
    Participant

    That seems like it will work great.
    Thanks so much,
    Dave

    #946310
    Brian
    Member

    Great, glad it helps, I am going to go ahead and close this ticket, but if you need help on this or something else please post a new ticket.

    Thanks!

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