Jump to content

Jozsef

Members
  • Posts

    285
  • Joined

  • Last visited

Everything posted by Jozsef

  1. I was scratching my head for hours because I couldn't get the add default role plugin to work. It's probably only me who is so newbie at hooks. But anyway, just wanted to add here for those who have similar problems: (@pwFoo, you might want to add this extra line to the documentation ) Hooks must be added before the processing! I got my code working this way: // Add default user role $fu->addHookBefore('save', function($event) { $user = wire('fu')->userObj; $user->addRole('dress'); }); // Login after successful registration $fu->addHookAfter('save', function($event) { $user = $event->object->form->fhValue('username','text'); $pass = $event->object->form->fhValue('password','text'); $this->session->login($user, $pass); }); // process register / form submit $fu->process($redirectDestination); Thanks for the great module though, it saved me loads of time and it just works. The email validations is just the icing on the cake.
  2. I join to this question. On pages with large images or many images to be resized, the page load just take forever the first time (until the images got resized). I came from Drupal where the page still comes up immediately and the image loads later, as soon as it's resized. It was a bit of a shock in ProcessWire that image resizing holds back the whole page, especially that everything else is so well thought through. Any simple solutions to overcome this? (Resizing on upload, lazy loading etc).
  3. Thanks for the quick help. I was hoping that there was a built in method but a workaround like that will be the answer then. I read the blog, it explains a lot of situations but this.
  4. Normally I output some fields with fallback values as follows (with Headline field filled in in this case): $content .= "<h1>$page->get('headline|title')</h1>; How would you approach front page editing in the template for this (B/C/D method)? $content .= "<h1>$page->edit('headline|title')</h1>"; results in the Headline outputted but editing doesn't work. $content .= "<edit title>"; $content .= "<h1>{$page->get('headline|title')}</h1>"; $content .= "</edit>"; Results in the Headline outputted but double click will edit the Title field instead. Has anyone succeeded this way?
  5. Hi there, I'm helping my client with on-page SEO and realised that they uploaded a lot of randomly named images. Any suggestions on renaming those files without deleting + re-uploading the file? I educate my clients on the importance of the description field but many would find it difficult to rename a file on their computers before upload... Any workaround you can think of? Maybe using the API to mass rename all images based on their descriptions or page title? Thanks and I'm open to all suggestions (also on how you prevent filenames full of random characters)?
  6. Thanks Apeisa, I had to add $fredi = wire("modules")->get("Fredi") to the hannacode even though it was in the template file too. It works now.
  7. Hi, maybe someone tried this before me: Do you think I could get fredi working inside hannacode? I'm trying to use it as usual but I get an error message: Error: Call to a member function render() on a non-object $members = wire('pages')->find("parent=/members/, location=$office, include=hidden"); foreach ($members as $member) { echo $fredi->render('title|headline|mobile|mail', $member); Without the fredi code everything works as expected. Could anyone point me to the right direction? Obviously I must do something wrong. Thanks
  8. I'm more like a front and developer and I used Padloper for simple stores before. This time I was asked to build a website for a print shop with a few special requirements: - price list for each product that lists different quantities - options for paper quality, fold, etc that modifies the whole price list - file upload for each product to include artwork Do you think it is possible with Padloper and PW or you'd go different way? Which way you'd approach this? Also, are any of you available for custom module development? Thanks
  9. Is it possible to include the standard Directions button when rendering the map display? Has anyone implemented it already? It would prove invaluable.
  10. Jozsef

    Hanna Code

    Kongondo, thank you, that was it indeed. I overlooked that part. Sorry for only reacting now, I keep forgetting to follow the topics and just assume I'm added automatically.
  11. Jozsef

    Hanna Code

    Using the following code in Hanna code always evaluates as TRUE: if ($page->id == "1187") { echo $page->id; } or if ($page == $pages->get("1187")) { echo $page->id; } returns true and prints out 1187 no matter what page I run the code on I should be able to use $page and $pages in Hanna code without problem or did I misunderstood something? Thanks
  12. How would you approach the following subjects when building the shop? 1. Including a product photo in the cart edit template? 2. What is the redirect address for the PayPal payment? 3. Have a checkbox to save customer data for later (user registration)? Sorry if I asked such trivial questions, I'm rather new to PW.
  13. Hi Antti, I just received the email about the release of your module and I have a simple ecommerce project at the moment and I'd consider to try your module for that. Do you plan to implement other common webshop features such as discounts/coupons etc. in the future updates ? Or is this something we have to hand code every time? I'd prefer the very basics out of the box. The module sounds fantastic though, thanks a million for that. Thanks
  14. Having the same problem with a fresh install but only when using CodeKit's preview server. My config: $config->httpHosts = array('localhost', 'mac-mini.local:5757', 'myproject.dev'); It only throws the Unrecognized HTTP host error when running the site on CodeKit's test server: mac-mini.local:5757. Everything seem to work only the red bar is persistent on the top and non of the suggestions helped found in other threads. The error has been there for the last two projects too. I tried variations in the config with no luck: - local:5757 - mac-mini.local Anyone else using CodeKit with ProcessWire? What do you think could be the problem? P.S.: not using the config module, it's a fresh vanilla install on my dev computer.
  15. Thanks for everyone for the responses, I couldn't check back in the meantime. As a workaround I got around the problem by creating the user in the API and it worked like a charm. Deleting/recreating the user in the backend didn't help, even when using a different username. The strange thing is that there are not that many fields on the standard user form so I could hardly miss anything. There were no other error messages on the top of the page or in the error log, just simply didn't work. If I have time I'll get back to it to further investigate using the suggestions. Sorry to abandon the topic, I haven't got any notifications and I had to rush to meet the deadline... Thank you all for the help, I really appreciate it and will come back with my findings.
  16. This is a strange behaviour I'm getting, tried with v2.5.3 and now with v2.5.22. I create a user, enter all the details including correct password, click on publish and I'm getting this error message: Saved Page: /admin/access/users/test/ - Cannot be published until errors are corrected I tried to delete the user and recreate it, create a different user name, no luck. I' can't figure out what is wrong as this is supposed to be a pretty simple task to do and there's no topic on this error. Edit: This user "test" was working before but now is unpublished Could someone please direct me to the right direction? Thanks
  17. I just came across with this topic and wanted to share my experience. The problem with permissions is simple: The Apache user (see: PHP) has no permission on files we upload with our FTP user and the same goes the other way around too. On shared hosting the solution for us was to change PHP to run as fastCGI instead of as Apache module. This way you can upload files via FTP, leave permissions as the recommended 755 and 644 and php will be able to happily write those files/folders. Also, you can edit/delete files and folders via FTP even though they were created by PHP. On my VPS running Webmin I just make sure that I upload files with the virtual host user and not with the root user. I hope it helps to sort the cause of the problem and not just treating the symptom.
  18. It did the same to me but it works now with 2.5. The issue is that Flickr switched all API requests to the https protocol. Change http:// to https:// in the InputfieldFlickr.js file and it will work again. @apeisa, thanks for the great module, you might want to update it with https, cheers.
  19. @horst, thank you for the update, I'll try to implement PIM in the coming days in my current project. I used retina because everyone just "gets it" and this problem actually came with the retina display as HiDPI wasn't widespread before. I think iOS is not that different from other mobile devices with HiDPI screens in regards that it just uses 2x2 smaller pixels in place of every 1px we define in markup/css. That's why we have to provide 4x more pixels in the image and manually override this upscaling mechanism in the OS. The same reason why it's practical to proportionally downscale font size on mobile screens. This technique is also extremely simple compared to other javascript solutions or using the (not valid) <picture> tag. BTW you have to switch off "max-width: 100%" in web inspector on the images in the article as the author's blog theme took over the original article. The pair of images side by side should be the same dimension. Edit: I wish all my wishes would come through this quick.
  20. Thank you for your quick responses, that's definitely something I can start with. @LostKobrakai: Thank you for the starting point, i'll check it out although my PHP level is only enough for theming. @horst: pia is promising, I was not aware of this module but will check it out now. Looks like it can spare quite a few lines in the template. Calculating the double size is fine, however it should only retinafy if the image is large enough. If upscale is disabled it is not always possible. I'll think about these and will post back if managed to come up with a solution. Thanks for the helpful advice again.
  21. Hi everyone, I've just switched from Drupal a few weeks ago and I'm so glad I did! ProcessWire already helped me to develop a site only third of the time I expected. I also love the active and helpful community. But back to retina images: A "retinafy" option would be very helpful for the image resize/crop as I use this technique too, serving 1 image to all devices with double dimensions but low image quality based on this technique explained by Daan Jobsis. It is possible to achieve it in the template but this kind of maths just doesn't belong there. The retinafy option could work like this when set to true: The image is automatically sized/cropped to double dimensions but $img->width or $img->height reports the intended dimensions. Example: I want to have a 150x100px retina image so I use $page->image->size(150, 100, $options) with retinafy => true. The result is a 300x200px image with the markup: <img src="/site/assets/files/123/image.jpg" width="150" height="100"/> What do you think? Would you suggest any simple way to achieve this without writing many lines of php for every image? Of course it has to take the upscale => false option into account if enabled.
×
×
  • Create New...