louisstephens

Members
  • Content count

    150
  • Joined

  • Last visited

Community Reputation

44 Excellent

About louisstephens

  • Rank
    Sr. Member

Recent Profile Visitors

1,542 profile views
  1. 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.
  2. Duh, once again overcomplicating things. Thanks @LostKobrakai, I missed the forest for the trees.
  3. 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; }
  4. 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).
  5. 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.
  6. 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
  7. 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.
  8. 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.
  9. 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.
  10. 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.
  11. I believe @LostKobrakai had something about this here: $field->collapsed = Inputfield::collapsedNever; However, someone please correct me if I am wrong.
  12. I am not sure what is going on in your case (I am sorry I dont have an answer). However, $page->BackgroundImage->url should return the pull path to the image.
  13. @Robin S, you are correct about that. I was just editing my response as I copied the wrong links out of text file when I was posting my response. My apologies, I am going to go back and edit my response.
  14. As everyone else has stated, The repeater Matrix has a much better UX than page tables. You can rearrange sections and add multiple "blocks" of the same template to the table. I have just started testing it, and so far I am enjoying it.
  15. PHPmailer is a great library that I have been using to handle all my emails. I simply "drop in" my email credentials and it is basically good to go, albeit with a bit of minimum set up.