• Content count

  • Joined

  • Last visited

Community Reputation

54 Excellent

About louisstephens

  • Rank
    Sr. Member

Recent Profile Visitors

1,610 profile views
  1. In addition, you might want to check out phpmailer. I have been using it for a while, and have not had any issues with it (knock on wood). It was really easy to set up as well.
  2. Well this was what I was missing... However, this just confuses me way more. Getting used to php was tough enough.
  3. I was working on a simple "to-do" style template that has a form on a page. Once the form is submitted, I use the API to create a new subpage under a pre-existing page, but I notice that it does resubmit the form data (as to be expected) if a user were to refresh the page. Is there a way to prevent this behavior so duplicate content will not be posted by using something like exit(), or is this not proper due to usability? I guess I am curious as to how other developers handle the same hurdle.
  4. Couldn't you create a new "Fieldset in Tab" and place the desired fields within the tab when editing the template?
  5. I have been wanting to set up a quick "dashboard" for a recent project, and was considering using ajax to get a "real time" update/refresh on the page (some of my output depends on the datetime field). I know how to get the desired output using php with some if statements comparing todays date to the date stored in the field, however, I am a bit at a lose of how to interact with the ProcessWire API using ajax to get the desired effect. I found the following and know that I need to start off with: <?php if($config->ajax) { // page was requested from ajax } Unfortunately, as I mentioned earlier, how would one actual find pages using a template and get the field contents from them using AJAX? I apologize if this seems bit broad, but I am stil getting a grasp of using AJAX to deliver content to get a real time update on a page without refresh.
  6. Duh, once again overcomplicating things. Thanks @LostKobrakai, I missed the forest for the trees.
  7. I have been scratching my head on this one for a while, so I thought maybe someone could shed some light on this issue. I am using a grid layout (that I have created over the years) with a class for responsive images (very similar to bootstrap, but very stripped down). Using this, I created a gallery using a foreach loop, and included a "print button" to print each image. I got the classes and everything worked out, but I ran into a small problem with the print functionality. My images (which are around 2400px wide to fill the space) are just fine in the grid and on resize, but when I print, they "run off" the page. I understand that they are just too big to be printed in portrait mode, which led to me think that I could use $image->size(); to print a scaled down version of the image (which adds a bit more load time as now the site needs to load the image large scale and the scaled down version). However, I can't seem to wrap my head around serving just the scaled down version for print only (obviously display:none; doesn't do the trick). Has anyone tackled this before, or does anyone know of a more elegant solution to the conundrum that I have found myself in? The Foreachloop: $printclass = 1; foreach($page->galleries as $gallery) { $printclass++; $printimage = $gallery->gallery_image->width(600)->url; $out = ""; $out .= "<div class=\"row\">"; $out .= "<div class=\"grid-12\">"; $out .= "<img src=\"{$gallery->gallery_image->url}\" class=\"reimage\"/>"; $out .= "</div>"; $out .= "</div>"; $out .= "<div class=\"row\">"; $out .= "<div class=\"grid-12\">"; $out .= "<a href=\"#\" onClick=\"printCoupon('printable{$printclass}');\">Print</a>"; $out .= "</div> "; $out .= "</div> "; $out .="<div id=\"printable{$printclass}\"><img src=\"{$printimage}\"/></div>"; echo $out; }
  8. Have you looked at the template in the backend of processwire and checked to make sure that the checkbox for "Disable automatic prepend of file: _init.php" is unchecked? I believe by default processwire appends this file to all templates (unless you uncheck it) giving access to what is defined in init (someone please correct me if I am wrong).
  9. Yeah, this is really weird, it is installed in php 5.6.10, but not for php 7 . Perhaps there is a reason (that I am not aware of yet) that php 7 doesnt have the extension in MAMP.
  10. In going through the errors in the console (Attached to MAMP Pro 3), it appears that there is no file for imagick.so, so I assume Ill need to find this .so file somewhere
  11. Thanks @BitPoet for the help, I checked phpinfo(), and found which php.ini was being used and noted that extension=imagick.so was not commented out. I also checked the template, which also had it set to "on". I am pretty baffled with this right now.
  12. Not sure if anyone out there has successfully solved this yet (nor if this is the correct place to post this), but I am kind of stuck on this. I normally use MAMP pro 3 for setting up my dev work flow, and wanted to play around with ImageMagick. I knew I had to enable the extension in MAMP, which I simply just removed the ";" in front of extension=imagick.so in the php.ini and restarted the servers. However when I tried to install the module, i get the following error: Unable to install module (ImageSizerEngineIMagick): This module requires that you have PHP's IMagick (Image Magick) extension installed From what I have read, the extension should be installed and activated after I followed the simple steps, but processwire doesn't seem to recognize that it is activated. Has someone encountered this issue yet? I am using php v7 with an install of processwire 2.8.35.
  13. I don't believe it is a core module in processwire. However, if you go to Modules->New and paste in "TracyDebugger", you can add it to your processwire install.
  14. I was confused at first of why the test I just made worked (with the same file name being uploaded), but quickly realized why. If you dont have "overwrite existing files" checked in the settings for the two fields, it will allow you to have the same file (appends a -number to the end of the file name). I don't know if having the -number on the file messes how you are calling them in a template, but it is a possible quick workaround. But as adrian said, you could just download from the images field.
  15. I believe @LostKobrakai had something about this here: $field->collapsed = Inputfield::collapsedNever; However, someone please correct me if I am wrong.