Our first module, part 1: the concept
22nd March, 2019 in #Modules
This article is part of the Our first module series
For our first module, we’ll build something that introduces some of the most commonly needed aspects of module development:
- a database to store module-specific data
- front end template tags
- a form and corresponding action to handle the processing of the form
- a Control Panel interface for managing/monitoring data
With this in mind — and after a quick check on devot-ee.com to see that one does not exist — let’s build an auction module.
Initially, we’ll keep the module as simple as possible so that the main concepts don’t get lost (we won’t be building the next eBay quite yet). Additional features can be added at a later stage.
This is what we want the module to do:
- display an entry with its current auction price and other summary data (eg, the number of bids placed, the most recent bid).
- display a form to allow logged in site members to place a bid.
- display a list of previous bids for the item.
One thing to note: where possible, we’ll use the pre-existing functionality of EE. In this case:
- items will be created as normal channel entries
- the module will use the existing EE membership functionality to control who can place a bid
We’ll also provide some tools for the site administrator to:
- View the bids
- Add/edit/delete bids manually
In the next step, we’ll start creating the module.