Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/02/2018 in all areas

  1. PW is still supoorting it if you are using the delayed output strategy in your templates. $useMain has become kind of a convention when using this strategy, but infact, it is just a user defined variable. You could call it $includeMain or whatever you want. How I use $useMain: 1. in my _init.php I define $useMain = true; So it is true by default and the _main.php will be appended to all template php files. In the top area of the _main.php I do somethinmg like this if(!$useMain) return; // if $useMain is set to false in a template php file, then do not render _main.php Then in the template where I don't want _main.php to get appended, I set $useMain = false; In your case, when you don't want to have _main.php appended for AJAX calls you can do this in the template that receives the AJAX request if($config->ajax) $useMain = false; Of course this concept only works for the delayed output strategy.
    4 points
  2. In the beginning of the year, I relaunched the website of P. Jentschura and it took some time to publish the case study for it, but here it is (only in german atm, but you could use a translator tool). Wie wir P. Jentschura halfen, die Conversion Rate zu erhöhen, neue Interessenten zu gewinnen und eine Erfolgsmessbarkeit einführten. Translated title: How we helped P. Jentschura to increase the conversion rate, win new customers and measure success. I plan to publish the case study in english also, but it could take some time.
    3 points
  3. Try adding title template.name in a template's Advanced tab, under "List of fields to display in the admin Page List. Not sure if it works with 2.7.2.
    3 points
  4. @Karl_T Glad it works. Using markup regions implies the use of the delayed output strategy. So your good to go ? $useMain was introduced in the advanced site profile that ships with PW and has been around for quite a while. Since many people adapted that, you see $useMain mentioned a lot throughout the forum. But it has nothing to do with the API.
    3 points
  5. @adrian, maybe the module needs a try/catch to show the login throttle message rather than the 500 error?
    2 points
  6. What you want is AdminOnSteroids - it has lots and lots of goodies
    2 points
  7. No, I haven't tried this time but recently I've added buttons to it. Just wanted to mention this because this feature could be useful also to others (or am I the only one blessed with such a client? :))
    2 points
  8. 2 points
  9. Hey @bernhard any updates on a release date or progress with RockDataTables? RockFinder repo at gitlab even mentions, that you renamed it to RockGrid?! I can't wait to get this module into my hands.
    2 points
  10. @simonsays Something like that: class Migration_xxxx_xx_xx_xx_xx_xx extends FieldMigration { public static $description = "Create field"; protected function getFieldName(){ return 'field_name'; } protected function getFieldType(){ return 'FieldtypeOptions'; } protected function fieldSetup(Field $f){ $f->label = 'Label'; $f->inputfieldClass = 'InputfieldRadios'; $options = <<< _END 34 36 38 40 42 44 46 48 _END; $f->type->manager->setOptionsString($f, $options, true); } }
    2 points
  11. Martijn's simple couple of lines works great too - I used it to make sure users who are currently logged in and are changing their passwords on a front-end form weren't just re-entering the same password or using it as part of their new password (sticking a 1 on the end or something ).
    2 points
  12. Hi @adrian, what do you think of adding a Facebook Sharing Debugger panel to the module? It requires login and there's no GET way to force "Scrape again" (as I know) but still it would make easier to check the opengraph data on a page. For me a simple link would suffice (unlike the Validator panel).
    2 points
  13. Thanks @Pete, Stuff on the left side seem a bit squished?
    2 points
  14. Hi @renobird I keep getting these since I've been using the module: 2× PHP Notice: Trying to get property of non-object in .../modules/MarkupActivityLog/MarkupActivityLog.module:405 2× PHP Notice: Undefined variable: fieldID in .../modules/MarkupActivityLog/MarkupActivityLog.module:370 And because I use Tracy, they kept popping up in the debug bar but today I though it is just enough of them and applied these: if (!isset($fieldID) || $fieldID == null) continue; https://github.com/Renobird/MarkupActivityLog/blob/9d37de692b74185e6391828806c84b730ab07630/MarkupActivityLog.module#L370 also: $string = is_object($field) ? $field->className : $field; switch($string) { https://github.com/Renobird/MarkupActivityLog/blob/9d37de692b74185e6391828806c84b730ab07630/MarkupActivityLog.module#L404 I don't know if this is enough but the module seems to work as before but without the notices.
    2 points
  15. Sure, I can add workarounds, just wanted to share these, thanks.
    1 point
  16. Hi @tpr - I'll have to have a think about the password only option at the month when I will have a little time. There are some other options I would also like to add, so might be time for a bit of a revamp. Yes, SLT will always get involved because this module uses the regular PW login process. Not sure a way around that (or whether you should really want a way around it) without changing how access is granted.
    1 point
  17. Not sure if it's all servers, but I am finding the downloading a package from Setup > Duplicator is resulting in partial downloads. I don't have time to investigate at the moment, but just a heads up in case someone is trusting the download to be complete.
    1 point
  18. You can change label field globally in the setting of ProcessPageList module - {title} | {template.name}
    1 point
  19. @pwfans i have it running well on a large PW3 site. Did you run into some problem? I didn't need to add any namespace or do anything in particular, it just works.
    1 point
  20. Hi All, Apologies for the radio silence. This module has evolved quite a bit to suit some very specific needs at my day job. So I now have a private version that is much more robust, but far too customized to release. I'll get my head around where things are with the current public version and take a look as these pull requests as soon as I can. @jmartsch Other than tracking the changes from the beginning, I don't think there is any way to determine the first time the field was changed. I could be misunderstanding what you need though.
    1 point
  21. I remember that $this->halt() appears somewhere in the forum too. Just check. This works as well. Thank you!
    1 point
  22. Hi @MarcoPLY. I love this module and use it alot but find that it needs a lot of TLC after not having much activity over the last few years. I usually work on my own copy of it for different needs as my pull requests never get looked at. https://github.com/benbyford/PaymentStripe My suggestion is to make a copy and work on the code yourself or pay someone to add the functionality you need. The currency options never worked for me either simply becuase it was never really implemented in the module (not sure about the paypal one as i never use it).
    1 point
  23. @Zeka I added the link to my article. Thanks again.
    1 point
  24. When I need to return something totally different from a template file, I'm doing something like this: if($config->ajax) { echo <Whatever>; $this->halt(); return; } Works ok for me.
    1 point
  25. Try to add PW namespace at the very top of the .module file: <?php namespace ProcessWire; Lots of older modules can be made PW3-compatible that way... worth a try anyway.
    1 point
  26. Thanks @gebeer! It works with your method. I am using markup region by the way. I thought this variable was some kind of core API.
    1 point
  27. OK, I had a quick look at the source of Duplicator.module On line 640, there is a "isWritable" check: if(!$f->isReadable() || !$f->isWritable()) { continue; } Why does the file to copy have to be writable? My "wire" folder is not writable by "wwwrun" because it is not necessary, it has to be readable though. If I remove this check, it works as before. Thank you.
    1 point
  28. If I'm going to type that out I might as well create the GitHub issue: https://github.com/processwire/processwire-issues/issues/583
    1 point
  29. Why don't you just crop the thumbs with something like $image->size(320,240,$options)->url, so they 're all equal.
    1 point
  30. <?php if($image->width > $image->height) { echo "Width : `{$image->width}px` bigger than height : {$image->height}px !"; } else { echo "Height : `{$image->height}px` bigger than width : {$image->width}px !"; }
    1 point
  31. I think you can take a look at the CSS "object-fit" rule. See this codepen: https://codepen.io/akb20/pen/EPoPpx
    1 point
  32. If it's always going to be just this one exception, this if/else is OK. If in the future there will be more image varieties, maybe use something like isotope / masonry? Another method is to always create a page-id / page-parent-id body class, and then you can use the same image class, and create variations in your CSS.
    1 point
  33. Hi everyone We've just upgraded the forum software to the latest version. There were a few tweaks that needed to be re-applied to the templates but I think I've got them all. If you do notice anything out of the ordinary, please let me know here. EDIT: The forums may run slower than usual for the next couple of hours as part of the process re-indexes all of the post content.
    1 point
  34. I have just released an updated version without autoload. I also added a few helpfull closures to the readme, as well as hook-able methods: https://github.com/noelboss/PageQueryBoss#helpfull-closures--tipps
    1 point
  35. try this... this is better.... $str=""; foreach($pages->find("parent=/Availability/, include=all,Studio=$page->id") as $e){ $str.= "{$e['Studio']},{$e['Date']},"; foreach($e['ta'] as $selected){ $str.= "{$selected->title}|"; } $str.= "\n"; } echo $str;
    1 point
  36. This is sort of the essence of what I'm dealing with, but there are some legacy routing and session details that need to be dealt with. And I think I have the solution now! A vast majority of the requests will be satisfied by the PW app. Why not just put all this redirect logic into a PW 404 template?? Would you agree?
    1 point
  37. Well, since you prepend _init.php in PW, simply put your logic there. What kind of data is it anyway? Are we talking huge datasets in GB, or something that could be stored in a JSON file anyway? Perhaps you could run a cron job that produces a file which holds your data that needs to be pre-fetched, and do your if/else logic inside _init.php. I wouldn't really mess with the PW index.php. If it's a simple situation where you want to check if a certain page already exists inside PW, or whether you need to redirect users to the old page, then you could write simple .htaccess redirect rules. (migration / transition phase between current active system and new system which is not yet live)
    1 point
  38. Hey @bernhard - I get your issue with empty vs bloated for sure. When I get some time I'll look into the possibility of a check for an empty object, although I do think that maybe that's something the PW wire __debugInfo method might be the best way to handle this. Just an FYI - Ryan just added a detailed PageFiles __debugInfo() method, so now we get this in the Request Info panel, which is pretty nice!
    1 point
  39. i haven't worked on this ajax module for several months so it really is not ready, but i do have a working version if you want to try it. It needs testing, and work; The screenshots show some elements of the setup in case of any confusion. ---the field--- ---the files--- InputfieldSelectizeAjax.js InputfieldSelectizeAjax.module
    1 point
  40. So at least we have more than 8800 sites using Processwire https://publicwww.com/websites/"X-Powered-By%3A+ProcessWire"/ @jmartsch take a look at this link
    1 point
  41. I have made a pull request. You may take the changes for use before the module update. Code changes to support ListerPro
    1 point
  42. I can see two issues there: The Content-Transfer-Encoding needs to be 8bit to support raw utf8 characters The subject needs to be encoded using either quoted-printable or base64 (quoted-printable is most common there, as it leaves parts of the subject readable) Changing the affected functions like this in WireMail.php should get things working with umlauts: public function subject($subject) { //$this->mail['subject'] = $this->sanitizeHeader($subject); $this->mail['subject'] = '=?utf-8?Q?'.quoted_printable_encode($this->sanitizeHeader($subject)).'?='; return $this; } public function ___send() { $header = ''; $from = $this->from; if(!strlen($from)) $from = $this->wire('config')->adminEmail; if(!strlen($from)) $from = 'processwire@' . $this->wire('config')->httpHost; $header = "From: " . ($this->fromName ? $this->bundleEmailAndName($from, $this->fromName) : $from); foreach($this->header as $key => $value) $header .= "\r\n$key: $value"; $param = $this->wire('config')->phpMailAdditionalParameters; if(is_null($param)) $param = ''; foreach($this->param as $value) $param .= " $value"; $header = trim($header); $param = trim($param); $body = ''; $text = $this->body; $html = $this->bodyHTML; if($this->bodyHTML) { if(!strlen($text)) $text = strip_tags($html); $boundary = "==Multipart_Boundary_x" . md5(time()) . "x"; $header .= "\r\nMIME-Version: 1.0"; $header .= "\r\nContent-Type: multipart/alternative;\r\n boundary=\"$boundary\""; $body = "This is a multi-part message in MIME format.\r\n\r\n" . "--$boundary\r\n" . "Content-Type: text/plain; charset=\"utf-8\"\r\n" . //"Content-Transfer-Encoding: 7bit\r\n\r\n" . "Content-Transfer-Encoding: 8bit\r\n\r\n" . "$text\r\n\r\n" . "--$boundary\r\n" . "Content-Type: text/html; charset=\"utf-8\"\r\n" . //"Content-Transfer-Encoding: 7bit\r\n\r\n" . "Content-Transfer-Encoding: 8bit\r\n\r\n" . "$html\r\n\r\n" . "--$boundary--\r\n"; } else { $header .= "\r\nContent-Type: text/plain; charset=\"utf-8\""; $body = $text; } $numSent = 0; foreach($this->to as $to) { $toName = $this->mail['toName'][$to]; if($toName) $to = $this->bundleEmailAndName($to, $toName); // bundle to "User Name <user@example.com" if(@mail($to, $this->subject, $body, $header, $param)) $numSent++; } return $numSent; } If the names in From: or To: headers contain umlauts, they also need to be properly encoded. My fix for the subject() function above is a bit crude, as it doesn't care for long lines that should be wrapped. There's also the mb_encode_mimeheader function in PHP which does wrapping but doesn't care for word boundaries and might cause superfluous whitespaces in between words.
    1 point
  43. Think you can use // authenticate returns true or false // ps: User is a user object if ($session->authenticate($user, $pass)) { echo 'yep password is the same'; }
    1 point
  44. After editing an image (crop, focus, resize,etc), images order cannot be re-arranged by dragging until you clicked the images grid style on the top right hand corner I did try the latest 3.0.98 master version. Is it a bug or normal behavior ? I recorded a video to demonstrate
    0 points
×
×
  • Create New...