Jump to content

Soma

Moderators
  • Posts

    6,808
  • Joined

  • Last visited

  • Days Won

    159

Everything posted by Soma

  1. Hehe, I was about to write already, that I kinda can't understand people listen to music when working/coding. I can't, as if coding wasn't hard enough and doesn't need your attention fully - how the hell can you listen to music!? I remember that THE best animator of our time Milt Kahl (Disney) was once asked by his animator fellows, if he listens to music while drawing. He almost got angry at them yelling what I said above.
  2. I don't see anything wrong in doing so what you do include/load a php in a function. But usually it's another class or library. The scope on $this, doesn't exists from in that. So kinda with teppo that it might not easy to deal with it how you go with it depending on what methods you call and for what. instead of $this in the included function if would be more like $module = new MyAwesomeModule(); $var = $module->bla1(…); or $module = wire("modules")->get("MyAwesomeModule"); $var = $module->bla1(…);
  3. RT @alguintu: That moment when you no longer care whether the design looks good as long as the client shuts up. #webdesignhell

  4. You got the problem right there in the error message. A page need to first be saved before images can be added or loaded. I think the from processing tries to render image field with the uploaded image but isn't really yet uploaded or saved. Not sure what you're using this for but FormTemplateProcessor isn't meant to work with file fields and also not recommended for front end forms with uploads. Kinda big security risk there. There's some examples around for different forms for front-end with file uploads. http://processwire.com/talk/topic/2089-create-simple-forms-using-api/ long thread with various things. Some examples you'll find in my gists namely https://gist.github.com/somatonic/5236008 https://gist.github.com/somatonic/4150974
  5. ...nothing, this works ok. Don't know why it shouldn't.
  6. You would instead hook Page::path. It' used by url and making url also hookable doesn't make sense and maybe even for performance reasons as it can be called many times in a request. Or you could add your own url method to Page.
  7. To me it sounds more like you want a custom admin page to frame a pho ftp client to access and upload your design files from the admin instead over a IDE or coding tool ftp.
  8. There's a note in source that custom code doesn't yet work with the validPage check. However, in my quick test you can still use it to select unpublished page via normal parent/template config and using PageListSelect or PageListSelectMultiple.
  9. Those pages are the last modified/created, and you get them because you're logged in as admin. "include=all" doesn't only mean you get also pages from the trash but also unpublished and hidden ones. I would try to test your code for if it finds something, so you can from the start rule out other things $items = $pages->find("template=vacancy, limit=10, sort=-modified"); if(count($items)) ... else ... or print out the PageArray result, it should give id's of the pages found 123|2939|2331 echo $items; If you search doesn't return anything, and without template=vacancy it does, then that looks like it's wrong something there?
  10. RT @decadeofdefeat: I just discovered @processwire and I am literally high fiving the air. Thanks for building an awesome and straightforwa…

  11. You'll find what you ask here http://wiki.processwire.com/index.php/Module_Creation
  12. If you hook before render, there's no $event->return (yet). So you can't replace anything, only if you echo out your stuff and exit() it will work. This has been like this ever since, and I know because I played with it, but never actually needed it or seen any use for it.
  13. Soma

    Hanna Code

  14. Soma

    Hanna Code

    I also tried, and it doesn't work. Further investigation is that the formatValue doesn't return but set $this->value; So get it fixed I need to comment out #178: //$this->value = ''; and change in render() method to instead return $this->value: public function render($value) { $this->formatValue(new NullPage(), new Field(), $value); return $this->value; } Don't know what Ryan smoked but I didn't first spotted it as it's really wierd wired.
  15. You should try switch wire folder for the latest dev version, I think all those issues were recently fixed but only available in dev.
  16. RT @davissorenson: Moved a new static site to @processwire in about 10 minutes with some guidance. I've never used PW before. This is how C…

  17. http://processwire.com/api/user-access/roles/ http://cheatsheet.processwire.com/#roles http://cheatsheet.processwire.com/#user where you see API also for checking permissions or roles (hasRole(), hasPermission()) http://processwire.com/api/variables/user/
  18. Ups, was a bit too late at night. It has nothing to do with unpublished but I usually trying to exclude admin pages when retrieving "all" pages, but it doesn't really make sense her as we already have template defined which no page under /processwire/ will usually have. Also kongondo is right with it's even better to use "status=unpublished"
  19. A good way is to use more specific selector. 2 is parent ID of admin pages, and it will only return unpublished pages. $pages->find("template=event, has_parent!=2, status>=" . Page::statusUnpublished);
  20. My ImageManager module also uses DOMDocument to parse.
  21. Glad you got it working. Thing is, that it has not much to do with modules, this code could also just be in a template.
  22. Soma

    All Pages

    erm foreach($pages->find() as $p) { echo "<p>{$p->url}</p>"; } returns nothing... but foreach($pages->find("*") as $p) { echo "<p>{$p->url}</p>"; } returns all. While... foreach($pages->find("has_parent!=2") as $p) { echo "<p>{$p->url}</p>"; } would exclude pages under "/processwire/" admin pages. But maybe something also some restriction to template(s) would be good. foreach($pages->find("template=basic-page|article|news") as $p) { echo "<p>{$p->url}</p>"; }
  23. What you mean with no dice. It's not about luck or dices What you expect to do it? Is average_rating a field? Where is averageRating coming from? And don't you need to save the page or field after setting it?
  24. Guessing from your question you haven't tried... but yes you can? Protected function also are hookable, but not directly callable as a member function outside the class. It would make no sense to have save hookable indicated by the three underscores, if it wouldn't work.
  25. Means not it's not possible with adding language segment to url via item templates, I don't see any problem anyway. $lang = "de"; 'item_tpl' => "<a href='/{url}$lang'>{title}</a>";
×
×
  • Create New...