View example-filter-form.php
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 namespace ProcessWire; | |
$filter = ""; | |
$form = $modules->InputfieldForm; | |
$form->attr("action", $page->url); | |
$form->attr("method", "get"); | |
// select with sort options | |
$f = $modules->InputfieldSelect; |
View SiteHelpers.module
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 | |
/** | |
* Site Helpers | |
* | |
* | |
*/ | |
View HelperHooks.module
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 | |
/** | |
* Helper Module | |
* Example to track a change before page is saved | |
* | |
*/ | |
View login.php
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
/** | |
* Custom login | |
* ============================================================================== | |
*/ | |
wire()->addHookBefore("ProcessLogin::execute", function($event){ | |
if(wire("user")->isLoggedin() && wire("input")->get("login")) { | |
wire("session")->redirect("/"); | |
} | |
}); |
View AddImagesFromUrl.module
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 | |
/** | |
* AddImagesFromUrl | |
* | |
* On a page with fields | |
* "add_images_url" text field | |
* "images" images field | |
* | |
* This basic example module will add the image from the url to the images field on page save. |
View MyPageTableHooks.module
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 | |
/** | |
* Example Hooks to hack InputfieldPageTable to not render add buttons on a condition | |
* This will remove "add new" buttons if there's more than 2 entries | |
* | |
* - First addHookBefore InputfieldPageTable::render to count the value (table rows) | |
* - If value is greater than 1, we hadd another hook to InputfieldButton::render (used by page table for the buttons) | |
* and overwrite it with an empty string. | |
* - Add another hook after page table render to remove the button hooks, to not remove any other buttons rendered |
View CustomPageSave.module
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 | |
/** | |
* 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 |
View TextareaStripNbsp.module
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 | |
/** | |
* TinyMCE replace nbsp with regular whitespace | |
* | |
* Only nbsp preceeded with a whitespace will get replaced, this leaves | |
* single non breaking space only bewtween words | |
* | |
* ProcessWire 2.x | |
* Copyright (C) 2012 by Ryan Cramer |
View HelperFieldsLanguageLabel.module
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 module | |
* | |
* Example Fields Language Label Helper | |
* Gets the language value of a field label for the current user's language | |
* | |
* Once Installed it will add a new method to fields | |
* |
View PageAddableHook.module
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 | |
* | |
* Page::addable hook module, once installed will set permission "addable" to false | |
* for pages using basic-page template and with level greater than 1 | |
*/ | |
class PageAddableHook extends WireData implements Module, ConfigurableModule { |
NewerOlder