Jump to content

Soma

Moderators
  • Posts

    6,798
  • Joined

  • Last visited

  • Days Won

    158

Everything posted by Soma

  1. RT @processwire: ProcessWire ProFields: Watch this screencast for the 1st ProField called Textareas – https://t.co/VS11gvx25w

  2. Sounds very cool. Thanks owzim , ill take a look when I get time.
  3. I have also created a helper some time ago specific for InputfieldTinyMCE to strip non breaking spaces in text on saving. https://gist.github.com/somatonic/10330802
  4. Would you choose a premade cake over a selfmade cake?
  5. Render hook with a render inside results in endless recursion. You can avoid it by setting a property to the page rendered already and check for it in the start of the hook, and if this property is true, skip it. if($p->skipRender) return; ... $p->skipRender = true; $p->render(); ...
  6. Looks like it's not about session. Line 2? There's nothing. Make sure PW is installed and there's all files and that they're not corrupted or missing. Sometimes it happens when upload to a server.
  7. Thanks for mention it owzim, coincidently I just looked at that the day before you, and also seen that some lines are out of sync. I was thinking if there's a way to automate it or make it easier to update. Currently I just do it manually scanning with SublimeText and take the result list to convert it to html. I'm just not sure what the easiest or best method could be. If anyone got a good idea or knows how, please share. Two versions, one for stable and one latest dev would be cool. For myself I'm not really using it the sheet, as I use SublimeText to quick find classes and symbols to quickly get an overview of the ___ methods. So a matter of a few seconds to look them up.
  8. And the code around it? Is $session existent in scope? Try wire("session")->$cartActive instead if in a function.
  9. RT @apeisa: Celebration of commit number 1000 for @processwire and great new feature (subselectors): https://t.co/uKX260zCqF

  10. It doesn't matter if $input->post or $_POST. I'm not sure I understand what you're trying to do, but inside php templates POST and GET vars works fine. PW uses it, I use it, everybody uses it. As I said, you need to post to a PW url with a trailing slash, or it will get redirected and lose the POST.
  11. You're missing the slash at the end of url.
  12. Those fields are page fields with multiple pages you select. Thus the field returns a PageArray. So you simply foreach through them and echo out something from those selected pages. $page->sd_status <- PageArray! foreach($page->sd_status as $status){ echo $status->title; }
  13. Like the topmenu? https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/AdminTheme/AdminThemeDefault/AdminThemeDefaultHelpers.php#L269
  14. It does only work with a specified id radio=1002
  15. 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.
  16. 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();
  17. 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.
  18. So the image field is not max 1 file.
  19. 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.
  20. 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.
  21. 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.
  22. For user page(s) it is always off I remember.
  23. @diogo, that is dependent of if output formatting for that page is on or off. If off, it's always a WireArray.
×
×
  • Create New...