Jump to content

Soma

Moderators
  • Posts

    6,808
  • Joined

  • Last visited

  • Days Won

    159

Everything posted by Soma

  1. @isellsoap No it's not supported/possible. Though I'm sure it can be implemented just not easy and I have no time. But you could create your own hook for that usecase it would be easier. "All you need to do to enable it, is add the name (i.e. images) of the image field you have on the template to the custom label option in the advanced template settings." In the template advanced setting you can enter field names what then would be the label in the page list tree. The function that is responsible for this is also hookable and there's several modules that do it you could look at how to archive what you want.
  2. Maybe there's some new settings in core that would handle that if the setting quality changes it will force a new generation (which would be desired anyway) Maybe Horst knows as he worked on that one. I think the new naming convention includes quality, which would make that work.
  3. It's always as a project gets big you'll have to take care. No matter what CMS. In case of images: a. you can now in 2.6 delete variations for a image right in the backend. But that doesn't work for batch processing a whole site's images. b. you can write a script to delete all variations through API, but that as soon as there's 1000's of pages involved you have to take care of memory, script time etc. Bit this if you own ListerPro (which I recommend all PW users should buy anyway) you can use and build an custom action that batches all your pages (or the ones you filtered) to remove variations. It's built with scalability in mind so it scales for millions of pages (just would take a very long time). c. you can also use the API when using $page->image->removeVariations() to delete and force new generation of variations. Then use a template var to toggle that globally in your template. Usually a custom $config var would be best as it allows also modules to read it. This works fine when building a site and you want to experiment to get the best options. Maybe not always suited but something like: $config->forceNewVariation = true; The always use a code like this where you generate thumbs or sizes. $img = $page->image; if($config->forceNewVariations) $img->removeVariations(); $img = $img->size(100, 100, $options); Of course this doesn't work well if you're live and have 1000 of pages. As you'd have to view all pages again to trigger new creation WHILE the setting is true. Just a few ideas.
  4. It's all correct and works. So what is different to your other projects? Are pages published? Are they viewable? Is the page really in the PageArray, but when $page->next doesn't even work you seem to have a problem somewhere. No idea sorry.
  5. I think since you can't unpublish users, Users find will find all anyway. $users->find("your selector here", $options = array("findAll" => false));
  6. Turn on config advanced mode, create template and select fieldgroup from another templates fieldgroup to share the fields but have a new template.
  7. You don't need to get the field every time as you already get it in the loop. Your getting the inputfield without context.
  8. A save will uncache all pages and you loose data.. so maybe not use save ready but after save.
  9. You don't need to save when hooking saveReady as PW does it already right after hook.
  10. If you watch console it says: Refused to display 'http://processwire.com/' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'. Just confirming that it's htaccess.
  11. PW doesn't allow to be Iframed via a htaccess setting, maybe that's why. You can take it out and test.
  12. "41-0" PRIMARY I think it is an indize of pages_id and sort or alike. FieldtypeMulti can be a lot. It could also be a page field etc. 1062 is the #id of the error not a page Welcome to advanced PW. I've been there since a long time.
  13. If you have some import script/bootstrap or maybe or alike that will result sometimes in a /http404/, I'm seeing that since long time in logs when errors occur. Meaning there's no page with a url. Bootstraped scripts also result in a "guest" user. Or if it is triggered by a lazycron by a guest visit. A little annoying in that you need to know it or assume it's happening on the 404 page, which is not true. I wonder if it would be possible to fix this.
  14. What's the best arguments against a "back" button on website. Client and print designer insist and waste hours discussing how and where.

  15. I can have multiple repeaters multilanguage in 2.5.23 with no problems. Do you have some security modules on your server that get's in the way?
  16. RT @processwire: New post: Inline ajax page editing comes to ProcessWire with the latest ListerPro (ProcessWire 2.6.6) – https://t.co/fqwCZ…

  17. As far as I know you can't unpublish user in admin.
  18. RT @Suspiremedia: We've just launched Precise Research: http://t.co/CuWYyJ5Fsg a #responsive site built with #Processwire

  19. I don't really know, it's just something we had to turn off for every project because of users or site users. I never had this happened to me. What I noticed through is problems with login itself, wire challange cookie not getting deleted when logging out etc.
  20. Turn off sessionFingerprint in config.php. I'll record this, so I don't need to write it every other week the same.
  21. This FormTemplateProcessor is older and wasn't meant to work with file/image fields, because of "you need to save page before files.." protected function ___savePage($form) { if(!$this->contact->parent) return; $this->contact->name = date('y-m-d-H-i-s-u'); if(in_array('title', $this->skipFields)) { $this->contact->title = date($this->dateFormat); } if(ProcessWire::versionMajor == 2 && ProcessWire::versionMinor == 0) { $this->contact->status = Page::statusHidden; $this->contact->removeRole('guest'); } else { // PW 2.1 and above $this->contact->status = Page::statusUnpublished; } $this->contact->save(); } You'd need to change how the script saves the page values to exclude file fields, save page and add files. Apart from that I doubt the rendering of a file or even image field in the way this module is set does work, as when you render a form from a page's (input)fields will throw problems as file field in a context of a page isn't working as it needs a page that is existing and saved. It's designed for backend primarily. // get the collection of inputs that can populate this page's fields $inputfields = $this->contact->getInputfields(); // make all the fields required and add them to the form foreach($inputfields as $inputfield) { if(in_array($inputfield->name, $this->skipFields)) continue; if(in_array($inputfield->name, $this->requiredFields)) $inputfield->required = true; $form->add($inputfield); } It can get tricky to use this approach and need special workarounds to get this working. File fields need a page id to know where to store and upload the image. So after submitting and processing the form the page should already be created and the file will get uploaded no matter if the form was valid or not and so on.
  22. Can you show code or tell what you're doing? From the error you create new user, and this works fine here with file fields on user template. $u = new User(); $u->name = "test2"; $u->save();
  23. It's in the error.. "save page before files can be accessed". This isn't a bug and has always been like this.
×
×
  • Create New...