PyroCMS 2.0 Documentation

← Table of Contents


Widgets, Plugins, and Modules

Simply put, modules, widgets and plugins are ways to get more complex functionality into your sites using PyroCMS's simple tag system. PyroCMS comes with its own core modules, widgets, and plugins, and you can also download free and paid third party ones via the PyroCMS add-on store.

Note: if you are a developer and interested in developing your own widgets, plugins, and modules, you can find information on how to do that in our dev guide.

Below is an overview of each.

Widgets

Widgets are little chunks of code that do a specific thing. For instance, you can create a simple HTML widget that holds HTML code, or you can create a login widget that displays a login form.

You can create and edit widgets in the widgets section of the admin panel (under Content → Widgets). Once you create them, you can easily add them into your layouts using PyroCMS tags:

{{ widgets:instance id="6"}}

You can even group widgets together into widget areas and order them, which is handy if you have a sidebar that you want to be able to manage from the control panel.

{{ widgets:area slug="blog-right" }}

Plugins

Plugins are simple: they allow you to display or manipulate data in your layouts using PyroCMS tags, and they follow a simple syntax:

{{ plugin:function parameter="value" }}

PyroCMS comes with an array of plugins that make it easy to do things like grab a URL segment:

{{ url:segments segment="1" }}

You can also do things like show a page tree:

{{ pages:page_tree start="about" }}

Plugins can also use two tags to loop through data:

{{ blog:posts limit="5" order-by="title" }}
    <h2><a href="{{ url }}">{{ title }}</a></h2>
{{ /blog:post }}

For more information on PyroCMS tags and how to use them, see the tag reference.

Modules

Many add-ons need more than just functionality you can access via PyroCMS tags. Sometimes you need an interface in the control panel, as well as other resources like javascript files.

Modules are the largest type of PyroCMS add-on. They have a place in the control panel menu (usually), have control panel controls, their own widgets, and their own plugins.

For instance, the Pages module contains the control panel area that allows you to create and organize pages, and also the pages plugin, which allows you to do things like display a page tree with PyroCMS tags.

What makes PyroCMS modules unique is the fact that they can have public-facing pages as well.

For instance, the Blog module allows you to manage posts in the control panel, but yoursite.com/blog maps to the blog module and displays posts using your theme.

For more on PyroCMS URLs and modularity, see PyroCMS URLS.