Jump to content

bernhard

Members
  • Posts

    6,062
  • Joined

  • Last visited

  • Days Won

    295

Everything posted by bernhard

  1. ok thank you for all the explanations
  2. thank you. seems that the headers are not set... should that be done by the uikit script? is this an issue i should report to them?
  3. a nullpage will return 0 for the id, not NULL, so the correct way to check is just like i wrote if($item->id) { // this is a page } or if(!$item->id) { // this is a nullpage } see here: https://processwire.com/api/types/nullpage/ @tooth-paste can you show us your current code? that would make it easier. in your case it would be something like if($items->count() > 0) { // we found x children, so show the arrow }
  4. a quick&dirty hack could be to use something like this (http://modules.processwire.com/modules/page-list-better-label/) to modify the page label and use some jquery to hide all pages that do not have ##templatexy## in their label of course that's in no way secure but if you only need some kind of shortcuts that could be a fast solution...
  5. if($whateverpage->id) { // show your arrow/text } just put it in an IF and check the page id
  6. Thank you for the snippet lostkobrakai. Do you think it would somehow be possible or make sense to have kind of an export button (like the one at templates) that makes it possible to copy/download a script with all the API commands to create an exact copy of that field with all settings?
  7. i think that should be built in the core! thank you for building it. i've also come across this problem sometimes...
  8. maybe you are looking for this? http://modules.processwire.com/modules/process-dashboard/
  9. i think some of the usecases can be solved by using normal pages and using https://processwire.com/talk/topic/11040-visual-page-selector-commercial-page-picker-module-for-processwire/ for selecting them on other pages
  10. get your point maybe the easiest would be to send every new user a short HOWTO with the most important info (some problems that come up now and then) how to attach images to your post how to get notified of replies to your questions (direct link to settings) how to use google to search the forum ?
  11. just a small thing: i think it would be good to turn the option "follow this topic" ON by default. i know you can do this in your settings, but i think for new users this can be really hard to find - especially if they don't even know about it i think this kind of opt-out would make more sense and would prevent new users from missing answeres to their questions (for example if they think their question is already answered but then someone comes whith a new hint and they never read it because they never check back to this topic...)
  12. hi citech, i would recommend to create a separate template + page for that directly in the PW pagetree! if you put your file directly in the root you may run into problems some day (eg if you want to do a profile export). it's very easy to setup, although it is also a LITTLE more work: create a template (contact) + template file (eg /site/templates/contact.php) create a page in PW pagetree (eg /tools/contact) no you can point your form submit to /tools/contact and you have everything well organised and in place. you should try to keep all your own work/changes in the site-folder. this method does also have the benefit that you have all the PW api available (like sanitization which you will have to do with your contact data) and can also use urlsegments and all the great pw stuff welcome and have fun with PW edit: use caution what settings you use for "trailing slashes" or you may point your form to a 301 redirect. it can make a difference if you use /tools/contact or /tools/contact/
  13. thank you pierre-luc. yes that's why i thought it should be an $config->ajax request... this is the code for the upload via uikit: /** * * stickerframeupload * */ var progressbar = $("#stickerframeprogressbar"), bar = progressbar.find('.uk-progress-bar'), settings = { action: config.pageUrl + 'setstickerframe/', // upload url single: false, // make one request per file = true/false filelimit: 1, params: {width: $('#stickerframemodal .rahmen').width()}, //allow : '*.(png)', // allow only PNG images loadstart: function() { bar.css("width", "0%").text("0%"); progressbar.removeClass("uk-hidden"); }, progress: function(percent) { percent = Math.ceil(percent); bar.css("width", percent+"%").text(percent+"%"); }, allcomplete: function(response) { bar.css("width", "100%").text("100%"); setTimeout(function(){ progressbar.addClass("uk-hidden"); }, 250); var res = JSON.parse(response); config.stickerframetmp = res.stickerframe; config.stickerframepreviewtmp = res.stickerframepreview; $('#stickerframemodal .rahmen').attr('src',res.stickerframepreview); } }; var select = UIkit.uploadSelect($("#stickerframeinput"), settings), drop = UIkit.uploadDrop($("#stickerframedrop"), settings); here is the info about uikit drag&drop upload: http://getuikit.com/docs/upload.html yes, jquery; no proxy...
  14. as this is now built in the core i will not take this further... https://processwire.com/blog/posts/processwire-3.0.9-adds-new-long-click-and-save-actions/#new-page-edit-save-actions
  15. ok maybe thats related to tracydebugger? ErrorException: Class 'wireTempDir' not found in /var/www/...module:65 Stack trace: #0 [internal function]: Tracy\Debugger::shutdownHandler() #1 {main} (stored in /var/www/.../site/assets/logs/tracy/exception--2016-03-02--17-39--0979d2c325.html)
  16. there are still some wrong wireTempDir that shoud be WireTempDir
  17. thank you adrian, never used those configs so i was not aware of them. thanks for the adivce! will use wireTempDir here and in future
  18. ah, of course that was the problem! i had a save() directly after the removeAll() but that didn't make any difference. but adrian got me on the right track: removeAll() save() createPDF() add() save() // early return when no valid page object if(!$page->id) return false; $page->of(false); $page->stickerpdf->removeAll(); $page->save('stickerpdf'); // get mpdf instance $pdf = $this->modules->get('WirePDF'); $mpdf = $pdf->mpdf; // filename for generated pdf $filename = 'sticker.pdf'; $path = wire('config')->paths->files . $page->id . '/'; $filename = $path.$filename; $mpdf->WriteFixedPosHTML( '<div style="font-size: 10pt;">TEST ' . date('H:i:s') . '</div>', 29, 53, 67, 1 ); $mpdf->Output($filename, 'F'); $page->stickerpdf->add($filename); $page->save('stickerpdf'); thank you both!
  19. all the same. already tried save('stickerpdf') and save() PS: PW 2.7.2
  20. hi everyone, can you please confirm that i'm not doing anything wrong with this: // filename for generated pdf $filename = 'sticker' . date('ymdHis') . '.pdf'; $path = wire('config')->paths->files . $page->id . '/'; $filename = $path.$filename; $mpdf->WriteFixedPosHTML( '<div style="font-size: 10pt;">TEST ' . date('H:i:s') . '</div>', 29, 53, 67, 1 ); $mpdf->Output($filename, 'F'); $page->of(false); $page->stickerpdf->removeAll(); $page->stickerpdf->add($filename); $page->save('stickerpdf'); this code works, but as soon as i change the filename to a static value (like sticker.pdf without the timestamp) after the second creation of the file (= first overwrite of an existing file) the sticker field will hold a 0 byte file with name "sticker.pdf" and i get the error Warning: filemtime(): stat failed for /var/www/.../site/assets/files/1030/sticker.pdf in /var/www/.../wire/core/Pagefile.php on line 324
  21. hi horst, me again just came across https://processwire.com/api/variables/log/ and as i read the docs i thought it is quite similar to txt-queues. i think one could easily create simple queues this way and would be interested in your opinion. creating a new queue would be as simple as $log->save('examplequeue', 'mydata'); fetching lines from the end of the file is also easy (http://kongondo.github.io/ProcessWireAPIGen/master/source-class-WireLog.html#196-229) and could maybe modified by ryan with an option go get lines from the beginning of the file and not only the end. this functionality is already built into the filelog class http://kongondo.github.io/ProcessWireAPIGen/master/source-class-FileLog.html#164-216 only thing missing would be a method to delete rows from the beginning or end of the file, but that would also be really easy. edit: don't know about the "workers", didn't get the concept...
  22. don't know how hard that would be to implement but in my case it would be better if it was configurable globally. maybe if it is NOT set it will stay "auto" like it is now, but if it is set to eg "png" it will use this as default? definitely no big issue - just a suggestion for a very very very small improvement
  23. awesome module horst, thank you very much! think i found a little bug? // config.php $config->imageManipulatorOptions = array( 'outputFormat' => 'png' ); // template $image = $image->pim2Load('sticker')->grayscale()->pimSave(); does create a jpg. $image = $image->pim2Load('sticker')->grayscale()->setOutputFormat('png')->pimSave(); does create a png (that's what i wanted, but setting it in config.php seems not to work)
×
×
  • Create New...