Marty Walker
Members-
Posts
631 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Marty Walker
-
Hey Ryan, Is there a ETA for the launch of this? Regards Marty
-
Hazzah! Thanks Ryan!
-
Thanks very much diogo, SiNNuT & Ryan. I'll have a look at Refine. It could come in handy for a few other projects of similar ilk. Regards Marty
-
Hi guys, I have a solution worked out - by manually moving cells around. Here's what it looked liked before: And after: Laborious for sure, but's that the only way I know how to do it. No rush for any pointers as I have it sorted for now. If I can figure out a 'simpler' way to format this for the next time that'd be fantastic. Regards Marty
-
Hi, Got a waaaaaay off topic question to ask the brains here. I've got a csv/spreadsheet that looks something like this: Name | Categories <- Header row Frank | Apple, Oranges, Plums Alex | Plums, Apples, Oranges, Pears Matt | Apples, Oranges, Pears, Lemons ...etc I know how to split the categories column into separate columns. What I don't know how to do is order each category column so that there's an Apples column an Oranges col and so on, so that only the Apples column will contain rows that have an Apple, Orange etc. Cheers Marty
-
Pinch me. And, I think I need a hug. Edit: Forgot to ask: is there an eta on when this will be released?
-
Tom, Lovely work as always. Regards Marty
-
Hi, I did this one for design agency Ant Design in my "coding-for-other-designers" role: http://aotr.com.au/ Regards Marty
- 1 reply
-
- 3
-
Thanks silkworm. PHP noob here. I don't understand what the "echo <<< _OUT" before all the form html does as well as the "_OUT;" after it. I want to get that foreach in there somehow. Regards Marty
-
Ryan, Thanks very much for taken the time to reply at length. (Actually, I'm starting to think there are two of you. ) How do I weave this into that large form output? <?php // output the checkboxes like this: foreach($products as $product) { $checked = in_array($product, $form['products']) ? "checked" : ''; echo "<label><input type='checkbox' name='products[]' value='$product' $checked> $product</label><br>"; } ?> Regards Marty
-
Hi, I loathe forms. Wherever possible I try to avoid implementing them. In this case I have no choice and I'm left with an issue I can't figure out - this is based on Ryan's basic form example. I'm stumped on how to send the check box values to the recipient email. It's probably glaringly obvious to most except me. Regards Marty <?php /** * basic-form.php - Example of a simple contact form in ProcessWire * */ // set this to the email address you want to send to (or pull from a PW field) $emailTo = 'email@email.com'; // or if not set, we'll just email the default superuser if(empty($emailTo)) $emailTo = $users->get($config->superUserPageID)->email; // set and sanitize our form field values $form = array( 'contact_name' => $sanitizer->text($input->post->contact_name), 'email' => $sanitizer->email($input->post->email), 'comments' => $sanitizer->textarea($input->post->comments), ); // initialize runtime vars $sent = false; $error = ''; // check if the form was submitted if($input->post->submit) { // determine if any fields were ommitted or didn't validate //foreach($form as $key => $value) { // if(empty($value)) $error = "<p class='form-error'>Please completed all fields.</p>"; //} //if(empty($form->$company_name)) $error = "<p class='form-error'>Please completed CF field.</p>"; // if no errors, email the form results if(!$error) { $subject = "A message from the contact form"; $message = ''; foreach($form as $key => $value) $message .= "$key: $value\n"; mail($emailTo, $subject, $message, "From: $form[email]"); $sent = true; } } if($sent) { echo "<p>Thank you, your message has been sent.</p>"; // or pull from a PW field } else { // encode values for placement in markup foreach($form as $key => $value) { $form[$key] = htmlentities($value, ENT_QUOTES, "UTF-8"); } // output the form echo <<< _OUT $error <form action="./" method="post" id="contact-form"> <p> <label for="company_name" class="contact_form">Company name:</label> <input type="text" id="company_name" class="contact_form " name="company_name" value="$form[company_name]" size="40" /> </p> <p> <label for="address_1" class="contact_form">Address 1:</label> <input type="text" id="address_1" class="contact_form " name="address_1" value="$form[address_1]" size="40" /> </p> <p> <label for="address_2" class="contact_form">Address 2:</label> <input type="text" id="address_2" class="contact_form " name="address_2" value="$form[address_2]" size="40" /> </p> <p> <label for="suburb" class="contact_form">Suburb</label> <input type="text" id="suburb" class="contact_form " name="suburb" value="$form[suburb]" size="40" /> </p> <p> <label for="state" class="contact_form">State:</label> <input type="text" id="suburb" class="contact_form " name="state" value="$form[state]" size="20" /> </p> <p> <label for="postcode" class="contact_form">Postcode:</label> <input type="text" id="postcode" class="contact_form " name="postcode" value="$form[postcode]" size="10" /> </p> <p> <label for="country" class="contact_form">Country:</label> <input type="text" id="postcode" class="contact_form " name="country" value="$form[country]" size="40" /> </p> <p> <label class="contact_form" for="contact_name">Contact person:*</label> <input class="contact_form required" type="text" id="contact_name" name="contact_name" size="40" value="$form[contact_name]" /> </p> <p> <label for="position" class="contact_form">Position:</label> <input type="text" id="position" class="contact_form " name="position" value="$form[position]" size="40" /> </p> <p> <label for="phone" class="contact_form">Phone</label> <input type="text" id="phone" class="contact_form " name="phone" value="$form[phone]" size="40" /> </p> <p> <label class="contact_form" for="email">Your email:*</label> <input class="contact_form required" type="email" name="email" id="email" size="40" value="$form[email]" /> </p> <fieldset class="products"> <p>Products of interest:</p> <fieldset class="prod_col"> <input type="checkbox" id="Hats" name="Hats" value="$form[hats]" /><label for="Hats" class="Hats">Hats</label><br/> <input type="checkbox" id="Gloves" name="Gloves" value="$form[gloves]" /><label for="Gloves" class="Gloves">Gloves</label><br/> <input type="checkbox" id="Mens" name="Mens" value="$form[mens]" /><label for="Mens" class="Mens">Mens</label><br/> </fieldset> <fieldset class="prod_col"> <input type="checkbox" id="Bags" name="Bags" value="$form[bags]" /><label for="Bags" class="Bags">Bags</label><br/> <input type="checkbox" id="Scarves" name="Scarves" value="$form[scarves]" /><label for="Scarves" class="Scarves">Scarves</label><br/> <input type="checkbox" id="Clothing" name="Clothing" value="$form[clothing]" /><label for="Clothing" class="Clothing">Clothing</label><br/> </fieldset> </fieldset> <p> <label class="contact_form comments" for="comments">If you have any further comments or questions, please complete this area:</label> <textarea class="contact_form" id="comments" name="comments" rows="5" cols="62">$form[comments]</textarea> </p> <input class="contact_submit" type="submit" name="submit" value="Submit" /> <p>* required fields</p> </form> _OUT; } ?>
-
Hi everyone, http://ubasoma.com/ Ubasoma is the work of Suzanne Buljan who does graphics design for film - like supermom Returns, The Knowing and the recently released The Sapphires. Regards Marty
-
Thanks everyone. I'll tinker some more.
-
This is the first time I've had an issue with CloudFlare. i don't have any problems with the Admin on another PW site I'm running (mine) so I thought there maybe it might be something specific to 2.2.3. No big deal. CF is nice to have but it's no big deal to go without.
-
It's working again now. I think it might have been because I was using CloudFlare. When I changed the DNS back to my hosts it started working fine.
-
Hi, I'm running PW version 2.2.3 (upgraded from 2.2.2 on a live site) and for some reason I automatically get logged out after a few seconds or if I'm navigating between Pages and Setup for example. I've reset my cache and cleared as much cruft out of both Firefox and Chrome (OSX) as I can and I still have the same problem. Any thoughts? Regards Marty
-
What version of PW should I be running? I followed your steps and the TinyMCE buttons disappear and I just see raw html in my field.
-
That looks like it was fun to work on. Nice one.
-
Out of interest, who's using Less/Sass vs plain old CSS
Marty Walker replied to onjegolders's topic in Dev Talk
I'm using LESS exclusively now. I was using the JS version but recently switched to the PHP compiler. There's a lot to like about it and I'm only scratching the surface of it. The code below (gleaned from that site) looks at when the LESS file was changed and compiles it into a CSS file. <?php include ('./lessc.inc.php'); function auto_compile_less($less_fname, $css_fname) { // load the cache $cache_fname = $less_fname.".cache"; if (file_exists($cache_fname)) { $cache = unserialize(file_get_contents($cache_fname)); } else { $cache = $less_fname; } $new_cache = lessc::cexecute($cache); if (!is_array($cache) || $new_cache['updated'] > $cache['updated']) { file_put_contents($cache_fname, serialize($new_cache)); file_put_contents($css_fname, $new_cache['compiled']); } } auto_compile_less('smd.less', 'smd.css'); // Compile the mobile stylesheet too you crazy fool. auto_compile_less('smd-mobile.less', 'smd-mobile.css'); ?> Once it's compiled I can then use Minify: <?php echo "<link type='text/css' rel='stylesheet' href='/min/b=site/templates&f=reset.min.css,smd.css' />"; ?> Regards Marty -
Image Thumbnail Module - Images not displaying
Marty Walker replied to NooseLadder's topic in Getting Started
Is it this one? http://illo.clientsite.net.au If so then each image is a page under 'portfolio'. The part that drives the thumbnails and the main image looks like this: <ul class="thumbs"> <? foreach($pages->get("/portfolio/")->find("template=work-item, sort=sort") as $p) { if ($page->parents->has($p) || $p === $page) { $class = ' class="current"'; } else { $class = ''; } echo "<li$class><a href='{$p->url}'><img src='{$p->image->eq(0)->getThumb('thumbnail')}' title='{$p->title}' alt='{$p->title}' width='61' height='61' /></a></li>"; } ?> </ul> <img src='<?="{$page->image->eq(0)->size(0,373)->url}"; ?>' alt="title" /> Regards Marty -
Image Thumbnail Module - Images not displaying
Marty Walker replied to NooseLadder's topic in Getting Started
Hi, If it's a CropImage you might need something like: <img src='{$page->image_uploader->getThumb('thumbnail_name')}'/> Regards Marty edit: Soma beat me to it :>) -
Like it. You've employed some really interesting techniques there. Cheers Marty
-
Thanks so much Ryan. That's 10 times easier than anything I've Googled. Regards Marty
-
Thanks Pete, I'll Google around some more. In this case I need to completely swap CSS files. Regards Marty