Skip to content

Instantly share code, notes, and snippets.

View repeater-test.php
<?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')) {
wire('modules')->install('FieldtypeRepeater');
echo "Module FieldtypeRepeater installed\n";
@kongondo
kongondo / pw_configurable_module_example.php
Last active Aug 29, 2015
Example Configurable ProcessWire Process Module
View pw_configurable_module_example.php
<?php
//Example by Ryan Cramer @ProcessWire - http://processwire.com/talk/topic/5480-configurable-process-module-need-walk-through/?p=53729
class YourModule extends WireData implements Module, ConfigurableModule {
public static function getModuleInfo() {
return array('title' => 'Your Module', 'version' => 1);
}
const defaultValue = 'smith';
View data.php
<?php
/*
* Script: DataTables server-side script for PHP and MySQL
* Copyright: 2012 - John Becker, Beckersoft, Inc.
* Copyright: 2010 - Allan Jardine
* License: GPL v2 or BSD (3-point)
*/
class TableData {
View CustomPageSave.module
<?php
/**
* Adding other types of save buttons for page edit form.
*
* ProcessWire 2.x
* Copyright (C) 2010 by Ryan Cramer
* Licensed under GNU/GPL v2, see LICENSE.TXT
*
* http://www.processwire.com
@kongondo
kongondo / member.login.php
Last active Aug 29, 2015
ProcessWire: Code example - front-end system to handle logins, password resets and changing passwords
View member.login.php
<?php
/*
Code by Ryan Cramer
Integrating a member visitor login form
https://processwire.com/talk/topic/1716-integrating-a-member-visitor-login-form/?p=15919
*/
/*
I recently had to setup front-end system to handle logins, password resets and changing passwords, so here's about how it was done. This should be functional code, but consider it pseudocode as you may need to make minor adjustments here and there. Please let me know if anything that doesn't compile and I'll correct it here.
@kongondo
kongondo / blogCleaner
Last active Aug 29, 2015
Blog 2 Cleanup Utility in case you mistakenly uninstalled Blog without first running the inbuilt Cleanup Utility
View blogCleaner
<?php
/**
*
* CONTEXT: This is a utility class for 'cleaning-up' Blog in case you uninstalled Blog without first running its inbuilt Cleanup utility.
*
* WARNING: The utility will irreversibly delete the following Blog Components
* Fields (blog_xxx)
* Templates (blog-xxx)
* Optionally Template Files (in case you installed the blank/demo Template Files) (blog-xxx.php/inc)
@kongondo
kongondo / Multisite.module.php
Last active Aug 29, 2015 — forked from LostKobrakai/Multisite.module.php
Multisite routing for ProcessWire
View Multisite.module.php
<?php
// source: https://processwire.com/talk/topic/680-multiple-sites-from-one-install/?p=8778
class Multisite extends WireData implements Module, ConfigurableModule {
public static function getModuleInfo() {
return array(
'title' => 'Multisite',
'version' => 1,
@kongondo
kongondo / form-process.php
Created Jun 7, 2013 — forked from somatonic/form-process.php
ProcessWire example front-end form with file upload and fields
View form-process.php
<?php
// ------------------------------ FORM Processing ---------------------------------------
$errors = null;
$success = false;
// helper function to format form errors
function showError($e){
return "<p class='error'>$e</p>";
@kongondo
kongondo / paginator.php
Last active Dec 18, 2015 — forked from somatonic/paginator.php
manual pagination example for in memory page arrays
View paginator.php
<?php
/**
* include paginator class from ProcessWire core, $config->paths->Modulename can
* be used to get the path of any module in PW.
*/
require_once($config->paths->MarkupPagerNav . "PagerNav.php");
/**
@kongondo
kongondo / repeater_example.php
Created Jun 7, 2013 — forked from somatonic/repeater_example.php
example repeater creation and save front-end form
View repeater_example.php
<?php
$mypage = $pages->get("/about/");
if($input->post->submit){
$n = 1;
$title = "element_title_$n";
$url = "external_url_$n";
$mypage->setOutputFormatting(false);