Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/28/2017 in all areas

  1. There are long-standing issues with the $user page having output formatting off by default - there are a number of forum topics where it has come up. I'm not sure if it's deliberate or if output formatting is off consistently for $user, but you could use $user->getFormatted('date') to be sure. Related topics:
    3 points
  2. My main 2011 15" Macbook Pro had serious graphic problems and stopped working couple weeks ago and I decided to build a Windows machine for the same reason. I also have a 13" that I use to travel. Here in Brazil, a Macbook Pro cost is outrageous, a powerful Mac setup can cost up to 3 or 4 months of salary of an experienced developer. A default 15" Macbook Pro costs here R$ 18.499,00 which converts to US$ 5,581.00!!! So, after 10 years of using only Macs, I built a PC that cost me about $1,700 and it's a beast of a machine for developing and video editing (and some games): Processor: Ryzen 7 1700 - Octa core, 3GHz RAM: 16GB 2133 MHz Motherboard: Gigabyte B350 Gaming 3 HD/SSD: 1 Kingston 250 GB SSD + 1 Western Digital 1TB 7200 rpm GPU: Asus Radeon RX 460 - 2GB RAM Monitor, keyboard, and mouse I already had. They cost about US$270 together. I installed Ubuntu through Windows WSL but I'm not using it like I thought I would. I installed Laragon and it works perfectly for running ProcessWire and other PHP projects. Windows 10 Pro is a very good OS, but I miss some good software like SequelPro and Transmit. The Windows equivalents are not as polished.
    2 points
  3. Adds a Service Worker to your Processwire site which can be customised. The service worker script itself is heavily based on Jeremy Keith’s work – thank you Jeremy! More information: https://github.com/johannesdachsel/processwire-serviceworker
    1 point
  4. Hello everyone, I've been fiddling around a lot lately with docker containers for my local development on a linux machine. Tried many different options, also readily available processwire images and tutorials from the forum. But never got it right. Mainly because of permission issues with docker volumes. That is a tricky part on linux machines whereas on OSX it doesn't seem to be an issue. Then I discovered http://www.wordpressdocker.com/. And the setup with nginx as a proxy that routes requests to separate containers with the actual site install appealed to me. The whole thing sits on top of alpine linux containers which are really lightweight. So I decided to give it a try. And, first time since experimenting with docker, I got a running PW install. Rewriting was not working until I adjusted the nginx config. Now I have a fairly complex PW site running in a container. Everything is working, image upload/editing etc. So I'm really exited, especially since the dev site is now blazing fast compared to my old vagrant virtualbox vm setup. Honestly, I don't really understand everything that is happening behind the scene. But I managed to adjust the original files and build a new image that works with PW and doesn't have all the WP stuff. The nginx config I took from https://github.com/elasticweb/nginx-configs/blob/master/configs/processwire-2.conf Not sure if it covers everything for PW3 as well. I would very much appreciate if someone who is more in the know than me could take a look. All files for building the docker image are here https://github.com/gebeer/alpine-php-processwire A working image here: https://hub.docker.com/r/gebeer/alpine-php-processwire/ Documentation is kind of lacking. I took over quite a lot from the original project. But following the github README and the original documentation should get people started who have a little experience with docker already. If someone needs a more in depth step by step tutorial for setting things up, let me know and I'll put something together.
    1 point
  5. Thanks. I told the client I couldn't work with that hosting. I've never had trouble installing processwire before on other hosts.
    1 point
  6. maybe you can store it in $session and check this before sending the emails? if(true !== $session->emailsAlreadySent) { // or: wire('session')->emailsAlreadySent // code to sent emails here ... $session->emailsAlreadySent = true; }
    1 point
  7. Cool new feature in CodeKit 3.2 (one might never use it but who knows...): Styling Remote Websites
    1 point
  8. This week’s core version on the dev branch includes a lot of small fixes and improvements. We’ve also got a new multi-language URL field available this week as well. https://processwire.com/blog/posts/processwire-3.0.65-core-updates/
    1 point
  9. For documents such as PDFs, you can use the S3 options you already talked about to store them there, because you'll only need the file URL after all. Remember to config Processwire to store the session on the database.
    1 point
  10. For any Windows developers interested in an easy way to get going with Docker and Processwire that includes local debugging... https://github.com/rastographics/pwocker Local debugging in your IDE with Xdebug pre-configured. (Also includes working launch.json for you VS Code users ) Use *.localtest.me hostnames for each site you are developing (no editing of hosts file) Simple configuration...copy 2 files into your project, edit a couple variables in those files, and run 1 command per project. Tested with Docker 1.13.1-beta42 on Windows 10 Pro 64-bit. I didn't know much at all about Docker, nginx, or xdebug before doing this, so I pulled much info from gebeer's work and many others who have put Docker/PHP/xdebug stuff out in the community. And it may not be the best setup ever, but it finally gives me what I needed for doing PW work on Windows in a true Linux stack with IDE debugging.
    1 point
  11. Here are my code snippets for that <?php echo $all_products->renderPager(array( "nextItemLabel" => __("След."), "previousItemLabel" => __("Пред."), "firstNumberItemClass" => "pagination__item--first-num", "lastNumberItemClass" => "pagination__item--last-num", "previousItemClass" => "pagination__item--prev", "nextItemClass" => "pagination__item--next", "firstItemClass" => "pagination__item--first", "lastItemClass" => "pagination__item--last", "currentItemClass" => "pagination__item--active", "listMarkup" => "<div class='pagination'><ul class='pagination__list'>{out}</ul></div>", "itemMarkup" => "<li class='pagination__item {class}'>{out}</li>", "linkMarkup" => "<a class='pagination__item-link' href='{url}'><span>{out}</span></a>" )); ?> and SASS styles ( mixins from foundation ) $module: 'pagination'; .#{$module} { text-align: center; background: $white; border-radius: $global-radius; padding: rem-calc(5); box-shadow: rem-calc(0 1 4 0) rgba(0, 0, 0, 0.1); &__list { @include pagination-container; display: inline-block; margin-bottom: 0; } &__item { display: inline-block; padding: rem-calc(5) rem-calc(10); &--active { a { text-decoration: underline; } } a { @include button-base(); @include button(false, $brand-darker, darken($brand-darker, 5), $white, solid); border-radius: $global-radius - 2; margin-bottom: 0; padding: rem-calc(3 7); } } }
    1 point
  12. If you look at Example #2 : https://processwire.com/api/modules/markup-pager-nav/ you can see how to output pagination links exactly how you want.
    1 point
  13. Just the other day export/import for templates and files partly worked but many settings such as allowable template and parent for page fields were missed and a few fields were not assigned to all of the templates they belong on. I tried Migrator once (not recently) and it scrambled the page tree badly. To be fair, both of these episodes happened on migration attempts between different PW versions. People bring up Migrator in topics like this but last time I looked I didn't see much detail on the forum about what's working and whether it's keeping up with changes in PW. Template and field export/import from 2.7.3 to 3.0.8 saved me a lot of time but didn't fully resolve the interdependencies of fields and templates referencing each other.
    1 point
  14. ProcessWire has language alternate fields, which basically do what you describe out of the box. Unlike multi-language fields, language alternate fields can also be used with image fields.
    1 point
  15. Teppo, thank you. I am an idiot for not searching forums first.
    1 point
  16. Have you already checked this solution out: http://processwire.com/talk/topic/1067-accessing-previous-version-of-page-beforeafter-page-save/#entry9321?
    1 point
  17. Okay I think I understand what you are saying. So you want to just load a fresh copy from the database, not keep an existing copy at some state in memory. Do this to load a fresh copy from the database: wire('pages')->uncacheAll(); $oldPage = wire('pages')->get($page->id);
    1 point
  18. ProcessWire keeps a memory cache of pages loaded, so when you retrieve a page, its going to be the same instance of that page when you retrieve it elsewhere. But once you save a page (in the API) that memory cache gets cleared. If you wanted to keep an in-memory copy of it before it was saved, you'd want to clone it sometime before the page is saved: $pageCopy = clone $page; From that point forward, any changes to $page won't be seen in $pageCopy. This clone will cease to exist once it is out of memory scope. For obvious reasons, file-based assets aren't cloned here. So if your clone depends on file/image assets, then you have to create a new page not just in memory, but on database/disk too. Here's how you do that: $pageCopy = $pages->clone($page); That does a recursive clone, cloning not just that page, but any children too. See the parameters to the $pages->clone() function for additional options to control this. You can also specify that you want it to clone to a different parent. Be careful with the cloning as it's something you probably don't want to do on every page save. It can be an expensive operation if there are lots of files or subpages associated with the cloned page.
    1 point
×
×
  • Create New...