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 | |
// 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"); |
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
// 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 |
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
<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> |
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 | |
// 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 |
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
##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. |
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
/* | |
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> |
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 | |
// 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"; |
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 | |
/* | |
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() { |
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 | |
/* | |
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. |