Skip to content

Mustash plugins

Mark Croxton edited this page Jul 18, 2013 · 74 revisions

Mustash plugins allow pre-defined cache-breaking rules to be triggered by events in ExpressionEngine, for example immediately after creating or editing a specific item of content.

Each plugin is responsible for a discrete content module and will expose hooks provided by that module. These hooks can then be attached to rules using the [rules interface](Cache breaking rules).

Some plugins define groups that can optionally be used to narrow the action of a rule to content edited within a specific group. In the case of the Channel Entries plugin for example, the groups listed are Channels.

Activating plugins

Individual plugins can be activated on the Settings screen of the Mustash control panel. Tick the plugins you wish to activate and save. Please only activate third party plugins if you have the associated module installed.

Core plugins

Channel Entries

The Channel Entries plugin is invoked when publishing or editing Channel entries in the control panel.

Hooks

entry_submission_end
This hook is triggered after an entry is submitted.

update_multi_entries_loop
This hook is executed when entries are updated using the multi-entry editor.

delete_entries_loop
Executed in the loop that deletes each entry, after deletion.

Groups

The groups defined by this plugin are ExpressionEngine Channels.


Comments

The Comments plugin is invoked when a new comment is added to an entry on the front-end of your site, or when an entry is edited or deleted in the control panel.

Hooks

insert_comment_end
Executed after a new comment has been submitted.

delete_comment_additional
Executed after a comment is deleted in the control panel.

update_comment_additional
Executed after a comment is updated in the control panel.

Groups

The groups defined by this plugin are ExpressionEngine Channels.


Forum

Hooks

forum_submit_post_end
Executed after a new post is submitted to a forum topic.

Groups

A list of all forums defined for the current site, ordered by forum category.


Member Model

The Member Model plugin is invoked when a member is created, edited or deleted in the front or backend of the website. In theory, providing you are using ExpressionEngine 2.6.0 or later, third-party add-ons that manage member registration / profiles should be supported by this plugin.

Hooks

member_create_end (requires EE 2.6.0+)
Executed after member creation.

member_update_end (requires EE 2.6.0+)
Executed after a member profile is updated.

member_delete (requires EE 2.4.0+)
Executed after a member is deleted.

Groups

The groups defined by this plugin are Member Groups which have control panel access.


API

The API plugin is invoked by an action URL. The URL must pass a hook as a parameter, and the hook must be associated with one or more rules for it to be triggered.

####Hooks Custom hooks can be defined on Settings screen in the API custom hooks field.

Third party plugins

Low Reorder

The Low Reorder plugin is invoked when a list of sortable entires is re-ordered.

Hooks

low_reorder_post_sort
Executed after a list of sortable entries has been saved.

Groups

The groups defined by this plugin are ExpressionEngine Channels.


Low Variables

Hooks

low_variables_post_save
Executed after a variable has been saved.

low_variables_delete
Executed when a variable is deleted.

Groups

The groups defined by this plugin are Low Variable groups.


Navee

Hooks

navee_clear_cache
Executed after a link is added, edited or deleted in a Navee navigation menu.

This hook doesn't exist yet, you need to add it yourself to the function _clearCache() in mcp.navee.php.

Just before the function returns TRUE add:

     // ------------------------------------------- 
    // 'navee_clear_cache' hook 
    // - Do external cache-breaking 
    // 
    if ($this->EE->extensions->active_hook('navee_clear_cache')) 
    { 
        $this->EE->extensions->call('navee_clear_cache', $data); 
    } 

Groups

The groups defined by this plugin are Navee menus.


Taxonomy

Hooks

taxonomy_updated (requires Taxonomy 3.0.3+)
Executed after a node is added, edited or deleted in a Taxonomy tree.

Groups

The groups defined by this plugin are Taxonomy trees.


Structure

structure_reorder_end (requires Structure 3.3.9 or later)
Executed when the Structure tree is reordered.


Varnish

The experimental Varnish plugin is triggered by the stash_delete hook, and so it is called recursively when hooks associated with other plugins are triggered. That means it effectively extends any rules defined for other active plugins, thus allowing granular control of varnish cache purging.

It will attempt to purge urls in a Varnish cache when corresponding Stash cached items (saved with the @URI context pointer) are cleared. Therefore, you must be using Stash full-page caching in some form for it to work.

You must create at least one Varnish rule for the Varnish plugin to be triggered. If you want other plugins and their hooks to trigger Varnish cache purging, you need to create rules for them as well.

To setup Varnish with ExpressionEngine, follow this guide.

Hooks

stash_delete
Executed when variables are deleted, whether manually within the Mustash interface or when variables are cleared by cache-breaking rules.

Clone this wiki locally