Carry out the following steps:
Create a new directory in
blocks
namedproduct_list
. We start with the database model. Create a new file nameddb.xml
in the new directory with the following content:<?xml version="1.0"?> <schema version="0.3"> <table name="btProductList"> <field name="bID" type="I"> <key /> <unsigned /> </field> <field name="categoryID" type="I"></field> </table> </schema>
Create another file named
controller.php
:<?php defined('C5_EXECUTE') or die(_("Access Denied.")); class ProductListBlockController extends BlockController { protected $btTable = 'btProductList'; protected $btInterfaceWidth = "250"; protected $btInterfaceHeight = "110"; public function getBlockTypeDescription() { return t("Embeds a Product List in your web page."); } public function getBlockTypeName() { return...