Skip to content

Instantly share code, notes, and snippets.

Created February 22, 2014 09:19
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
// Bootstrap ProcessWire
require "index.php";
// Install LanguageSupportFields (unless already installed)
if (!wire('modules')->isInstalled('LanguageSupportFields')) {
// Create new multi-language textfield and add it to basic-page template
$field = new Field;
$field->type = wire('modules')->get('FieldtypeTextLanguage');
$field->name = 'text_language';
$fieldgroup = wire('fieldgroups')->get('basic-page');
// Create new page and assign value to multi-language textfield
$page = new Page;
$page->parent = wire('pages')->get('/');
$page->template = wire('templates')->get('basic-page');
$page->title = "a test page";
$page->text_language->setLanguageValue(wire('languages')->get('default'), 'test');
for ($i=0; $i<5; ++$i) {
if ($page->isChanged()) {
echo "* changed ($i)\n";
// Remove page
// Remove field
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment