Jump to content

louisstephens

Members
  • Posts

    516
  • Joined

  • Last visited

Everything posted by louisstephens

  1. Yeah, apparently the code I had in place was actually ok. It was an issue with my localhost set up. The emails were being seen as "spam" so they got rejected. I appreciate all the help!
  2. I thought I had it with: <?php if($page->rootParent->hasChildren) { echo $page->children; } ?> But I guess I am missing something important here.
  3. I was wondering if anyone has used forwardhosthq (https://forwardhq.com/) to serve a localhost to other users. I got it set up and working, but currently users can not log in and view the backend. What do I need to do to allow users to actually interact with the back end? Example host https://mychosenusername.fwd.wf
  4. Sorry about that Macrura. I hastily built that field earlier but do plan on changing it to match the others. I appreciate the insight from everyone!
  5. Sorry If i was a bit confusing earlier. What I was trying to do was create one form, where the "send to" could be changed dynamically (as this will be used on seperate pages). I got the form set up with one small issue. I cant seem to figure out to "echo" the email address into the email: <?php include("./head.inc"); echo $page->body; $sent = false; $error = ''; $emailTo = 'email@gmail.com'; // or pull from PW page field // sanitize form values or create empty $form = array( 'fullname' => $sanitizer->text($input->post->fullname), 'email' => $sanitizer->email($input->post->email), 'comments' => $sanitizer->textarea($input->post->comments), ); // 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='error'>Please check that you have completed all fields.</p>"; } // if no errors, email the form results if(!$error) { $msg = "Full name: $form[fullname]\n" . "Email: $form[email]\n" . "Comments: $form[comments]"; mail($emailTo, "Contact Form", $msg, "From: $form[email]"); // populate body with success message, or pull it from another PW field echo "<h2>Thank you, your message has been sent.</h2>"; $sent = true; } } if(!$sent) { // sanitize values for placement in markup foreach($form as $key => $value) { $form[$key] = htmlentities($value, ENT_QUOTES, "UTF-8"); } // append form to body copy echo <<< _OUT $error <form action="./" method="post"> <fieldset> <p> <label for="fullname">Your Name</label><br /> <input style="width:300px;" type="text" id="fullname" name="fullname" value="$form[fullname]" /> </p> <p> <label for="email">Your Email</label><br /> <input style="width:300px;" type="email" name="email" id="email" value="$form[email]" /> </p> <p> <label for="comments">Comments</label><br /> <textarea style="width:300px;" id="comments" name="comments" rows="6">$form[comments]</textarea> </p> <p><input type="submit" name="submit" value="Submit" /></p> </fieldset> </form> _OUT; } // include site's footer include("./foot.inc"); The way my install is set up: I have multiple copies of the same page, all with a different header called (header_select). Header_select contains the field "contactAddress". I need to get the contactAddress (based upon which header is chosen for that given page), and then pass that to the $emailTo field.
  6. This has probably been asked a million times, but I can't seem to find an answer. I have always just used a php script to process the emails and was excited that I could pass in an email address from a page to the script using $page. However, this does throw a 403. I was told that I shouldnt be doing it this way, but I was wondering how do you all go about handling emails? I was going to use the same page template, but I need the option of changing out the to email address dynamically.
  7. I found what I was looking for: "Page Edit Per User".. Sorry for the confusing post earlier. I guess my only question is how do you actually add the ability to edit a page?
  8. A dumb question I am sure, but how would you go about passing it to the template page (best practice). The engine.php will be used by several other pages that in theory will have different email addresses .
  9. Thanks Mike and Ivan. I totally did not even think of creating a template "engine" to handle this.
  10. I have a contact form that feeds to a engine.php. However when I go to fill it out, I get a 403 error )permission denied. I am using mamp, so maybe it is an issue with this. However, I was wondering if anyone else had run into this problem before. I have the url to the .php file using " <?php echo $config->urls->templates?>form/
  11. Yeah, I am slowly getting there. I did notice after doing some more research into the basic install that: "// top navigation consists of homepage and its visible children". However, what I was trying to snag were the children of a child. For example: Home - Fish - Bass - Brim - Carp - Site Map - About In the above example, I was trying to pull the children of "Fish". Perhaps I set this up wrong as I couldnt figure out a way to get "Fish" to be top level like Home.
  12. Thanks diogo. I do appreciate the help. Still feeling my way around Processwire (came from Wordpress) and I still am trying to tackle things with that mindset.
  13. Ah ha. That was easy enough I did notice that it displays the Id, how would you display the actual Page Name/url?
  14. I have been scratching my head on this one for an hour. How do you get the parent (of the current child page) and list all the children for a navigation.?
  15. Thanks Renobird. I meant to reply earlier, but got lost in repeaters and various other field types. That did the trick.
  16. My "idea" was to Have the parent pages inline and maybe show the children below (ie dropdown) on click. I guess it really is as LostKobrakai said previously "just a multi-column version of what you see in the 'Children' tab of the page editor". The people that will ultimately be using the dashboard are very used to layouts like wordpress and dropdowns (very into dropdowns).
  17. Ha Ha... I know it's more trouble than it is worth (I actually like the current structure/design). However, I wont be the one looking at the page structure.
  18. Thanks BernhardB. This might be the route to take. I might try figuring out how to list each parent page with the sub pages directly under it: For Example: 1 2 3 4 5 1-1 2-1 3-1 4-1 5-1 1-1 2-1 3-1 4-1 5-1 1-1 2-1 3-1 4-1 5-1
  19. This is very true. I did do a pretty good job of making it confusing. However, I guess I was wanting to make it a bit more cleaned up for other users who would be looking at it. Ill take a look into Lister and see what is involved with tweaking the css/etc in the styles.
  20. I have been looking into this for awhile, but really have not found any module or "template" that handles this. On my test site I have about 80 pages (some nested and some as parents), which is really making the page tree a bit cluttered. I was wondering if anyone else had seen/used a template/module to make the page tree a little more "user friendly" and a bit less cluttered. I know I could probably create a new admin layout for this, but I had no idea where to start.
  21. To answer your question, "the hack on css" is the normal download of Foundation (sans SASS). I have used both bootstrap and foundation in many projects over the last couple of years and they are both quite easy to implement. The only major differences that I have run into with using the two is bootstrap seems to be a bit more documented and discussed by other users, as well as the class names. Bootstrap seems to have a few more resources out there as well if you ever need assistance (ie bootsnipp) where people post snippets of code.
  22. I had just found out about using first();. but had a quick question. Most of the pages will have the default single image as the header, but once in awhile I will need to run a different image in its' place (set to expire). Will the above example cause an issue on the pages that only have the one image and nothing before it in the array?
  23. Thank y'all so much. I believe I was def. overcomplicating things in my head. Ill give this a go and see where I end up.
  24. So I have an odd feature to tackle. I want to include an image in the template (aka a header), but want to implement a function to set a time in the future. Once the time was met, the image will automatically come down (if possible switch to another image, but that is not something Ill worry about now). Now, I set up an image field "timed_image", and I set up the date/time field "select_timed_expire". I also know how to echo the information on the page, but where I am finding issue is actually how to implement this. I could use javascript and pass the date/time to it, but from there I am quite lost on how to implement this. Has anyone done something like this before?
  25. Yeah, I just looked, and it appears that the config file and there is a line: $config->prependTemplateFile = '_init.php'; How would I go about only including this once? Sorry for all the questions, just not the best at php.
×
×
  • Create New...