Welcome ,
  1. Home
  2. Widgets

PageCarton Documentation



Interested in coding widgets, classes, or methods? Check out the Code section!

Widgets

By default, whenever PageCarton wants to output something to the browser, it does this through widgets. A widget serves as a bridge that links the PageCarton core to the browser.


Image

Adding widgets require one to have a capability of writing PHP code. Widgets are PHP classes that extend the base PageCarton_Widget class. A Widget should have an "init" method that the PageCarton core would call to run the widget process. The easiest way to create a widget is to create the file from the PageCarton Admin Panel. To create a widget file, go to:

PageCarton Admin Panel > Plugins > My Plugins > "New Widget"

This will create the PHP File that would contain the widget class in the right directory. It will also create the "init" method outputting some demo code. You need to customize this file to suite the task you want the widget to accomplish. All Widget files should be saved in "/pagecarton/sites/*/application/modules".

Currently, you cannot edit the widget file from the browser; you need to edit the file using your favorite code text editor.

 

 

 

← Previous "Settings Module""Building Plugins for PageCarton" Next →


 

Similar Documentation Article

 

How to Use Access Level Widgets to Control Content Visibility in PageCarton Photo

How to Use Access Level Widgets to Control Content Visibility in PageCarton

This article explains how to use PageCarton's Access Level Widgets to control content visibility based on user roles, such as content owners, invited users, or administrators. It helps ensure t...

article
 

 

How to Add Edit and Delete Buttons with URLs in PageCarton Photo

How to Add Edit and Delete Buttons with URLs in PageCarton

This article explains how to add functional Edit and Delete buttons to content items in PageCarton, using direct URL links to PageCarton edit and delete page. These buttons allow owners and admin...

article
 

 

A Step By Step Guide To Back up and Downloading your Website on PageCarton. Photo

A Step By Step Guide To Back up and Downloading your Website on PageCarton.

In the digital age, website is the face of a business or personal brand. Whether it's a blog, an e-commerce site, or a personal website. Backing up your website files is the first step towards secu...

article
 

 

Changing Number of Posts to Display on a Widget Photo

Changing Number of Posts to Display on a Widget

Another interesting customization feature just came in the latest PageCarton. Users of PageCarton can now change the number of post shown in embedded widget from the admin panel. For example, be...

Documentation Article
 

 

Installing PageCarton via Composer Photo

Installing PageCarton via Composer

If you have Composer installed on your computer, you can easily get PageCarton up by running the following commands on your command line.  # 1. Download PageCarton via composer compose...

article
 

 

Setting up PageCarton via Docker Photo

Setting up PageCarton via Docker

PageCarton now has a few files in its GitHub repository that helps to set it up on Docker easily. If you are familiar with Docker or a newbie, you should be able to get started with PageCarton...

article