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"); |
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 | |
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 | |
// .... 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 | |
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 | |
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 | |
/** | |
* 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 | |
$template = $templates->get("template_name"); // Insert template name here | |
$template->flags = Template::flagSystemOverride; | |
$template->flags = false; // Set flag to false | |
$template->save(); |
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
# Thanks to: http://snipplr.com/view.php?codeview&id=23838 | |
# --recursive: download the entire Web site. | |
# --domains website.org: don't follow links outside website.org. | |
# --no-parent: don't follow links outside the directory tutorials/html/. | |
# --page-requisites: get all the elements that compose the page (images, CSS and so on). | |
# --html-extension: save files with the .html extension. | |
# --convert-links: convert links so that they work locally, off-line. | |
# --restrict-file-names=windows: modify filenames so that they will work in Windows as well. | |
# --no-clobber: don't overwrite any existing files (used in case the download is interrupted and resumed). |
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 | |
$field = $fields->get("field_name_here"); // Insert system field i.e. roles | |
$field->flags = Field::flagSystemOverride; | |
$field->flags = 0; | |
$field->save(); |
OlderNewer