Jump to content

Adam Kiss

Moderators
  • Posts

    1,303
  • Joined

  • Days Won

    7

Everything posted by Adam Kiss

  1. Hey Ryan, thanks. Just to illustrate (I don't want exception ), I'd do it like this?: $this->addHookBefore('Pages::save', $this, 'savePageValidation'); function savePageValidation(){ if ($everythingIsOk === true) { $pages->___save(); } } ? Also how about that exception - I understand I'd probably need to try catch something, but I'm not too certain.
  2. Also, I am probably retarded, I totally missed Diogos response. Sorry
  3. @Robert, I think Diogo knows this, he just told you're inconsistent - you use shorthand for echo, but don't use it for general PHP parts, like include. They're both turned on/off with the same config value AFAIK.
  4. Hey, is there anyway I can hook onto page::save() process, do custom validation and either accept changes or reject changes?
  5. So, this is live in stable version?
  6. So, this is done, and will be soon merged to master, correct? Marking as 'solved'
  7. I'll keep this open to see if more people have this need, but I think this will have to be changed on site-by-site basis
  8. I would totallly create XY templates [one for each block] and one 'layout' template, which is basically your layout holder/creator. In the layout template I would hold just the structure (saved some way, maybe like csv or so), and in the other part of the site tree, I would hold all the blocks - this way it's easy to create block, update them, delete them, reuse them, etc.
  9. I am all for deprecating things like this, so that available functions/methods (and documentation) aren't polluted with things not supported anymore (not complying with, or any word you might want to use).
  10. The simplest way here would some kind of system to implement special types of Tags in the textarea... Now, if somebody was working on this... Just joking! somebody does I have developed little Tags class, to allow us simply include images from image field with captions in the blog posts - since we're all skilled devs here, we use it like this: [after you've uploaded all used images and set their captions]: {{ figureimage index=0 figure_index=1 }} Something like this could be easily developed for videos: you could easily have something following in your content (be it tinymce or other things): {{ vimeo id=4uy78 }} and it would add video.
  11. Well, you certainly can - it's possible to build ProcessWire sites with nearly no PHP knowledge, but it certainly won't be as much fun as it could be. The important thing is to understand the concepts of this CMS/F and know some php functions to transform data (work with arrays, some printf maybe) and then you could achieve what you want.
  12. Hey boys (and girls?), this has been updated to version 1.1.0, which is marked as final, as I hit possibilities achievable via Textformatter module. Next release will probably be Fieldtype module.
  13. Yeah, well... I hope this won't clash with PW's GPL too much. I like WTFPL though, that's why I used it
  14. Is this using standard jQuery UI skinning? Good work neverthless.
  15. Hello all! Until we wait for Ryan's full-fledged Matrix Inputfield, I present the Plaintext Matrix Textformatter Transform your textareas into matrixes: enter your records in plaintext – ProcessWire query syntax, and upon page loading, get your data back as array of objects with typed values! Download and readme: http://github.com/adamkiss/pwTextformatterPlaintextMatrix Have a nice day!
  16. It's arabic, I believe... and particulary for this: 'يودا من حرب النجوم', translate.google.com said it means 'Yoda from Star Wars'. Other than that, I give +1 to using english. We are international here and we won't understand each other, if we start talking our native languages (except Ryan and few others, there would nothing change. )
  17. As for me, I already have an idea how to get around that, and have field-wide settings, I was just curious whether is some interface or configurable possible for TextFormatter. Thanks
  18. Hey Ryan (and everyone who did at lease some module programming), Is it possible to have textformatter module, but with per-field configuration? And by this I mean, that you not only add textformatter to textfield, but also can give it some config options, that apply only to that one textfield? - field A - apply TextformatterX, some-config-value=89 - field B - apply TextformatterX, some-config-value=14 Thanks
  19. Hey Ryan, I'd like to use Processwire's query parsing functions (or object implementation), which are already implemented to parse module's settings, and parse something else. So what do I need to do, if I have string like customthing=1|2|3, anotherstuff=1 and I would like to receive object (or array) with customthing and anotherstuff as keys and the rest like their values? Thanks
  20. I hate that thing. Every time I turn off 'instant personalization' (that's what it's called), they change something and I have to turn it off again. I hate it.
  21. But it isn't working? This works: foreach ($page->images as $pi){ $page->images->remove($pi); } $page->images->add($commitsGraphSrc); $page->images->add($languagesGraphSrc); $page->save(); This doesn't (throws the aforementioned exception) $page->images->removeAll(); $page->save(); $page->images->add($commitsGraphSrc); $page->images->add($languagesGraphSrc); $page->save(); Edit: I thought that loading up the generated images from google chart is the problem; I removed the gchart images, uploaded one other file via administration and fired up the code with removeAll(); - same thing happened. Exception. Ot fails on 'argument instanceof Pageimage', when argument is 'string'. I don't know why.
  22. Hey Ryan, you probably misunderstood I switched from generating the URL with '&' (HTML encoded ampersand) to '&' (ampersand only) and now it works. I pull the google image in, save the page, then do some renaming... and suddenly, I've got nicely named google charts
  23. I replaced $page->images->removeAll(); with foreach ($page->images as $pi){ $page->images->remove($pi); } And it works. But shouldn't removeAll() work the same way? Did I fuck up something on my install?
  24. Another error Following code: $page->images->removeAll(); $page->images->add($commitsGraphSrc); $page->images->add($languagesGraphSrc); $page->save(); $page->images->eq(0)->rename('commits-graph-'.substr(date('now'),0,4).'.png'); $page->images->eq(1)->rename('languages-graph-'.substr(date('now'),0,4).'.png'); $page->save(); should delete all images if any, add two new images, save the page, and then remove the images to something sensible from the google chart URL (because $..GraphSrc is google chart api URL). And the delete fails horribly with following: [b]Fatal error[/b]: Exception: Invalid type to Pageimages::remove(item) (in /Users/adam/Sites/this.is.secret/wire/core/Pagefiles.php line 182) #0 /Users/adam/Sites/this.is.secret/wire/core/Array.php(653): Pagefiles->remove('commits-graph-1...') #1 /Users/adam/Sites/this.is.secret/site/templates/github.php(103): WireArray->removeAll() #2 /Users/adam/Sites/this.is.secret/wire/core/TemplateFile.php(92): require('/Users/adam/Sit...') #3 [internal function]: TemplateFile->___render() #4 /Users/adam/Sites/this.is.secret/wire/core/Wire.php(267): call_user_func_array(Array, Array) #5 /Users/adam/Sites/this.is.secret/wire/core/Wire.php(229): Wire->runHooks('render', Array) #6 /Users/adam/Sites/this.is.secret/wire/modules/PageRender.module(236): Wire->__call('render', Array) #7 /Users/adam/Sites/this.is.secret/wire/modules/PageRender.module(236): TemplateFile->render() #8 [internal function]: PageRender->___renderPage(Object(HookEvent)) #9 /Users/adam/Sites/this.is.secr... in <b>/Users/adam/Sites/this.is.secret/index.php on line <b>203</b> Also, if it;s something, I'm not totally sure why calling $this->remove() in the Array does Pageimages::remove... or why the $item in chekcing isValidItem is string and not pageimage.
×
×
  • Create New...