-
Posts
1,147 -
Joined
-
Last visited
-
Days Won
4
Everything posted by onjegolders
-
Just saw this. A fantastic read and more than anything else, it just reaffirms the view for beginners that high-quality work is definitely achievable with Processwire. Case studies like this I think are definitely a confidence boost for any other designer using this system. Would be great to see a few more, and for different types of site.
-
Oh God I don't want to become infamous! Will have to try and write some useful posts for once!
-
No sorry, it's working for superusers but editors (which is the only other group I have) cannot delete, but they can delete from within the entry (edit->delete)
-
Sounds good Apeisa!
-
Thanks Ryan, the level of detail really helps me understand better. Out of interest, what would your 'tree' look like? Country as an example is a page with children and on a particular tour, you'd select the country to reference to? I keep finding in these early days that I'll get lost between templates and pages, I'll create a sub page and then realize that I have to go back into one or two templates and change the family settings, but I'm sure I'll pick it up. I'm also a bit unsure still over unpublished/hidden. I think a massive strength of PW over something like EE is the control over relationships and also reordering, which was an incredibly difficult process. I guess I found EE was very good for my needs as most of my site's editors will never really be creating new main pages, just adding subpages or 'content' as I think of it. They add a new article, my templates populate the blog index and view page. They enter a new event, it would be pulled into homepage and events page etc. So I find a lot of my effort has been going into 'closing down' the parent pages. I think when set up though, as you show with your tripsite example (great site by the way) it becomes very powerful to relate things to each other. Thanks once again for being so helpful, it makes such a big difference!
-
Sorry, tried on OSX and Windows, both with JS. Can I give you any more info? It works great for me as a superuser.
-
My users are having problems deleting. It just returns them to main admin page and says that they are logged in? The traditional method of edit then delete works for them however. Any ideas? Thanks Nico
-
No problems Soma, you're right, I did find the answer with a bit of searching, the solution was exactly the one you suggested.
-
It's OK, I've figured it out thanks. I added a $required_fields array and looped that instead of $form.
-
Thanks Soma for that link I understand it's possible in PHP, I was just looking for help within the context of this code. Thanks anyway Not sure I understand. Some fields users may choose to fill in to provide further information but are optional. If I delete them, the values won't get sent with the form.
-
Would it be possible to take that code and only make some of the fileds "required"? As it is the user has to enter every field for the form to process.
-
Just wanted to add that this forum really is beautifully designed, makes it a pleasure to get involved with the topics. Probably a bit too much, I should get on with some coding...
-
Good plan! I know what you mean about EE's configuration. Having used it for 6 months, it seems like second nature for me to set up channels and field groups and then link the two but I guess in the beginning there was initial confusion. I'd be quite interested to know what your workflow was like when starting a project in PW: Assuming you already have a static site, would you start adding all your templates, then all the fields, or vice versa, or back and forth between templates, fields and pages and then do you deal with permissions all at the end?
-
Thanks for your answers and for helping me to understand. It's quite confusing at my level to know where to put the form and where the logic, I suppose the success or failure message would always have to come before or after the actual form. I will take a closer look in the morning but I'm really grateful for the time you took to show me around
-
Wow Soma, I can only thank you for putting so much time in to help me out. I've tested your code "as is" and the email gets sent perfectly. I am a bit confused however about the structure. What exactly is happening before the form HTML gets called through? Can i remove the print_r? Also you mention alternative version at one point, is this duplicate code, should I be using one part or another? Sorry for the questions and thanks again for taking the time to write.
-
What problems you found when moving from EE
onjegolders replied to onjegolders's topic in Getting Started
Good point, I just like the class method I guess. -
sorry, I removed $sanitizer from this just to check in case that was what was failing. I've been looking at this code for hours and still no clue as to what's wrong! Think I may have to fall back to a simple PHP form I've used before otherwise, except it has no validation or sanitizer
-
I'd love to help out but think it's pretty early days for me so far! I feel that it may actually be the 'back-end' where most of the head-scratching goes on (that could just be me though). We're lucky that the community and yourself back this product so much that the answers are nearly always out there.
-
What problems you found when moving from EE
onjegolders replied to onjegolders's topic in Getting Started
Thought I'd just add what the forum helped me find. If you are looking for a replacement for the "if count" and "switch" methods in EE then the following code may help you. I should point out that there may be better ways of doing this but I find it understandable enough to consider it re-usable for my needs: // set class then add classes to first, last and even boxes. $class = 'blog_box'; if ($blog_entry->getItemKey($entry) % 2) {$class .= ' blog_box_even';} if ($entry == $blog_entry->first()) {$class .= ' blog_box_first';} elseif ($entry == $blog_entry->last()) {$class .= ' blog_box_last';} echo "<div class='$class'>"; echo "<p>Content here</p>"; echo "</div>"; -
I think you're right, changing the template's family seems to be the best option. Think that's why a continued site walkthrough would be so useful as it would show such instances where you want to lock down parents. I think front-end it's great that PW gets out of the way and just offers 'helpers' back-end can sometimes be a bit harder to get the head around!
-
At what point should can I echo $error? I echoed it in the final else statement but didn't see anything. Here is whole contact page markup <?php include("./header.inc"); ?> <p class="italic_header">If you'd like to get in touch regarding tuition, please use the form below.</p> <form action="" method="post" id="contact_form"> <fieldset class="first"> <h6>About yourself: </h6> <label for="name">Your name: </label> <input type="text" name="name" autofocus> <label for="email">Your email: </label> <input type="email" name="email"> <label for="phone">Your phone number: </label> <input type="phone" name="phone"> </fieldset> <fieldset> <h6 class="mt60">Your tuition: </h6> <label for="subject">Subject: </label> <select name="subject" id="subject" /> <?php foreach ($page->subject_options as $subject) { echo "<option>$subject->subject_option</option>"; } ?> </select> <label for="level">Level: </label> <select name="level" id="level" /> <?php foreach ($page->level_options as $level) { echo "<option>$level->level_option</option>"; } ?> </select> <label for="hours">Hours per week: </label> <input type="number" min="1" max="40" value="2" name="hours"> </fieldset> <div class="clear"></div><!-- /.clear --> <fieldset class="full"> <label for="message">Additional information: </label> <textarea name="message" cols="30" rows="10"></textarea> <input type="submit" value="submit" id="submit"> </fieldset> </form> <div id="contact_side"> <h6>Or you can find me, here: </h6> <ul> <li>Skype: <?php echo $page->skype_name; ?></li> <li><a href="<?php echo $page->fb_url; ?>" target="_blank">Facebook</a></li> <?php if ($page->twitter_url) { echo "<li><a href='$page->twitter_url' target='_blank'>Twitter</a></li>"; } ?> </ul> <?php // set this to the email address you want to send to (or pull from a PW field) $emailTo = 'me@me.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( 'name' => $input->post->name, 'email' => $input->post->email, 'phone' => $input->post->phone, 'subject' => $input->post->subject, 'level' => $input->post->level, 'hours' => $input->post->hours, 'message' => $input->post->message, ); // 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 = "<h2 class='error'>Please check that you have completed all fields.</h2>"; } // if no errors, email the form results if(!$error) { $subject = "Contact Form"; $message = ''; foreach($form as $key => $value) $message .= "$key: $value\n"; mail($emailTo, $subject, $message, "From: $form[email]"); $sent = true; } } if($sent) { echo "<h2>Thank you, your message has been sent.</h2>"; // or pull from a PW field } else { echo "<h2>Sorry, that didn't work.</h2>"; } ?> </div> <!-- end contact side --> <?php include("./footer.inc"); ?> Thanks for the help.
-
Sorry Apeisa you're absolutely right. Upon submit, it just outputs the 'else' statement ("Sorry that didn't work") Edit: so I'm guessing that means - no errors, but didn't get sent?
-
Can't seem to get this form sending, have slightly modified Ryan's code but not working, code is below. Any one have any ideas? <?php // set this to the email address you want to send to (or pull from a PW field) $emailTo = 'me@me.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( 'name' => $sanitizer->text($input->post->name), 'email' => $sanitizer->email($input->post->email), 'phone' => $sanitizer->text($input->post->phone), 'subject' => $sanitizer->text($input->post->subject), 'level' => $sanitizer->text($input->post->level), 'hours' => $sanitizer->text($input->post->hours), 'message' => $sanitizer->textarea($input->post->message), ); // 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 = "<h2 class='error'>Please check that you have completed all fields.</h2>"; } // if no errors, email the form results if(!$error) { $subject = "Contact Form"; $message = ''; foreach($form as $key => $value) $message .= "$key: $value\n"; mail($emailTo, $subject, $message, "From: $form[email]"); $sent = true; } } if($sent) { echo "<h2>Thank you, your message has been sent.</h2>"; // or pull from a PW field } else { echo "<h2>Sorry, that didn't work.</h2>"; } Thanks
-
Thanks Apeisa ended up reuploading the inputfield TinyMCE and all works again
-
Just transferred site from local to dev and while ftping folders, I got an error with some TinyMCE files, now when I login I see the textarea has replaced the TinyMCE fields. Any idea which filles/folders need looking at? I'm guessing it's a permissions issue?