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""Database Tables" Next →


 

Similar Documentation 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
 

 

Steps in Creating a PageCarton Website Offline Photo

Steps in Creating a PageCarton Website Offline

Creating a website has now been made easy with the use of Pagecarton, it's not necessary to know much about coding. If you have your contents ready, and the style of how your website wants to...

article
 

 

Steps in Creating a PageCarton Theme Photo

Steps in Creating a PageCarton Theme

Creating a PageCarton theme isn't actually a difficult task, but just that it might involve a long process and a little bit of how programming codes work. The main purpose of having a PageCarto...

article