Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by gmclelland

  1. I just remembered that Drupal has a URL filter built into core. Maybe we can somehow use it's code since it's been battle tested? ...with credit of course. https://api.drupal.org/api/drupal/modules!filter!filter.module/function/_filter_url/7.x - For Drupal 7 In the comments of the Drupal module, it interestingly states "Each type must be processed separately, as there is no one regular expression that could possibly match all of the cases in one pass." There is also https://github.com/thephpleague/uri-parser that looks like it may help, but that would require composer to install the library? Also, I've been testing different regex patterns with https://regex101.com. It's the best regex tester I've found so far.
  2. Could you try something like this? // only allow access to the page if logged in with editing permissions // otherwise throw a 404 if viewed directly if(!$page->editable() && (!count($options['pageStack']))){ throw new Wire404Exception(); }
  3. Hmm... Thanks for the test data. I see the problem as well with the www. urls with a trailing slash. I'll see if I can come up with a alternative regex that works.
  4. Thanks interrobang. I didn't know much about regex either, but I'm learning now! That worked with detecting urls with/without an ending slash, but then I noticed that email addresses were no longer linked. test@something.com gets converted into a link "something.com." I even tried removing the other \b, but it didn't make a difference. Edit: Actually, after playing around some more... If I remove the \b in lines 52 only, everything seems to work correctly. Urls with/without trailing slashes and email addresses are now linked correctly. Can you test that on your end? Do you want me to submit a pull request for this change?
  5. Love the module, but is there any way you could fix the trailing slash(/) on urls not being recognized?
  6. I don't have much time to review these. Not sure if it helps, but here's some of my notes: Online Editors https://c9.io/ - Amazon’s Cloud 9 https://www.koding.com/ - can work on local files and sync remotely https://codeanywhere.com/ https://codenvy.io https://coder.com/ https://gitpod.io - open any github page in an online VScode editor that can create a pull request back to github. Uses Docker. Prefix any github page with https://gitpod.io# ex. https://gitpod.io#https://github.com/arunoda/learnnextjs-demo Test and Share code - Web based IDE https://codesandbox.io/ - can install VSCode extensions see https://hackernoon.com/announcing-codesandbox-v3-4febbaba1963 https://stackblitz.com/ - online VSCode Editor than can run react like CodePen https://repl.it/ https://hyperdev.com/ - like http://plnkr.co/ but better to test and share your code https://snack.expo.io/ https://codio.com/ - full dev stack testing https://glitch.com/ http://runnable.com/ http://codepen.io/ https://codepicnic.com - ex. https://codepicnic.com/posts/that-moment-when-i-showed-my-students-how-to-bring-their-code-to-life-bd686fd640be98efaae0091fa301e613 Maybe one of these would fit your needs?
  7. This is probably too basic of answer, but I believe you can install the "Regular Blog" (site-regular) Profile that comes with Processwire on a test site to see and test how comments work. You can also compare your code with it. You can read more about it at https://processwire.com/blog/posts/introducing-a-new-processwire-site-profile/
  8. pwFoo your uploaded image is broken
  9. Hi MoritzLost, In case you didn't already know... You can also check out https://github.com/wanze/TemplateEngineTwig as a good example of a module that doesn't bundle a php library with the module. In this case you can run: composer require wanze/template-engine-twig:^2.0 --no-dev That one line would install the needed php libraries in the correct vendor folder and install the Processwire module in the correct directory.
  10. If you don't want comments at all on blog posts, you can just delete the comments field from the blog-post template.
  11. Hi Ralf, I haven't used comments yet on my sites, but maybe you could add a new "Disable Comments" checkbox field on the "Blog post" template? Then in site/templates/blog-post.php add a conditional check with PHP that says something like: If "Disable Comments" is false then show the comment box and comments. Then just check the box that say's "Disable Comments" when editing the individual blog post pages and the comments/comments form won't be shown when the page is viewed. Hope that helps
  12. The TracyDebugger module also has a "Module Disabler" panel that can easily disable modules.
  13. #2. Should work. It's working for me. Maybe your browser is caching the wrong .js files? Maybe even try a Modules>Refresh after you make the changes? Can you post your customstyles.js file here so we can see it? Here is my site/modules/InputfieldCKEditor/custom-styles.js Hope that helps
  14. Hi @MilenKo, It's still rough, but feel free to read my notes on the different techniques for flexible page layouts https://docs.google.com/document/d/1peY-FUpevKgy87cKOxIVz8jwcv2-3c61zbiJr3QKO6c/edit?usp=sharing
  15. @Hurme - carefully read my explanation, I think it will fix your problem. If not, try posting the code you are using so that we can see what is wrong.
  16. @V7dev - I know this older, but did you figure it out? Another way you could probably do this via a custom module similar to how it's done in https://github.com/justb3a/processwire-twigextensions. Look at the FileExists Helper in that module.
  17. @Robin S - I would certainly be interested in seeing how that is done. I've always wondered how to search pages that are built in sections with Repeaters/PageTables/PageReference fields.
  18. https://serverpilot.io + https://linode.com works for me. Thanks for the other suggestions
  19. I'm not sure if we are talking about the same thing, but I remember having a similar issue. To get rid of that message, I had add this to my config.php // I receive a warning when visiting the admin area // Warning: your server locale is undefined and may cause issues. Please add this // to /site/config.php file (adjust “en_US.UTF-8” as needed): setlocale(LC_ALL,'en_US.UTF-8'); setlocale(LC_ALL,'en_US.UTF-8');
  20. I'm not fully understanding your question. Are you wanting to update the composer dependencies from within Processwire like the Processwire Upgrade module does? Ex. update a GoogleCalendar library to the latest version? Or.. Are you asking what is the best way to include a third party library within a module? In this case, I would advise NOT including the library directly in the module. Have the user install it separately via Composer. I like how Wanze did it in the new version https://github.com/wanze/TemplateEngineTwig One command ran by the user will download the third party dependency, update the composer.json, install the dependency in the correct vendor folder, and install the module in the correct Processwire modules folder. Here are a couple links you might find interesting: https://processwire.com/blog/posts/composer-google-calendars-and-processwire/
  21. WillyC is right. I forgot that I have that in mine as well.
  22. Change this line from: "<a href=''>Schváliť</a>", to something like: "<a href='{$page->editUrl}&modal=1' class='pw-panel pw-panel-right'>{$page->title}</a>", In my module that would open the page editor in a right side panel. You need to escape those characters in PHP. See https://phppot.com/php/php-escape-sequences/ Hope that helps
  23. Maybe you can use the truncate method https://processwire.com/api/ref/sanitizer/truncate/ ? // Truncate string to closest word within 150 characters $s = $sanitizer->truncate($str, 150); Here is another example of how to use a hook to add a "summarize" method to all the $page objects https://processwire.com/blog/posts/pw-3.0.28/ Here is reset https://secure.php.net/manual/en/function.reset.php Here is explode https://secure.php.net/manual/en/function.explode.php
  24. After reading the Processwire docs, check out https://www.pwtuts.com/ .
  25. Sounds pretty similar to a Drupal based module I just heard about. https://www.drupal.org/project/build_hooks and here is where I read about it https://weknowinc.com/blog/improving-drupal-and-gatsby-integration-drupal-modules Maybe that Drupal module would give you some more ui or functionality ideas?
  • Create New...