This file contains hidden or 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
// this is an example of how to use the search engine module for ProcessWire to provide an AJAX | |
// "live search"; likely not a perfect solution, but should give you a general idea of how to | |
// set this type of functionality up :) | |
// see https://processwire.com/talk/topic/21941-searchengine/?do=findComment&comment=248152 for | |
// alternative solution using htmx | |
const searchForm = document.getElementById('se-form') | |
if (searchForm) { |
This file contains hidden or 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 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 https://github.com/processwire/processwire-issues/issues/1154).", | |
]; |
This file contains hidden or 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 | |
/** | |
* 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( |
This file contains hidden or 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
{ | |
"pages": [{ | |
"name": "test-page", | |
"parent_name": "", | |
"page_template": "basic-page", | |
"status": 1, | |
"sort": 7, | |
"sortfield": "sort", | |
"data": { | |
"title": "Test page", |
This file contains hidden or 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
{ | |
"pages":[ | |
{ | |
"name":"test-page", | |
"parent_name":"", | |
"page_template":"basic-page", | |
"status":1, | |
"sort":7, | |
"sortfield":"sort", | |
"data":{ |
This file contains hidden or 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 | |
// Bootstrap ProcessWire | |
require "index.php"; | |
// Install LanguageSupportFields (unless already installed) | |
if (!wire('modules')->isInstalled('LanguageSupportFields')) { | |
wire('modules')->install('LanguageSupportFields'); | |
} |
This file contains hidden or 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 | |
// 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"; |