How to write a Plugin

A Module can deliver features to the visitor-facing front end of your Zenario site. Such a module is called a "pluggable" module.

When you go to "Edit Slots" or to "Layout" in the admin toolbar, and then hover over a Slot on the web page, you can choose to insert a plugin from a pluggable module into this slot.

Here is how to write a Module that generates Plugins that can be put on web pages in this way.

 

How to make a Pluggable Module

If you want to add new functionality that visitors to your site will see, you will need to write a module that is "pluggable".

 

Example Module 1: A simple "Hello World!" Plugin

This example shows how to make a simple "Hello World" plugin.

It demonstrates how to write the showSlot() method to output text onto a page.

Example Module 2: A multilingual "Hello World!" Plugin

This example shows a more advanced version of the "Hello World" plugin.

It demonstrates how to write the init() method to change how a plugin is displayed, how to write a Twig framework, and how to make a Twig framework multilingual.

Example Module 3: Plugin Settings and Phrases

This example shows how to create a plugin setting, how to work with phrases to make a plugin multi-lingual, and how to give your module a revision number.

How the Methods of a Pluggable Module are called

When the CMS creates a page and there are plugins in that page's slots, it processes the methods of those plugins' modules according to the following flow