Jump to content

horst

PW-Moderators
  • Posts

    4,088
  • Joined

  • Last visited

  • Days Won

    88

Everything posted by horst

  1. @toni Very often it has to do with not enough memory for loading the source image into ram and create the variation(s). Check PHPs max_memory and if possible, use the imagick image rendering engine, as it can process images in chunks or lines, whereas the GD library always need to load the complete uncompressed image into ram.
  2. @gmclelland here are screenshots of my use case and solution with the medialibrary module and the imagepicker module: This is very nice solution. The site owner likes it. She can select completly visual. No distracting informations around. Just the icons. :)
  3. @gmclelland many thanks. Will have alook at it. Meanwhile I had solved it with bitpoets medialibrary (and maybe something other in combination? Don‘t remember correct atm.)
  4. No, sorry, no snippet at hand. But you can look into any TextformatterModule that deals with images, as they do exactly that (parsing the markup and identify images). Look into the modules directory to find some. ;-)
  5. Hi and thanks for this useful module. I added to my list of things I need to explore soon. ;-) A common usage for modules that need to inject content in the head or body output of pages, is to optionally serve a manual way per API call besides the automatic way.
  6. I think, you need to parse the html markup of the textarea field(s) for <img src="..." />, collect any found in an array, and then, when displaying all images from the images field, compare each name with the collection and skip those that exists in the collection.
  7. Hi Pete, I'm not sure if this is of any help with editing user, as it all belongs to page edit buildform. But maybe you just have to look for ProcessUser instead of ProcessPageEdit like in this related snippet: protected function afterBuildForm(HookEvent $event) { // Only for ProcessPageEdit (not ProcessUser) if($this->process != 'ProcessPageEdit') return; Here are some links to posts with tips and other links on this topic for pages: https://processwire.com/talk/topic/17444-modifying-tabs-moving-fields-to-another-tab-in-page-editor/?do=findComment&comment=153312 https://processwire.com/talk/topic/19537-pageeditor-children-tab-possible-to-load-children-directly-on-open/?do=findComment&comment=169412 https://processwire.com/talk/topic/14887-hook-to-hide-inputfield-in-admin/?do=findComment&comment=133586 Regarding this useful information, you cannot completly remove the name filed, but hide it:
  8. Hi @kixe, additionally to what @jploch said above, and when you are already at it ;-), it would be very helpful to have the option for auto-backup on login! The real life usage of auto backup on logout is not consistent because some users simply leave the backend without logout process. So I would prefer to switch to auto backup on login process. :-) (Login process can not be skipped like Logout process!)
  9. What's about a cache busting param with the last modified timestamp of each image variation file? /site/assets/files/1/basename.300x0.jpg?ts=1565267238
  10. https://www.i-programmer.info/news/197/12978.html Nothing practical for me, but an interesting read. ;-)
      • 1
      • Like
  11. Tracy debugger has many tools to help in development. One of them is the user-switcher, which exactly does what you asked for! There are also other modules out there that provide this user switcher functionality. If I do remember right, @Pete has build and released one. (search in the modules directory for it) My ALIF module once came up with this, but in the meantime I have stripped it out, as there are now other solutions for this, so that I don't have to maintain to much functionality with my modules. :)
  12. @ryan in regard of debug_backtrace(), I ask myself, if something like this, PHP String Hidden Characters: Hide strings to avoid appearing in stack traces, may be useful for us in some parts too? Thinking on names, emails, document_roots, serialnumbers (Promodules), etc., - as people tend to copy&paste their stack traces into (public) forum posts when asking for help.
  13. Can you may use the IMagick-Engine instead of GD, just for testing? You can enable it under modules > core > image, if your server supports it.
  14. Hi @Edison, if this shows the old and the new values inlog and mail, this is really good! (Will test this later when back in buero). Only thing that should be changed is the use of (PHP) @mail function. Instead you should use wireMail(). :)
  15. @MoritzLost, I use the lastmodified timestamp of the css or js file as cachebusting value. This way the files gets reloaded when needed, but can be cached in dev and live sites.
  16. @Markus (Blue Tomato) the showIf only works with fields and there values. AFAIK, the published / unpublished value cannot be used as condition for showIf directly in the template editor. But you may define a hook and set the visibility of that field within the hook. Here is example code as a starting point. You can use this in site/ready.php $wire->addHookAfter('ProcessPageEdit::buildForm', function (HookEvent $event) { // make sure we're editing a page and not a user if($event->process != 'ProcessPageEdit') return; // get page and form $page = $event->object->getPage(); $form = $event->return; // optionally check for matching template(s) with a condition if('mydesiredtemplatename' != $page->template->name) return; // get the field and conditionally set the visibility $form->get('yourfieldname')->collapsed = $page->isUnpublished() ? Inputfield::collapsedHidden : Inputfield::collapsedNo; $event->return = $form; return; }
  17. Sorry, no. The current text watermark method analyzes the images and decides between white, gray and black in a automated way. The reason behind that is, you can apply text to any images without knowing which colors it includes.
  18. @Macrura thanks for the hint. Have you tried to change that continue into break at line 525? Does it solve the Warning?
  19. As I understand it, „I prefer“ is not equal with „I never do“ or „I always do“. A single decission may be a compromise related to: possibilities, „costs“, and possibly available manpower compared to expected time expenditure. ?
  20. @tonicastillo Many thanks for sending me your images. I have tested with the original image on windows and on linux. My variations always had correct and 100% identical iptc metadata as the original has. (see my screenshot via PM). It seems you have to control which part within your workflow chain is not properly set to UTF-8. If you are using PW >= 3.0.132, you can use the following code to get direct debug output from images and variations: $image = $page->images->first(); // get the original image, (adapt to your needs!) //echo $image->getDebugInfo(); // THIS MUST BE OMMITTED, BECAUSE I FOUND SOME SORT OF "STATIC" BUG WITH THE NEW DEBUG-METHOD $options = ['forceNew' => true]; $variation = $image->width(300, $options); // create / recreate a (new) variation echo $variation->getDebugInfo($options); // debug output Parts you need to check can be the OS default charset and/or codepage, PWs php files, the Webserver DefaultCharset, etc. In the modules directory you can find a useful set of inspection tools: https://modules.processwire.com/modules/process-diagnostics/ that assists in some parts. It has diagnostics for PHP, Webserver, Filesystem, etc. -------------------- PS: Normally it should be possible to query debugInfo for multiple images one after each other, but an optimization error has crept in.
  21. Hi @tonicastillo, I'm not sure, but it looks like something in your workflow is not utf-8 save. Can you send me one original (uploaded) image, where this happens? You can use PM or my email address, if you like: https://nogajski.de/contact/ Thanks.
  22. You would ask with $pages->get(„yourfieldname=requiredvalue“), or with $pages->find() If you not allready have setup your tags field, you may look at the pagereference fieldtype, or the options fieldtype. Your selector to find pages with the requested flag may include specified templates, parent or others, to be more precise. And if you not allready know the differences between get and find, look it up in the docs, as this is fundamental knowledge in PW.
  23. Without testing anything in this regard, in my understanding, when config.php is called is to early. Never thought this could / should work. In init.php or ready.php I assume it will work.
  24. Yes it does. For example I often use the Textareas ProField to collect a lot of small textpieces in separate inputfields, but it creates only a single table in DB. On the screenshot you see two db fields / tables, contact and map:
  25. Not sure about the blogging modules, as I don‘t know them. For me this looks like a good fit for urlsegments. Look up the API docs for it, I‘m on mobile. Using this, each of your docs template additionally need a date field, if the user should be able to specify the version date manually. If it should be assigned in an automated way, you can use the page creation_date, (or modified one).
×
×
  • Create New...