Home › Forums › Calendar Products › Events Calendar PRO › Add View to View As
- This topic has 7 replies, 3 voices, and was last updated 8 years, 10 months ago by
Joseph Coppola.
-
AuthorPosts
-
May 11, 2017 at 10:43 am #1282455
Joseph Coppola
ParticipantI created another view for the Events, however its a table on a page that pulls the data from Events Calendar pro. How can I add a link to the page in the View As list?
May 11, 2017 at 8:10 pm #1282750Cliff
MemberHi. I’m always glad to hear about user customizations like this!
I believe you’d use the tribe-events-bar-views filter, like is done in this file to add Map View to the Tribe Bar’s list of views: /wp-content/plugins/events-calendar-pro/src/Tribe/Geo_Loc.php
Please let me know how this goes for you.
May 12, 2017 at 6:49 am #1282924Joseph Coppola
ParticipantThis really isn’t much of a help. What files am I supposed to edit? Where am I supposed to edit them? What code do I need to add?
Please help.
Joe
May 12, 2017 at 2:48 pm #1283301Cliff
MemberI appreciate your question and the desire to customize it for your use. However, we cannot provide such in-depth customization help, per our Scope of Support / Terms.
Since you said you already created another view, I assumed you had a template file you wanted to load at a specified URL. The suggestion I shared was how to add the link to the Tribe Bar’s view switcher.
You’ll need to know WordPress coding basics to leverage the filter I suggested. Additional coding might also be needed to accomplish your customization.
If you need some coding help, you may want to ask your developer or reference our documentation and list of known customizers.
May 13, 2017 at 8:45 am #1283440Joseph Coppola
ParticipantYou actually did not answer anything. You mention this.
“tribe-events-bar-views filter”
Without any reference of where to find it, what PHP page its on, nothing.
Also coding help is provided via this forum there are several articles written about stuff like this.
Joe
May 15, 2017 at 8:53 am #1283937Barry
MemberHi Joe,
Thanks for your patience – it sounds like an interesting piece of work that you’re building 🙂
Also coding help is provided via this forum there are several articles written about stuff like this.
We do indeed have a bunch of knowledgebase articles that aim to steer folks in the right direction for any custom dev or theming work they might like to undertake and occasionally we do also go into more depth on the forums.
In general, though, if you need to build something like you have described, it’s up to you to figure out a way. We can try and guide you – as Cliff has already done – but ultimately there may be gaps you need to fill in yourself. If you’re not familiar with WordPress development, that may entail seeking help from others who are at home with this sort of work.
You actually did not answer anything. You mention this
“tribe-events-bar-views filter”
Without any reference of where to find it, what PHP page its on, nothing.
Well, Cliff did already provide a reference to a place in the source code where this hook is used:
wp-content/plugins/events-calendar-pro/src/Tribe/Geo_Loc.php
That’s a really great example of adding a view. To provide some further detail: often, this hook is triggered when the tribe_events_get_views() function is called – for example, you can see a call to this function from within the modules/bar.php template (see here for details about our templates and overriding them).
Within the above file (Geo_Loc.php) noted by Cliff, you can see how we take advantage of this ourselves:
- In the constructor (around line 96) we use the add_filter() function with this hook
- Further down, in the setup_view_for_bar() method (around line 225), you can see how we actually register the view
I hope that helps. In terms of where you should put your own code, that’s more of a general WP development question, but there are a number of different approaches:
I do not advise trying to modify core plugin code, though, as your changes will inevitably be lost next time you update (besides potentially making it harder for us to support you).
I hope that helps and good luck with the project!
June 6, 2017 at 9:36 am #1293824Support Droid
KeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘Add View to View As’ is closed to new replies.
