Jump to content

Soma

Moderators
  • Posts

    6,808
  • Joined

  • Last visited

  • Days Won

    159

Everything posted by Soma

  1. Or use the $user->isGuest()
  2. There's various approaches, that as well can be mixed. Just some using the custom "selector" option, that will be used by the module to run the nested queries. By default all pages that are not hidden will be shown. But there's some options to do more. - Easiest in admin: setting pages or only parents of branches to hidden in the admin, they won't show in navigation. - Or through a checkbox to hide or show a page, always by the laws of hierarchy and physics. Then use the "selector" option to *checkboxfieldname=1" and include or exclude in MarkupSimpleNavigation. "selector" => "show_in_nav=0" // only the unchecked ones, don't show checked ones - Or by a selector and by template name. "selector" => "template=basic-page" // only pages with template basic-page. Just play around and think about what would be simple approach in your scenario. See and try out more options seen in docu.
  3. Ah. The thing is, I just tested now again, that when you use current user object $user echo $user->avatar->first->url; // will be an array of type Pageimages It will always be an array, cause no output formatting for the $user. BUT if you load the user via API, it's different... $u = $users->get("username"); echo $u->avatar->url; // will be single object of type Pageimage cause output formatting is now on. Got it? ;D (I sometimes think it would be easier and less confusing if this output formatting behaviour wasn't there for images.) sure: $user->avatar->removeAll(); $user->avatar->add($newimage); $user->save();
  4. It should be working as I'm using it in various shops. Maybe you changed to add the country while you already testing, and the fields are saved in session.
  5. So the image field is not max 1 file.
  6. I fixed this country field on my Shop Version here https://github.com/somatonic/Shop-for-ProcessWire/commit/246ed23a399e1f086084840231b3076784ad7221 but apeisa's is older. Edit: Ok that commit wasn't it but I remember fixing something with country field some time ago.
  7. Well if you upload an image though API , even if image field is set to only allow 1, it will still will add them and turn the single image into multiple (at least that's what I think), thus you have an array. That setting isn't recognized on API level when adding images. Edit: Quickly tested this and added a second image through API. While the image is added to the field, the image field is still single image and not an array. So it's an Pageimage. If you get a Pageimages object, you don't have set max file to 1 or turned off output formatting somehow.
  8. Well there used to be something in the past with user pages not having output formatting, but could be wrong. Just tested and it seems to be enabled (at least on my side 2.4+), so it shouldn't be an array if image max file is set to 1.
  9. For user page(s) it is always off I remember.
  10. @diogo, that is dependent of if output formatting for that page is on or off. If off, it's always a WireArray.
  11. @horst, I just stumbled over this and thought of this thread I see that it may not the real issue here. Are you saying you get this problem with ImagesManager? I just committed suizi.. er an update to ImagesManager to account for various issues I encountered with new PW. Also there was a fileAdded triggered two times before that was due to some strange things with getting to work max image dimension to work, since it's something that only the InputfieldImage is dealing with.
  12. I was able to reproduce issues with latest dev 2.4.2, while working in 2.4.1 still. Took me couple hours to get around the problems introduced here, but somehow found what the issue was and committed a fix just now. Part of it is still hackish, and it seems I can't set a custom upload path for InputfieldImage anymore. So it will take now the admin page assets folder for uploading. This results in you don't have to set a temp upload folder (took it out for now). Also made sure images uploaded get deleted in case of errors. Added check tomake sure parent catgegory page is selected before uploading. Added support for showIf dependencies, so the file input will only be shown when a parent is selected, this will only work for 2.3+ (?). Some minor changes in ImagesManagerParser to account for upcoming new fieldtypes by Ryan. Meanwhile I found some bug in InputfieldPageListSelectMultiple that makes it not work with inputfield dependencies, I submitted a PR for Ryan. I got it still working with a trick. So unless there's other changes to image/file inputfields this version should be save for 2.4 and upcomming 2.5. But after all still a proof of concept!
  13. InputfieldImage does this: L#68 if($this->maxWidth && $pagefile->width > $this->maxWidth) { $pagefile2 = $pagefile->width($this->maxWidth); unlink($pagefile->filename); rename($pagefile2->filename, $pagefile->filename); $pagefile->getImageInfo(true); // force it to reload it's dimensions } if($this->maxHeight && $pagefile->height > $this->maxHeight) { $pagefile2 = $pagefile->height($this->maxHeight); unlink($pagefile->filename); rename($pagefile2->filename, $pagefile->filename); $pagefile->getImageInfo(true); } That's two resizes for me. While questioning if it shouldn't do only 1 resize.
  14. can you enable debug mode and see what errors you got?
  15. Thanks Tom! Glad you seem to enjoy it!
  16. @adrian That option isn't used. I used to use this to set it, but removed it. @cstevensjr hmm I'll also test a little to see if i can reproduce.
  17. @digitex, ImagesManager doesn't set a maxFilesize, where do you see this? It uses PW InputfieldFile.module that does set it from the php.ini. I'm not sure in what regard it is different to when uploading on a page, because it should be the same. Though the upload form in ImagesManager is a normal form file input that uploads on submit, while page upload you may using ajax async upload. Anyway it shouldn't make a difference. Thanks for the suggestion with the missing category parent. Yes, that surely would be possible. While it all works somehow, there's a lot left to be desired. It's still an proof of concept pretty much. @cstevenjr, are getting this on a new install? I haven't tried yet on latest PW though. Strange.
  18. Thanks for the report. I fixed the issue with custom CSS and committed it just now.
  19. There's two arguments to give renderCart() If you only have one fixed shipping cost you could give it as the second argument, the first being true or false, viewonly or not editable cart. https://github.com/apeisa/Shop-for-ProcessWire/blob/master/ShoppingCart.module#L193 echo $modules->ShoppingCart->renderCart(false, $modules->ShippingFixedCost); The module isn't autoload, but loaded on demand.
  20. Really? I don't think so. I think it's more meant that your video is better positioned if you use youtube to host them and embed in your site. Not that your site get's a better rank just by embedding youtube videos.
  21. Never have this problem. Make sure your template file and code is utf8. Also it depends how you send the email if you don't set a correct header it may cause troubles with chars. Then usually a utf8_decode isn't needed.
  22. Don't think this marked solution is the solution? It's very simple. First it's always nice to know what multi-language approach you use since there's multiple ways. If you use the LanguageSupport modules with LanguageSupportPageNames also installed (which I guess you use), you'd set the language segments on the home/root page. There you'll find a name for each language. Let's assume you have german default and english alternative language, you'd probably set the name to german: "de" english: "en" This will result in urls like /de/meineseite/ and /en/mypage/ Default name could also left empty, so there won't be any language segment for it and only be /meineseite/. So, but you name them "startseite" and "home" which is strange as this would result in /startseite/meineseite/ and /home/mypage/, which is not desirable I think. So taking the language segments as described before a language switch using $page->localUrl(language) will return the correct url to the language. On the homepage this would result in domain.com (always default language, unless you set option to redirect to /de/ in LanguageSupportPageNames module) domain.com/de/ domain.com/en/ The language is always evaluated from the requested URL, and $page->url will always return urls of a page according the current language. You can get a localized url of a page explicit with $page->localUrl(language).
  23. RT @minimizepw: We're working hard on our next version. Want to take a sneak preview? #processwire http://t.co/Eq5xVmzB4K

  24. Just guessing that those urls you request don't exist in PW, so you'll get a 404. Solution could be to have url segments enabled for root template. So a url like domain.com/phones if a page /phones/ doesn't exist it won't throw an 404, but just route the request to the home template.
  25. I don't think that's possible. You can ignore those notices. You will also get some from ProcessWire core btw.
×
×
  • Create New...