I am trying to override how the categories are display in Timely’s All-In-One-Event-Calendar. This calendar uses twig to display all categories in and alphabetical list. I need to group the list by parent id.
At location /all-in-on-event-calendar/app/view/calendar/taxonomy.php is:
/**
* Creates the html for categories filter
*
* @param array $view_args
* @return string
*/
public function get_html_for_categories( array $view_args ) {
return $this->_get_html_for_taxonomy( $view_args );
}
/**
* Generates the HTML for a taxonomy selector.
*
* @param array $view_args Arguments to the parent view
* @param bool $tag whether it's tags or categories.
*
* @return string Markup for categories selector
*/
protected function _get_html_for_taxonomy( $view_args, $tag = false ) {
$taxonomy_name = 'events_categories';
$type = 'category';
$type_for_filter = 'cat_ids';
$type_for_view_args = 'categories';
.... DOES STUFF THAT I WANT TO OVERRIDE....
.... TWIG LOADER THAT FEEDS THE TWIG TEMPLATE....
$loader = $this->_registry->get( 'theme.loader' );
return $loader->get_file( $type_for_view_args . '.twig', $args, false )
->get_content();
}
Then in /all-in-on-event-calendar/public/themes-ai1ec/mytemplate/categories.twig is:
<li class="ai1ec-dropdown ai1ec-category-filter
{% if selected_cat_ids is not empty %}ai1ec-active{% endif %}">
<a class="ai1ec-dropdown-toggle" data-toggle="ai1ec-dropdown">
<i class="ai1ec-fa ai1ec-fa-folder-open"></i>
<span class="ai1ec-clear-filter ai1ec-tooltip-trigger"
data-href="{{ clear_filter }}"
{{ data_type | raw }}
title="{{ text_clear_category_filter }}">
<i class="ai1ec-fa ai1ec-fa-times-circle"></i>
</span>
{{ text_categories }}
..... cut off rest .....
Basically – I would like to know how I can properly override the get_html_for_categories
in my custom template so that it feeds the twig template. I know I could just modify /all-in-on-event-calendar/app/view/calendar/taxonomy.php
but those changes will just get rewritten every update. There is a functions.php
located at /all-in-on-event-calendar/public/themes-ai1ec/mytemplate/functions.php
but can’t seem to override the class from there. Any suggestions? THANKS!