Home › Forums › Calendar Products › Events Calendar PRO › Help Adding 'Website' field to List View
- This topic has 3 replies, 2 voices, and was last updated 10 years, 1 month ago by
Brook.
-
AuthorPosts
-
March 28, 2016 at 11:36 am #1094896
Douglas LaMunyon
ParticipantHi there,
I have read through the documentation on customizing php templates and I understand the process for this, but I’m struggling with the code a bit.Our client has requested a specific events display format for their website; what we are trying to do is simply add the website field to a prominent location on the events page within the list view.
I have located this area in modules > meta > details.php, but nothing I have tried so far is doing the trick:
<?php
// Event Website
if ( ! empty( $website ) ) : ?><dt> <?php esc_html_e( ‘BUY TICKETS NOW:’, ‘the-events-calendar’ ) ?> </dt>
<dd class=”tribe-events-event-url”> <?php echo $website; ?> </dd>
<?php endif ?>Note that I have customized the label for this field. We are currently testing things out in a development area, and I’m making all the customizations in new folder(s) we created inside the child theme.
Can you tell me:
1. which template we should be working in (list.php, list > content.php, etc.)
2. where we would add the code to the specified template
3. how the code should lookThank you so much for a great plugin, and for your help making this happen.
March 28, 2016 at 11:44 pm #1095251Brook
ParticipantHowdy dmlws,
I would love to help you with this.
If I were you I would use this code:
<?php // Event Website $website = tribe_get_event_website_url(); if ( ! empty( $website ) ) : ?> <a href="<?php echo $website; ?>">BUY TICKETS NOW</a> <?php endif ?>And I would insert it into /the-events-calendar/src/views/list/single-event.php via a theme override (Themer’s Guide). About line 50 is probably the right spot, it really depends on where you want it. But Line 50 would be pretty prominent.
Does that all make sense? Did that work for you? Please let me know.
Cheers!
– Brook
March 29, 2016 at 10:35 am #1095519Douglas LaMunyon
ParticipantBrilliant! That’s absolutely perfect. This is just exactly what I needed. Worked like a charm on the first try!
A million thanks for such a fast response as well. I greatly appreciate it.March 30, 2016 at 5:42 am #1095824Brook
ParticipantYou are super welcome! I’m happy it fit the bill so well.
Let us know if you ever need anything else.
- Brook
-
AuthorPosts
- The topic ‘Help Adding 'Website' field to List View’ is closed to new replies.
