Jump to content

Gazley

Members
  • Posts

    526
  • Joined

  • Last visited

Everything posted by Gazley

  1. Hey @Mike Rockett - had some fun last night trying to edit the hosts file on Windows 10. Lots of Googled threads on issues surrounding this none of which worked. After lots of messing around, I finally discovered that the antivirus program on the machine had locked the file in a process (for security reasons). Deep in its configuration, I found a setting to release the hosts file. When I did that, I was then able to add the angie.local reference. When I looked again, I also discovered that Laragon has added the same line into hosts with a comment "some Laragon magic!" So, it seems that Laragon will update hosts as long as it's writable. Thanks for your help with this Mike - I appreciate it
  2. @Mike Rockett - just to clarify, I have set up a project/folder called "angie". If I type "angie.dev" in the browser, I get the page in the attached image. If I just type localhost, I get what I need, the document root of the c:\laragon\www\angie folder. This is just fine, but, some of the documentation I've read suggests that you can type http://angie.dev/ and the page will load. Obviously, I'm not seeing this. Any thoughts? Cheers.
  3. @Mike Rockett - that's really cool! I've added PW and it creates the directory structure and contents. However, when I try and access the site, it just says "Site can't be reached"? Tried a few different names but no joy. Any ideas? Sorted it... doh Cheers!
  4. @Mike Rockett - thanks for your advice. Scoop looks really good! I actually installed Laragon today and it appears to give me what I need. The terminal is nice and it even gave me Vim from the command line. Pretty sweet Hey, @abdus - I tried installing again with no luck. I then added the missing profile and re-installed and all seemed OK until I entered Powershell. It just errored and then said something about the profile wasn't digitally signed. It said delete it or rename it. More crashing ensued and then, I gave up! It looks really good but, given the installation issues I've had, the juice isn't worth the squeeze.
  5. Hi @abdus - many thanks for the heads-up on Chocolatey. Actually, I had already tried it and got a "WARNING: Not setting tab completion: Profile file does not exist at..." error. Otherwise, it looked really good but, I couldn't actually work out whether it was installed properly or not?
  6. Hi there, Just started using Windows 10 instead of my old iMac. I wondered what PW devs (on Windows) are using as their Git processor on Windows 10? I use PHPStorm for my Git handling stuff but it needs to find a git.exe file somewhere on my PC. There seem to be numerous different options, all with different pros/cons. Any consensus? Cheers and thanks!
  7. Thanks @applab - I also found this.
  8. Thanks guys for the many great suggestions! @Sérgio Jardim Laragon looks pretty cool. @apeisa @Jonathan Lahijani as does WSL. @pwired how do you get over not being able to create snapshots in vmplayer? Can you manually copy the VMs if you want different versions of the same VM? @applab Docker looks interesting. I didn't get the full picture but I assume you can just create containers containing apps (PW Sites) and then copy the container to a Linux server running Docker that can execute whatever is in the copied container? Wonder what kind of performance hit that would give you as opposed to running directly on the server? Cheers!
  9. Hey, I've been working on my old iMac for years and it's finally given up. It seems that Windows 10 PCs offer much better value and that is what I will probably end up with. However, I just wondered whether any of you are using a "canned" virtual environment on Windows that allows me to use Linux throughout the development process and then simply deploy to the Linux server? Really interested to hear what other PW devs on Windows are doing. Cheers!
  10. Thank you @Zeka - I'll look more closely at your suggestions but, they look to have excellent possibilities
  11. Hi there, It's been a little while since I've been here and I've not done any Processwire development for some time. I've got a potential project that I'm looking at and the site would require responsive image handling, so, using "srcset" and "sizes". I know that folks have used various methods to create image tags with these attributes but I wondered whether there is any more formal support now baked into Processwire? Also, I wondered whether there are any "go to" libraries that provide responsive image support for sliders and other image effects? I can't work out whether UIKit 3 has provided srcset/sizes support? When I've looked at the YooTheme templates based on YooTheme Pro and UIKit 3, they still seem to just use "src" and download the same (large) image, irrespective of the target device. I looked at Grav and it does have specific support for responsive images. However, Processwire would be my preferred CMS so, I thought I'd ask the question! Any advice/thoughts much appreciated.
  12. Are you certain that you have registered your TwigFunctions module in ProcessWire? Have you set a breakpoint in the init method to see that it's being hit?
  13. You probably need to add the PW namespace when you reference wireRelativeTimeStr. return PW\wireRelativeTimeStr($date); // or whatever you have ProcessWire aliased as
  14. Your class signature isn't correct - you need to also: class TwigFunctions extends WireData implements Module { ... } Also, you will need to add the module so that PW can find it when it loads.
  15. @jmartsch In one of my module's init() method, I have a line like this: $this->addHookAfter('TemplateEngineTwig::initTwig', $this, 'hookInitTwig'); When the TemplateEngineTwig::initTwig after-hook is executed, the above declaration ensures that the hookInitTwig function can be found and executed on $this (the executing object instance). So, I guess my question would be, have you specified the addHookAfter method to wire this call up? From what I can see, I don't really see how you can hook the hookInitTwig function when it is just specified in your _init.php file because you can't really specify an instance of _init.php because, it isn't a class. If you want to keep the code in _init.php file, you probably want to use the following addHookAfter signature: $this->addHookAfter('TemplateEngineTwig::initTwig', function($event) { $twig = $event->arguments('twig'); $twigWireRelativeTimeStr = new Twig_SimpleFunction('wireRelativeTimeStr', function ($date) { return wireRelativeTimeStr($date); }); $twig->addFunction($twigWireRelativeTimeStr); $function = new Twig_SimpleFunction('testfunction', function($string) { return 'testfunction'; }); $twig->addFunction($function); }); I haven't run the above code and you'll have to make certain that there are no issues with namespaces. However, when the above code is executed in the _init.php file, it registers the hook with the anonymous function that will be called irrespective as to whether the _init.php file has long since departed from execution scope. Hope this helps.
  16. Hi @Manaus - great tip for those occasional fields that are not autoloaded!
  17. Very good! When the field isn't autojoined, ProcessWire effectively lazy-loads it and it just occurred to me that this wasn't happening when the collection is iterated over by the Twig code. When you set a field as autojoined, it eager-loads it; sometimes, you may not ever touch the field when you are rendering data so, it makes sense to not load it with a page if you aren't going to generally output the value. It's a decision that you would make on a field by field basis but in normal terms, I suppose you would always want the body field to be loaded and therefore set its value to autojoin. Cheers!
  18. Hi @Manaus, Just a SWAG but, do you have Autojoin checked/ticked in your "body" field definition? If not, select it and see if this makes a difference.
  19. @Manaus $page->children()->getArray() should return an array that you could assign to a variable in your template/controller. For that matter, you could also assign $page->children() to a variable that can also be passed in to the Twig template.
  20. @adrian I updated the version to latest and unset all the panels as you suggested, with no difference. I've posted my home.php code below. I am also using @wanze's TemplateEngineTwig module. <?php namespace ProcessWire; // FileCompiler=0 // Line below added to test Tracy issue $session->redirect('http://localhost:8888/contact/thank-you/'); $forms->addHookAfter('FormBuilderProcessor::saveForm', function(HookEvent $event) { $form = $event->object; if ($form->formName === 'contact') { $session = wire('session'); if ($packageValue = wire('input')->post['package']) { $formMessage = $packageValue; $session->set('form-message', $formMessage); } $rootUrl = SITE_URL; $successMessage = $form->successMessage; $utils = wire('modules')->get('Utils'); $session->redirect($utils->stripDoubleSlashes("$rootUrl$successMessage")); } }); $config->forms += ['form' => $forms->render('contact')]; foreach ($page->page_matrix as $item) { $view->set($item->output_variable, $item->render()); }
  21. Wow, I thought that was the latest!
  22. Hi @adrian, Please don't be sorry in any way! I've got Tracy 2.4.4 and PW 3.0.27. I too am running on MAMP. I've got the default panels open. I'll try shutting them down as you suggest and see what happens. Many thanks!
  23. Hi there, I've just been fighting a very basic issue on my localhost. Some code that did a simple redirect just stopped working. The redirect ignored the path and just ended up at the site root URL. Because I had changed numerous things, I almost tore the application apart trying to work out what was going wrong with this very simple command: $session->redirect($utils->stripDoubleSlashes("$rootUrl$successMessage")); One other thing I had done was installed the Tracy module. I unticked "Enable Tracy Debugger" and the $session->redirect started to work again just fine. I then hard-coded the redirect path and put it on the first line of my home.php template and turned Tracy back on again: $session->redirect('http://localhost:8888/contact/thank-you/'); I just ended up back at the root of localhost with a blank page. Any ideas what might be happening here? Thanks!
×
×
  • Create New...