Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/27/2021 in all areas

  1. Just in case... add this: https://processwire-recipes.com/recipes/logging-outgoing-emails/ to your setup and you will see each and every mail in the logs. Should only be used in DEV environments... privacy and such... you know.
    2 points
  2. @ryan Just wanted to track down an issue I'm having with PW and a module that's in the works. The module works fine on PW v3.0.181 but not on 3.0.165 so I wanted to go back through the tags on github, bisecting the tag space till I nailed down the minimum version I need to declare in my module. However, the list of tags seems to be very sparse on GH compared to the versions as notified in your blog posts. Could you be persuaded to add a git tag when you bump the version in wire/core/ProcessWire.php file and to push the tags to GH as well? This would make it really easy to install any given version by tag from git/github and allow an easier match with the information published in the blog as well. As always, thanks and best wishes.
    2 points
  3. There is so much significant change in minor releases it seem to make sense. There was at least a couple of times I did try to download specific version of the core to mirror remote installation and it was not as easy as it could be.
    2 points
  4. I really must make more of an effort to add more sites to this forum - we've done some nice work really. Women / Theatre / Justice is a case in point. WTJ is the umbrella title for research and public engagement activities undertaken by academics from various universities in partnership with Clean Break theatre company. Clean Break was founded in the 1970s by two women in prison and focuses on using theatre to help create positive change in the lives of women with experience of the criminal justice system. We wanted to reflect the origins of the organisation so we created a home made 'zine' like design with typewriter fonts and adding noise to the photographs and images to get a photocopied feel: There's not too much bespoke coding going on functionally - we created the usual blog and events as well as a simple photogallery, but most of the technical effort went into working out the best way to apply textures and filters to the images so that the admins could upload new content without needing to phaff around in photoshop ( CSS 'backdrop-filter' for the win). One interesting thing got thrown up in accessibility testing; originally we'd created the design using a fixed with typewriter font and even though we'd set a pretty large font size with good contrast that passed our automated accessibility testing, we found that real world users still had difficulty reading it. So we changed that to a more modern and readable slab serif. Testing with real users is always a good move.
    2 points
  5. A few days ago I stumbled upon this old module, which had been laying in the modules directory of one of my sites since 2017 in a half-finished state. I have no recollection why I left it like that, but figured it might be useful for someone, so here we go: https://github.com/teppokoivula/Snippets https://processwire.com/modules/snippets/ Snippets is a tool for injecting front-end code snippets (HTML/JS/CSS) into page content. The way it works is that you create a snippet — say, a Google Analytics tag — and then choose... which element it should be tied to (there are some pre-populated choices and custom regex option), whether it should be placed before/after said element or replace it entirely, and which pages the snippet should apply to. The "apply to" option also has some ready to use options (such as "all pages" and "all non-admin pages") or you can select specific pages... or use a selector. Snippets are regular markup, with the exception that you can use values from current page (behind the scenes the module makes use of wirePopulateStringTags()). Available hooks: Snippets::isApplicable, which receives the snippet object and current Page object as arguments and returns a boolean (true/false). Snippets::applySnippet, which receives the snippet object, page content (string), variables (an object derived from WireData), and an array of options for wirePopulateStringTags() as arguments and returns the modified page content string. That's just about it. It's a pretty simple module, but perhaps someone will find this useful ?
    1 point
  6. ProcessWire 3.0.182 is now posted on the dev branch. For a review of what's in this version, see the "Latest core updates" section of ProcessWire Weekly #374 and #375 plus this week there have been 12 additional commits with new issue resolutions, improvements and additions which can be found in the dev branch commits log. It's possible that ProcessWire Weekly #376 will also cover some of these updates when it is released too. I'd planned on even more in this version, but ended up losing a day of work yesterday as we had no electricity all day (it happens). So I worked outside in the yard instead— 3 issues were resolved, 4 improvements were made and 1 garage was organized. Focus in the coming weeks is on our next main/master version (core, not yard). If you have a chance, please take a moment to add sites you've built with ProcessWire to our sites directory. And if it's one that's already in the directory, feel free to add it again when/if it goes through a major redesign or redo. I'm really motivated by seeing the great work that all of you do and always enjoy seeing more of it. Plus, I'm thinking @teppo also likely looks at the newly submitted sites when considering the site of the week for his ProcessWire Weekly issues. If you find the existing categories on the submission form don't quite match a site you want to add, please send me a PM to let me know and I may be able to add new categories. Thanks for reading and have a great weekend.
    1 point
  7. Thanks @teppo! I used the code in a search function like you do in the Wireframe docs site. The init method works fine. Thanks for your help and for creating Wireframe and SearchEngine, trying to use them on everything i build nowadays.
    1 point
  8. Seems to be a misconfiguration on the webserver given it's trying to open /home/motatria/public_html/wire and in turn /home/motatria/public_html/wire/index.php as directory indexes are disabled. ProcessWire's entry point index.php is one folder up.
    1 point
  9. Hi Robin S, thanks for pointing me to the right direction - I think I will go with the 4th of your suggestions, since the different templates I have will be mostly seperate from each other and overspilling images/files with one another is likely not going to happen. I thank your for the example code that helps a lot. Many thanks ?
    1 point
  10. Alternatively someone could build/generate a docset from the php sources for usage in dash or zeal. No stars required. https://zealdocs.org/ / https://kapeli.com/dash https://kapeli.com/docsets
    1 point
  11. @mr-fan there is a method to send test email while debugging from within the modules page. Not the simple connection test. Have you used the verbose method and if so, what says the debug out? If you like, you can PM me that.
    1 point
  12. @rsi you can use $pages->sort() to set the sort value of the new page to zero after it is added, and that will make it appear at the top of its siblings but still be manually sortable. In /site/ready.php: $pages->addHookAfter('added', function(HookEvent $event) { $pages = $event->object; // The page that is being added $page = $event->arguments(0); // If the page passes some kind of test if($page->template == 'news_item') { // Set the sort value for the new page to zero (sibling sort will be automatically adjusted) $pages->sort($page, 0); } });
    1 point
  13. Glad to hear that the module is useful ? Reported SQL issue should be fixed in version 1.0.1.
    1 point
  14. dont think so ? Usually I do that via hooking ProcessPageEdit::buildForm and the wrapFields method of RM <?php $this->addHookAfter("ProcessPageEdit::buildForm", function(HookEvent $event) { $page = $event->process->getPage(); if($page->template != "yourtemplate") return; $form = $event->arguments(0); $rm = $event->modules->get("RockMigrations"); $rm->wrapFields($form, ['field1', 'field2'], [ 'label' => 'your fieldset label', 'icon' => 'bolt', ]); });
    1 point
  15. Here is my Caddy 2 config for a PW site: mysite.fi, www.mysite.fi { encode gzip tls my@email.com root * /var/www/mysite/pw file_server php_fastcgi unix//var/run/php-fpm/php-fpm.sock { health_timeout 10000s } @deny_hidden path_regexp /\. @deny_root path_regexp /(CONTRIBUTING|COPYRIGHT|LICENSE|README|htaccess)\.txt @deny_assets path_regexp ^/site(-[^/]+)?/assets/(.*\.php|backups|cache|config|install|logs|sessions) @deny_install path_regexp ^/site(-[^/]+)?/install @deny_config path_regexp ^/(site(-[^/]+)?|wire)/(config(-dev)?|index\.config)\.php @deny_modules path_regexp ^/((site(-[^/]+)?|wire)/modules|wire/core)/.*\.(inc|module|php|tpl) @deny_templates path_regexp ^/(site(-[^/]+)?|wire)/templates(-admin)?/.*\.(inc|html?|php|tpl) rewrite @deny_hidden /denyaccess rewrite @deny_root /denyaccess rewrite @deny_assets /denyaccess rewrite @deny_install /denyaccess rewrite @deny_config /denyaccess rewrite @deny_modules /denyaccess rewrite @deny_templates /denyaccess # global rule try_files {path} {path}/ /index.php?it={path}&{query} log { format single_field common_log output file /var/log/www/access.log { roll_size 50MiB roll_keep 5 roll_keep_for 168h } } }
    1 point
  16. Hello wonderful Caddyphiles, Do any of you have an updated config for PW and Caddy? I wouldn't mind trying this out now Caddy has matured somewhat. Never run it before though so will start acquainting myself with the docs.
    1 point
  17. Cool thing, @bernhard! It is clear you put a lot of effort and talent into this. Thanks for sharing with the community! I think it would be great to have an example to understand, which modifications are possible and how to implement them. If you have something that could be shared, please do.
    1 point
  18. There's nowhere written that a WireArray does need to be keyed with integers. For the file fields using the filename as key makes a lot of sense. If you still need the integer value just use this: foreach ($data->img_gallery->getValues() as $key => $imageobj) { // Do stuff }
    1 point
×
×
  • Create New...