Jump to content

Soma

Moderators
  • Posts

    6,798
  • Joined

  • Last visited

  • Days Won

    158

Everything posted by Soma

  1. Actually I think with: $page->child()->getInputfields() you get the inputfields from that page with the values for editing. I get errors when using it in outputformatting on... to get the fields you simply do: $page->template->fields;
  2. This works for me: $page->child()->template->fields; What error are you getting adrian?
  3. Its simple: $fields = $page->child()->template->fields;
  4. Can you tell a little more what the field settings are set to? Ok it's a litte special with this field because it also supports "range" setting (min,max). So it has two values actually and uses outputformatting because is an object behind the scenes. To set the value in template code you need to turn it off and use $page->of(false); $page->range->set("min", 3); $page->of(true); or $page->of(false); $page->range->min = 3; $page->of(true);
  5. I think this method to create a page with a template just to get the fields is not needed and I think if you have file field it will throw that error. I think it's better you get them just using $fields = $templates->get("mytempl")->fields;
  6. I think theres possibly some inconsistent behavior with get and find when using more sophisticated selectors. Just use a find with a limit =1 and a first () chained.
  7. So there is something wrong with that page? Is it unpublished or some permissions set? Any more details would help.
  8. I didn't plan anything yet I just wanted to check how many would consider joining. Looks good so far
  9. There seems to be an issue with this how or where this locale gets set. It doesn't seem to recognize the langauge on front end. It always uses the user language set on user profile.
  10. I don't understand. What you mean with I have? front-end or backend? If you are in backend it will display date in the language your user is set to.
  11. Never ever edit anything in wire folder. You can set that locale in the translation file for the particular language. The file is: wire--modules--languagesupport--languagesupport-module
  12. @kongondo hehe see? Well maybe a link to the board from the frontside.
  13. Yes Just to clarify, do you mean a FAQ on the website because in the forums there's already a FAQ board?
  14. I'm talking about the function scope issue and other tricky stuff that requires general coding knowledge.
  15. As I recognize it, those people running into this, don't even know about it, how they gonna look on something they don't know about?
  16. This particular subject has come up so often in the forum, because there's so many non-coders attracted by ProcessWire. Every coder knows about scopes and variables and it's the same in all programming languages. I'm sure even if there's a FAQ or documentation on this subject people will run into this when they get their hands dirty. It's much like jQuery doesn't have any documentation for the Javascript language as it's not in its scope.
  17. It should be $pages->get (1001)
  18. Yeah, Ryan is the source https://github.com/ryancramerdesign/ProcessWire/blob/f82594bf64111091f66a99778433417b372cc664/wire/templates-admin/default.php#L68
  19. Ah, ok must have missed that, and since it works anyway I haven't noticed. I corrected this in master and dev, thanks for finding it.
  20. Oh, another owzim question $val = $pages->find("template=mytempl, sort=-counter, limit=1")->first->counter + 1;
  21. See http://php.net to see what all you can do in ProcessWire For conditionals: http://www.php.net/manual/en/control-structures.if.php In PW short way is for example echo $pages->get("title|headline"); saying if title has value output title, otherwise get headline
  22. Ok now it gets more clear. Couldn't those sockets be page fields? Well anyway, you don't have to use sanitizer selectorValue(). Just wrap them in 'value'. $pages->find("field*='E27'|'E27 + PowerLED'|'GU10'|'2G11'"); I'm not sure why + is in the sanitizer filter, but if you have to sanitize it coming from forms you could use $sanitizer->text(). Edit: Corrected example
×
×
  • Create New...