Skip to content

Instantly share code, notes, and snippets.


Teppo Koivula teppokoivula

View GitHub Profile
View ImageSizerEngineGDAlt.module.php
<?php namespace ProcessWire;
class ImageSizerEngineGDAlt extends ImageSizerEngineGD {
public static function getModuleInfo() {
return [
'title' => 'GD Image Sizer (alternative version)',
'version' => 1,
'summary' => "Uses PHP’s built-in GD library to resize images (alternative version, see",
teppokoivula / init.php
Created Apr 13, 2019
Generate search index for saved pages in ProcessWire
View init.php
* Generate search index for saved pages
$this->addHook('Pages::saveReady', function(HookEvent $event) {
$page = $event->arguments[0];
if ($page->id && $page->hasField('search_index')) {
$page->search_index = indexPage($page, array(
View lv_ct_test.php
// Bootstrap ProcessWire
require "index.php";
// Install LanguageSupportFields (unless already installed)
if (!wire('modules')->isInstalled('LanguageSupportFields')) {
teppokoivula / repeater-test.php
Last active Jan 28, 2017
Testing ProcessWire repeater behaviour in API use
View repeater-test.php
// Bootstrap ProcessWire
require 'index.php';
// Make sure that FieldtypeRepeater is installed and ready for use
if (!wire('modules')->isInstalled('FieldtypeRepeater')) {
if (wire('modules')->isInstallable('FieldtypeRepeater')) {
echo "Module FieldtypeRepeater installed\n";
teppokoivula / out.json
Created Mar 15, 2014
Another Page Tree Migrator test
View out.json
"pages": [{
"name": "test-page",
"parent_name": "",
"page_template": "basic-page",
"status": 1,
"sort": 7,
"sortfield": "sort",
"data": {
"title": "Test page",
teppokoivula / out.json
Created Mar 15, 2014
Page Tree Migrator sample output
View out.json