Documentation 2.x

ImpressPages CMS "Hello Widgets" plugin

This is a small example how to add your first widget to ImpressPages CMS 2.x website.

Download this example

Installation

  1. Extract downloaded archive to your website's ip_plugins folder. Folder examples should be a child of ip_plugins folder.
  2. Log in to administration area, go to tab Developer -> Modules and press install.
  3. You will see new widget in Content Management tab.

How it is built?

ImpressPages 2.X widget structure

Folder example describes the group of the plugins. Folder hello_widgets is plugin name. These folders (including install / uninstall folders) create basic plugin structure. Read here about ImpressPages CMS plugins.

In this example our focus is on the widget folder inside the plugin. This is the folder where all widgets of that plugin goes. Each folder in widget folder represents one widget. In this example we have only one widget called "IpMyFirstWidget".

All widgets should start with a capital letter. This is important when more functionality is added to the widget.

All widgets should start with the developer prefix. This example is built by ImpressPages team. So, it starts (as all our widgets) with prefix "Ip".

 

The simplest widget is just an HTML code. So we have two separate folders:

  • management/default.php - html that goes as your widget administration tools
  • preview/default.php - html that will be visible to website visitors

Summary

That's all. If you need some HTML code snippets to be added to your website, you can use this example as a basis.

You can add PHP code to default.php files. Just keep in mind that these files should have no business logic or interactions with database. Just printing some required data. It is not a restriction of ImpressPages CMS. It is the culture of programing using MVC architecture.

Write a comment

You must be logged in to comment.