Jump to content

owzim

PW-Moderators
  • Posts

    490
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by owzim

  1. I don't know how Bea's ImageExtra module is working, but as far as I can tell one could give an image a custom name field, so how about supporting that, perhaps configurable, so that one can reference the images via name. This would make it sorting agnostic. images:header images:intro images:foo The image field is an extension of WireArray, right? So in your code module's you should be able to get it easily via $images->get('name=foo');
  2. You're right, that actually came to my mind as well.
  3. diogo, great one, thanks. I'd prefer a syntax that might be more intuitive? instead of: images:0 // all images:1 // first images:2 // second rather: images // all images:0 // first images:1 // second What do you think? Edit: Ha, did not know about the DOMDocument class, that's very useful.
  4. You need a new Fieldtype in this case, not an Inputfield
  5. owzim

    Regexp Help!

    If you don't use it already, try http://regexr.com/ for testing your regexes, I learned a lot about regex with that tool. It only supports JS regex (obviously), so not all regex features that PHP can handle are supported, but still. If succeeded I save it on regexr and put the URL in a comment within my code, so I can revisit and/or change it later. The great thing is, not only does it save the regex but also the string/text you were testing the regex with.
  6. This might be overkill, but if you really want custom output functionality and a default output if no property is accessed directly for a field you could create a FieldtypeTwitter extends FieldtypeText first, create a TwitterData class, save it in your module's directory as TwitterData.php <?php class TwitterData extends WireData { protected static $urlPrefix = 'https://twitter.com/'; // for echo $field; directly public function __toString() { return "@{$this->handle}"; } // for echo $field->url; public function __get($name) { if ($name === 'url') { return self::$urlPrefix . $this->handle; } else { return parent::__get($name); } } // this is some advanced functionality, you might not need it // isset($field->url) returns true only, if 'handle' not empty public function __isset($name) { if ($name === 'url' && $this->handle) return true; return parent::__isset($name); } } Then overwrite the formatValue method in your FieldtypeTwitter.module: <?php // require the TwitterData class from wherever you put it require_once(__DIR__ . '/TwitterData.php'); class FieldtypeTwitter extends FieldtypeText { public function ___formatValue(Page $page, Field $field, $value) { $twitter = new TwitterData(); // the value that comes from the field $twitter->handle = $value; return $twitter; } } Now in your template, you can use it like you stated above: echo $page->twitter; // outputs @accountname echo $page->twitter->url; // outputs https://twitter.com/accountname Just tested, it works like intended. I used the same method on my FieldtypeYaml
  7. Just wanted you to know, that I deprecated FieldtypeDataStructure, the repo will still be there and the added parsing features are still on the dev branch. I will just not longer maintain or support it. Meanwhile I merged some features into the orginal Fieldtype YAML repo, made it beta and updated the links on the module page. So it stays focused on YAML.
  8. No, everything in ProcessWire is relational. Writing the permission into the page would conflict with that concept
  9. diogo, looks great. Will try that later. Why not a separate forum post?
  10. Thanks Macrura, I am glad that you could pinpoint the issue. I already fixed it, see this commit
  11. arjen, did not know of this feature, looks great. Added it to the roadmap. To all: Feature requests and bug reports very welcome!
  12. A highly configurable and flexible ACE editor input field. This module is sponsored in part by Nibiri, aka forum member Macrura which was a great jump start. So many thanks to him. See this short screencast to get an overview: Get it from Github or the Modules Directory. Roadmap add full screen mode expose a jQuery api for resizing, setting row count etc. add image handling like in Adam Kiss' version
  13. Kewl! You can add TextFormatters to InputfieldMarkup

  14. @pideluxe, that is AWESOME news, c't is a huge computer magazine in Germany. And look at the logo within that futuristic collage, adorable Very excited. thanks for the info.
  15. array() is a php function, so "Boo!"
  16. I don;t get why ppl prefer fugly PHP templating over something truly aweseome like twig

  17. ryan, everything you put out there is so friggin' polished. Outstanding work!
  18. Hi Mike, not possible at the moment, but I just looked into the code, should be easy to implement, with selectors. Instead of $templates->get("name"), I would use $templates->find("selector"), and loop through them. But it needs to be tested as well and unfortunately I haven't got the time at the moment. Feel free to make a PR PS: it's owzim
  19. Blonde moment? Please don't!
  20. @n0sleeves just tried ngrok, that's even 4w3s0m3r thanks I like pay what you want services, because in my experience, they almost always have great support (they are kind and not of the greedy type), and I end up paying more that for other services without that model. We have a great pwyw hoster here in Germany, uberspace, they rule!
  21. @marcus, I recall Jeffrey Way talking about this, I was amazed but totally forgot about that, thanks.
  22. @n0sleeves have to look into the tunneling thing, sounds great. I set up a PW installation on the server, and push my local templates folder changes via git ftp (also supports FTPS (FTP over SSL)), which really only pushes the changes, tracked by git. Good thing is, this workflow also works if the client's server does not have git available, only good ol' ftp. AND you still can profit from branching locally.
×
×
  • Create New...