Skip to content

Instantly share code, notes, and snippets.

/* normal flexbox */
.flexbox .flex-container {
display: -webkit-flex;
display: -moz-flex;
display: -ms-flex;
display: flex;
}
.flexbox .flex-container.vertical {
display: -webkit-flex;
display: -moz-flex;
@Lazerproof
Lazerproof / search-form.php
Created March 22, 2016 11:21 — forked from outflux3/search-form.php
Processwire sample search form based on skyscrapers search
<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
foreach($pages->get(1016)->children('include=all') as $app) {
$selected = $app->name == $input->whitelist->application ? " selected='selected' " : '';
@Lazerproof
Lazerproof / search-processor.php
Created March 22, 2016 11:23 — forked from outflux3/search-processor.php
search-processor. processwire
<?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");
@Lazerproof
Lazerproof / contact-form.php
Created March 22, 2016 12:16 — forked from MatthewSchenker/contact-form.php
ProcessWire form with "regular" fields and file uploads. The first two files (contact-form and contact-success) are for the contact form and the success page with normal fields. This works successfully. The third and fourth files (contact-form2 and contact-success2) are the same, but with the file-upload field added. These are currently not work…
<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>
@Lazerproof
Lazerproof / pw_buid-form.php
Created March 22, 2016 12:20 — forked from ocorreiododiogo/pw_buid-form.php
For Processwire. Mirror admin forms in the frontend. Works well with regular fields (text, textareas, checkboxes, radios, multiple choice, etc), but didn't manage to make it work well with images
<?php
// Get the page you need to edit
$mypage = $pages->get('/some/page/');
// Populate with the names of the fields you want to exclude OR include (see instructions below)
// Leave empty to output all the fields
$myfields = array('body', 'email');
$form = $modules->get('InputfieldForm');
$fields = $mypage->getInputfields();
var gulp = require('gulp');
var bs = require('browser-sync').create();
var runSequence = require('run-sequence');
var connect = require('gulp-connect-php');
gulp.task('php', function() {
php.server({
base: './app',
port: 8001,
}, function (){
<?php
// Init vars
$out = '';
// Temp upload path for file uploads
$upload_path = $config->uploadTmpDir;
// create form
$form = $modules->get("InputfieldForm");
@Lazerproof
Lazerproof / ContactForm.php
Created March 22, 2016 12:24 — forked from mauricius/ContactForm.php
Simple Class for building a Bootstrap-compatible Contact Form for ProcessWire
<?php
class ContactForm
{
var $form;
var $to = 'destination@email.com';
var $toName = 'Destination Name';
public function __construct()
@Lazerproof
Lazerproof / fields
Created March 22, 2016 12:49
ProcessWire fields
hidden
------
$field = $this->modules->get('InputfieldHidden');
$field->label = __('Some Label');
$field->attr('name+id','some_label');
$field->attr('value', 'some value');
submit
------
$submit = $this->modules->get('InputfieldSubmit');
@Lazerproof
Lazerproof / form_with_fields_in_table.php
Created August 29, 2016 13:52 — forked from somatonic/form_with_fields_in_table.php
form with fields rendered in a table example
<?php
/**
* Example form using PW API
*
* A workaround to get fields display in a table
* Those fields are marked with a property added to the fields $field->tablerow
*
* Approach is to grab those fields after form is put together and maybe processed,
* loop each row and render out the fields along with possible errors and add it to a string variable $table
* while we remove the field from the form at the same time.