Skip to main content

Documentation

In this documentation, you will find all the important information about the plugin – from installation and configuration to usage and extension.

Cevento Views

In this post, we’ll walk you through:


All overridable Cevento views are located in the directory [cevento_root]/resources/views/.
These views can be overridden either via the current theme or via a plugin.

Overrides via Theme

To override Cevento views in the current theme, you first need to create a cevento directory inside the theme.
Within this folder, plugin views from [cevento_root]/resources/views/* can be directly overridden.
Additionally, specific admin views can also be overridden here.

Example:

[cevento_root]/resources/views/event-single.php -> [theme_root]/cevento/event-single.php
[cevento_root]/resources/views/shortcodes/event-list.php -> [theme_root]/cevento/shortcodes/event-list.php

Overrides via Plugin

To override Cevento views via a plugin, create a subdirectory in your plugin with any name.
Then, register the views directory in Cevento using the WordPress hook plugins_loaded:

add_action('plugins_loaded', function () {
    if (!class_exists('Cevento\Helper\View')) return;

    Cevento\Helper\View::addTemplateDirectory(
        '/absolute/path/to/plugin/[directory_name]'
    );
});

With this hook, Cevento views can be overridden in the plugin as follows:

[cevento_root]/resources/views/event-single.php -> [plugin_root]/[directory_name]/event-single.php
[cevento_root]/resources/views/shortcodes/event-list.php -> [plugin_root]/[directory_name]/shortcodes/event-list.php