This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* ProcessWire example demonstration module | |
* | |
* PageListActionHook autoload module once installed will remove "new" action from second level pages | |
* using the template "basic-page" | |
* | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include("index.php"); | |
$pages = wire()->pages; | |
$stadiums = $pages->find("template=template, field.count>0"); | |
$ptf = "template"; | |
$ptt = "fieldname"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
for ($i = 1; $i <= 20; $i++) | |
{ | |
$title = file_get_contents("http://loripsum.net/api/1/plaintext/long/prude/"); | |
$body = file_get_contents("http://loripsum.net/api/3/decorate/link/ul/prude/long/"); | |
$template = "INSERT_TEMPLATE_HERE"; // i.e. 'basic-page' | |
$parent = "INSERT_PARENT_HERE"; // i.e. /about-us/ | |
$c = new Page(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// .... module | |
// create fields and templates using arrays | |
public function getTemplatesConfig() { | |
// title | field1 | field2 ... | |
$templatesArray = array( | |
'category' => array('title'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ShoppingCheckout extends WireData implements Module, ConfigurableModule | |
{ | |
public static function getModuleInfo() | |
{ | |
return array( | |
'title' => 'Shopping Checkout', | |
'version' => 001, | |
'summary' => 'Handles checkout process, order saving etc. Main module for PW Shop', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* | |
* Multisite module for Processwire | |
* (C) 2012 Antti Peisa, Avoine Oy | |
* | |
* ProcessWire 2.x | |
* Copyright (C) 2010 by Ryan Cramer | |
* Licensed under GNU/GPL v2, see LICENSE.TXT | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Get the homepage | |
$homepage = $pages->get("/"); | |
// Get the all the children of home | |
$children = $homepage->children; | |
// Get all the homepage children who need to be under home in the menu | |
$homePageChildren = $homepage->children("homechild=1"); |
NewerOlder