Sorry, I forgot about this earlier. Here's how to add such a configuration option. First off, tell ProcessWire that your module will be configurable by adding 'implements ConfigurableModule', like this:
class SchedulePages extends WireData implements Module, ConfigurableModule {
Next, determine the name of the variable you will use to hold the template IDs: I'll use $scheduleTemplateIDs. Set that in your __construct() to initialize it as a known variable in your module:
<?php
public function __construct() {
$this->set('scheduleTemplateIDs', array());
}
Now you need to implement the ConfigurableModule interface by adding a static function called getModuleConfigInputfields. It is static so that ProcessWire's Modules section can call upon it without actually initializing the module. Or to put it another way, it ensures that if you have CSS or JS files being loaded in your __construct() or init() then they won't be altering the display of the module configuration screen.
This function is given an array of the current configuration data saved with your module. If it's the first time your module is configured, it will very likely be empty.
<?php
static public function getModuleConfigInputfields(array $data) {
// create a wrapper to hold our field(s)
$form = new InputfieldWrapper();
// set our default if this config var isn't already present
if(!isset($data['scheduleTemplateIDs'])) $data['scheduleTemplateIDs'] = array();
// create a field to select templates
$f = wire('modules')->get('InputfieldCheckboxes');
$f->label = 'Select the templates you want';
$f->description = 'Additional description if you want it';
$f->notes = 'Some optional extra notes at the bottom';
$f->attr('name', 'scheduleTemplateIDs');
// add the checkbox options
foreach(wire('templates') as $template) {
$f->addOption($template->id, $template->name);
}
// set the current value
$f->attr('value', $data['scheduleTemplateIDs']);
// add it to the form
$form->add($f);
return $form;
}
Now when the user clicks on your module in Admin > Modules, they will see checkboxes they can use. After they save, PW will now know to automatically send a $scheduleTemplateIDs var to your module every time it's loaded. That variable will be set before your module's init() is called. So you could do something like this in your init() or anywhere in your module:
<?php
$page = wire('page');
if(in_array($page->template->id, $this->scheduleTemplateIDs)) {
// do something
}