Skip to content

Instantly share code, notes, and snippets.

<?php
// check if there are GET variables present in the URL
if(count($input->get)) {
$selector = '';
if($input->get->application) {
$application = $sanitizer->pageName($input->get->application);
$appid = $pages->get("template=product-options, name=$application");
// http://processwire.com/talk/topic/1938-building-an-advanced-search-form-with-form-builder/?p=36295
<form name='search' id='product-search' method='get' action='<?php echo $config->urls->root?>speaker-finder/'>
<ul id="row1">
<li>
<label for='search_app'>Application</label>
<select id='search_app' name='application' onchange="$(this.form).trigger('submit')">
<option value=''>Any</option><?php
// generate the application options, checking the whitelist to see if any are already selected
<form action="/customer-service/contact/contact-success/" method="post">
<p><label for="contactname">Name:</label></p>
<p><input type="text" name="contactname"></p>
<p><label for="email">E-Mail:</label></p>
<p><input type="email" name="email"></p>
<p><label for="comments">Comments:</label></p>
<p><textarea name="comments" cols="25" rows="6"></textarea></p>
<button type="submit">Submit</button>
</form>
<?php
// Let's assume the pages in question are named like Blah1, Blah2, etc.
foreach ($pages->find('name^=Blah') as $blahPage) {
// Let's assume the fields that need to contain HTML are called Html1, etc.
foreach ($blahPage->fields->find('name^=Html') as $field) {
// Let's assume these fields have their value in ShouldBeHtml
$fieldContent = $field->ShouldBeHtml;
$contentWrapped = '';
// Parse the field's content as HTML
@mr-fan
mr-fan / Simple Pagination
Last active August 29, 2015 14:02 — forked from dewwwald/_A.md
##Simple Pagination For Processwire
###ProcessWire Requirements
On the template you want pagination. Go to the url's tab where you will have to:
- Activate Allow Page Numbers.
- Activate Allow URL Segments.
/*
From Marty Walker Pastie
Picturefill markup with ProcessWire image sizing
https://github.com/scottjehl/picturefill/
http://processwire.com/
*/
<div data-picture data-alt='{$page->title}'>
<div data-src='{$image->size(50,0)->url}'></div>
<?
/*Breadcrumbs
=====================
This is a general way to create breadcrumbs for ProcessWire pages.
It retreives in an array all the parents and will walk through the array to display the title and URL of the parents.
The last echo returns the title of the current page, without a link.
=====================*/
?>
<div id="breadcrumbs">
<?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";
<?php
/*
CODE COPIED FROM https://processwire.com/talk/topic/6142-hide-page-tree-in-the-admin/
One hook returns false for Page::viewable() for the ProcessPageList page.
Another Hook can be used to redirect users to a custom admin page after login.
*/
// This needs to be an autoload module
public function init() {
<?php
/*
Code by Ryan Cramer
Integrating a member visitor login form
https://processwire.com/talk/topic/1716-integrating-a-member-visitor-login-form/?p=15919
*/
/*
I recently had to setup front-end system to handle logins, password resets and changing passwords, so here's about how it was done. This should be functional code, but consider it pseudocode as you may need to make minor adjustments here and there. Please let me know if anything that doesn't compile and I'll correct it here.