Marty Walker
Members-
Posts
631 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Marty Walker
-
Thanks @DaveP. I watched this yesterday. Very enlightening!
-
Hi John, This is a basic contact form that I've used in the past. I might help. Cheers 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@site.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( 'fullname' => $sanitizer->text($input->post->fullname), '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 no errors, email the form results if(!$error) { $subject = "Message from your website 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"> <label for="fullname">Your name*</label> <input type="text" id="fullname" name="fullname" size="60" value="$form[fullname]" /> <label for="email">Your email*</label> <input type="email" name="email" id="email" size="60" value="$form[email]" /> <label for="comments">Message*</label> <textarea id="comments" name="comments" rows="5" cols="43">$form[comments]</textarea> <input type="submit" name="submit" value="Submit" /> <p class="form-required">* required fields</p> </form> _OUT; } ?>
-
Any pointers on creating a mobile version of a site?
Marty Walker replied to martinluff's topic in API & Templates
Have a look at Categorizr: http://www.brettjankord.com/2012/01/16/categorizr-a-modern-device-detection-script/ I use it to provide a mobile version but also a link to the desktop version of the site. It's really easy to use with PW. (I see that it's creator has recently decided to stop developing it which is shame, although his reasons are clear and understandable.) -
@diogo Thanks for Secretary link. I do a bit of work for artists so I'll check it out.
-
I've had all manner of problem trying to get PW working on a Zeus setup. Nothing worked for me. It'd be less trouble to change servers. Cheers Marty
-
Hi David, You need to setup a "publish_date" field of the datetime type. In your template code you'd check against that field. <?php $today = time(); $blog = $pages->get("/blog/")->find("sort=-publish_date, publish_date<$today"); ?> I'm not sure if this help but that's how I setup blog/news pages. Regards Marty
-
I've had great experience with KnownHost and their managed VPS. Most of the PW sites I run are hosted there.
-
ExpressionEngine new pricing structure and how ProcessWire could benefit
Marty Walker replied to panictree's topic in Pub
@diogo: "I'm a graphic designer with very basic knowledge of PHP" You're far too modest! -
ExpressionEngine new pricing structure and how ProcessWire could benefit
Marty Walker replied to panictree's topic in Pub
I stopped using EE about a year ago. I didn't see all these EL changes coming but the multiple pages of ongoing bugs and having to install a multitude of add-ons to do simple stuff just got tedious. That and the painful upgrade process/add-on compatibility made maintaining a site excruciating. It made selling it to clients a no go. EE is generally a good product and the developer community have created a wealth of good add-ons. But that has inadvertently stifled any EE development. I can't think of a new feature they've brought out in the last two years whilst the bug list keeps growing. I think it's become a platform for developers to make a few bucks - and not that much from what I've read. The EE community can be really one-eyed too and the loudest are those that have hinged their business on using EE and don't/won't consider using anything else. While it's not a particularly healthy thing, they're generous and helpful as well. I don't miss using EE one bit and I'm honestly impressed beyond belief that I can do 99% of the work I used to do in EE (and add-ons) now with PW. Cheers Marty -
Thanks Ryan. It took me a while to get around to buying it... which I have today .
-
Hi Ryan, Say for example I have a jobs listing section on my site and I have a generic 'apply here' application form for each job. Would I be able to vary the recipient email based on where each job was located? Regards Marty
-
ProcessWire Conference 2013 / London / Cambridge
Marty Walker replied to ryan's topic in News & Announcements
Congrats Ryan! -
Thanks Pete!
-
And that is to have a job board where people who need help with some aspects of ProcessWire that should really be handed by folk who know what they're doing with the API and PHP. Hint: I've got some jobs on that I could do with some help with. I know some of you work full time elsewhere so it'd be great to be able to post a request for paid help - this is client work after all. And because I don't want to have to use anything else except PW! Regards Marty
-
Best way to organize categories.. in this case
Marty Walker replied to maba's topic in General Support
Hi, This topic might have some answers for you: http://processwire.c..._toys#entry2266 Regards Marty -
I add something similar to the bottom of all my PW installs which just leaves some low priority items when I run Google Page Speed.
-
Congrats to Ryan and everyone!
-
The problem you might have (I think) is if you change the fieldtype from Image to cropImage, it automatically creates a default thumbnail so you can't test for the absence of one and use your original Image fieldtype-cropped image. I might be totally wrong here though. If you were using a one-page-per-image setup it might be easier because you can just serve an alternative cropped image. [example written in the browser so not sure it works exactly] <?php $featured = $pages->get("/page/")->children; foreach($featured as $feature) { $thumbnail = $feature->thumbfield; /*check for the thumbnail field */ if(!$thumbnail) { $thumbnail = $feature->imagefield->size(400,500); /* if no thumbnail field just use the regular image field */ echo "<img src='{$thumbnail->url}' alt='{$feature->title}'/>"; } else { echo "<img src='{$thumbnail->getThumb('thumbs')}' alt='{$feature->title}'/>"; } Regards Marty
-
Solved $image->size(); configuration questions
Marty Walker replied to 97s's topic in General Support
A couple of options for you might be: Antti's Thumbnails module: http://modules.processwire.com/modules/fieldtype-crop-image/ - for the images where centre cropping isn't sufficient. something like phpThumb where you can specify a zone to crop from - top left, centre left, top middle etc. To do that you could have a custom field with each of phpThumbs as an option. Regards Marty -
Oh I know . I meant in terms of moving a repeater from one page to another.
-
I tend to build portfolio sites using like your current tree. It is a little more tedious but it's worth it over using a simple image field. As you say you can have as much info there about each photo as you like. I haven't used repeaters for the simple reason that some of my clients like to move images around. Like moving a photo from gallery 2 to gallery 1. I'm not sure how you would do that if you were running with a repeater setup.
-
+1 - I've no idea how difficult that is though.
-
Very nice work. That's an great time-saver!
-
I know it's not 'clean' but you could do it with this: http://www.madeincima.it/en/articles/resources-and-tools/easy-list-splitter-plugin/
-
If saves an extra click it's an improvement.