Home › Forums › Calendar Products › Events Calendar PRO › Custom Page Template
- This topic has 11 replies, 4 voices, and was last updated 9 years, 10 months ago by
Michael.
-
AuthorPosts
-
June 23, 2016 at 9:20 am #1130963
Michael
ParticipantI have a custom page template that I want to use for the events page. It incorporates ACF (Advanced Custom Fields) content that is to show up above the calendar. Currently this page only shows the calendar, the ACF is edited out. When I remove Events Calendar Pro then the ACF fields show up properly.
Currently I also have this message in my Edit Page view:
The page “Experience” uses the “/experience” slug: the Events Calendar plugin will show its calendar in place of the page. Edit the page slug or edit Events settings.So I guess I need to know how I can use a page that I have created, that includes additional non Events Calendar content and non standard WordPress loop content as the template.
Thanks.
June 23, 2016 at 4:32 pm #1131260Geoff
MemberHey Michael and welcome to the forums!
I think the best route is to start with one of our templates, duplicate it, then override it in the theme directory using the process outlined here in our Themer’s Guide.
Alternatively, you could construct a custom query of events in any theme template, either using tribe_get_events() as the basis of the query, or the default WordPress get_posts() function in which you would make a called for the tribe_events post type.
Does this make sense and will it work for you? Please let me know. 🙂
Cheers!
GeoffJune 24, 2016 at 10:19 am #1131606Michael
ParticipantHmmm, ya I’v gone over the Themer’s guide quite a bit. But I can’t seem to find what I need.
How do I get my custom fields to show up in the ECP template and how do I then get those fields that need to have content added to them by the client show up in the content area of wordpress or in the content area of the plugin admin. NOTE: this isn’t event related content. This is content that is to sit above the calendar.
I have the custom content working on a wordpress page so I know if is working properly but don’t know how I’m supposed to integrate with the plugin.
Would prefer not to go the second route but it may be my only option I guess. Although that sounds like it would create page slug and hierarchal issues.
Thank you for your help.
-
This reply was modified 9 years, 11 months ago by
Michael.
June 24, 2016 at 10:30 am #1131612Geoff
MemberHey Michael,
Thanks for for following up!
How do I get my custom fields to show up in the ECP template
To get the content from an ACF field, you can use the ACF documentation examples as a starting point.
and how do I then get those fields that need to have content added to them by the client show up in the content area of wordpress or in the content area of the plugin admin.
I’m afraid that’s not quite how ACF works and instead it allows you to add custom fields to the content editor rather than to the front end of the website itself.
It’s worth noting that if you are attempting to create custom fields for events and allow visitors to submit events to your calendar with those custom fields included, then our Community Events add-on does that and will work with Event Calendar PRO’s additional fields feature, allowing you to create custom form fields for event submissions.
Then again, perhaps I’m completely missing what you’re going for here, in which case you could help clarify and I’d be happy to keep checking into this with you.
Thanks!
GeoffJune 27, 2016 at 3:44 pm #1132640Michael
ParticipantYa. ok, thanks for your help. Let me re-iterate a few points though for clarity.
I’m using ACF pretty extensively throughout the site without issue and understand that the fields are visible in the content editor and not the front end of the site itself – by client I mean the owner of the site who will be adding/editing/deleting content that visitors to the site will see.
With the default template for ECP I have added: <?php the_field(‘tagline’, 12); ?> for testing and it correctly renders the tagline from post 12 in the right place on the front end. But when I insert an ACF repeater it renders nothing. Here’s the repeater code I am using:
<!– GET REPEATER –>
<?php if( have_rows(‘explore-activity’, 197) ): ?>
<?php while( have_rows(‘explore-activity’, 197) ): the_row(); ?>
<!– START DESTINATION –>
<div class=”col-sm-6 col-md-3″>
<div class=”if_poi”>
” />
<?php the_sub_field(‘activ_title’); ?>
<?php the_sub_field(‘activ_copy’); ?><
</div>
</div>
<!– END DESTINATION –>
<?php endwhile; ?>
<?php endif; ?>
<!– /GET REPEATER –>All it renders is:
<!– GET REPEATER –>
<!– /GET REPEATER –>So the php is being ignored or discarded.
NOTE: This repeater renders correctly outside of the ECP template in a regular WP page template.
I was hoping to have the repeater fields render in the template and have the editing of those fields happen somewhere inside the ECP admin section – right now I’m calling the fields from another post only because it seems you can’t do it any other way.
Appreciate your help on this.
June 28, 2016 at 7:36 am #1132864Geoff
MemberHey Michael,
It could be the content editor in the forums here, but there seemed to be some stray missing characters in the code you provided. Does this work instead:
<!-- GET REPEATER --> <?php if( have_rows('explore-activity', 197) ): ?> <?php while( have_rows('explore-activity', 197) ): the_row(); ?> <!-- START DESTINATION --> <div class="col-sm-6 col-md-3"> <div class="if_poi"> <?php the_sub_field(‘activ_title’); ?> <?php the_sub_field(‘activ_copy’); ?> </div> </div> <!-- END DESTINATION --> <?php endwhile; ?> <?php endif; ?> <!-- /GET REPEATER -->Also, just out of curiosity, is it only ACF repeater fields that are not showing up in the templates, or is it any type of ACF field?
Thanks!
GeoffJune 29, 2016 at 1:53 pm #1133707Michael
ParticipantHey,
Yes that looks better, did you use
to wrap it?
That code is the code that is not working. It seems to be omitted as I only get the wrapping
<!– GET REPEATER –>
<!– /GET REPEATER –>
and nothing in between.
And yes it seems the repeater is the only field not working, other ACF fields are working.
If I call<p><?php the_field('tagline', 12); ?></p>the proper field is returned.
Thanks.
June 30, 2016 at 7:35 am #1133945Geoff
MemberHey Michael,
Interesting that it would would for regular fields but not repeating ones. The repeating fields is a ACF premium feature, right? If so, do you have the latest version of it installed? I wonder if it works in past versions.
As a note, we aren’t always able to resolve conflicts with other plugins. If it turns out out to be that the two plugins are incompatible, then it would be worth adding this to our feature request forum and perhaps reaching out to the ACF team to let them know as well.
Thanks!
GeoffJuly 5, 2016 at 8:57 am #1135482Michael
ParticipantHi,
Hmmm, yes it’s the latest version of the plugin but not a premium feature.
A bit disappointing that it doesn’t work. I guess maybe my feature request would be that I could incorporate ECP into a wordpress page template (where the php executes perfectly) rather than have to try to make things work in a ECP page template where it doesn’t – I didn’t see anything in the documentation for that, maybe I missed something. In spite of my investment in time and money it looks like I may need to source a new/different solution.
July 5, 2016 at 9:59 am #1135583Geoff
MemberHi Michael,
I was able to find the repeater fields premium plugin here and see it is also a premium feature in ACF Pro. I snagged a copy to test this further.
I was able to add this to my single-event.php template and the repeater fields displayed correctly:
<?php if( have_rows('testing') ): ?> <ul> <?php while( have_rows('testing') ): the_row(); ?> <li><?php the_sub_field('testing_1'); ?></li> <?php endwhile; ?> </ul> <?php endif; ?>…where “testing” is the field group and “testing_1” is a subfield in the group. Here’s a screenshot of the field in the event editor and another screenshot of the event when published.
Will you please check your code once again to make sure the field labels are correct? If there’s still no luck there, then it might be worth testing for conflicts (steps here) with the theme or perhaps another installed plugin.
Cheers and hope you had a great weekend!
Geoff
July 20, 2016 at 9:35 am #1141951Support Droid
KeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
This reply was modified 9 years, 11 months ago by
-
AuthorPosts
- The topic ‘Custom Page Template’ is closed to new replies.
