Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

2 Neutral

About Hardoman

  • Rank
  1. Hello Horst, thanks again for your hints, the following solution works for me, replaces the original image and the merged image is usable in the editor afterwards: (Code is embedded in ready.php) $this->addHookBefore("InputfieldImage::fileAdded", function ($event) { // Get the image $image = $event->argumentsByName('pagefile'); // Location of watermark image $pngAlphaImage = $config->paths->templates . 'watermark.png'; //Save image with watermark $master = $image->pim2Load('full', false)->watermarkLogo($pngAlphaImage,'SE', 0)->pimSave(); //Setting some variations $sizeArray = array(array(448, 336), array(678, 506), array(908, 676)); foreach($sizeArray as $sizes) { $master->size($sizes[0], $sizes[1], array('upscaling'=>false, 'cropping'=>false, 'quality'=>90, 'sharpening'=>'soft')); } $image->setFilename($master); //Set generated image as main image $image->setOriginal($master); });
  2. Hello Berhard, hello Horst, many thanks for your hints and the big code chunk sent by Horst. I'm still testing and will update this comment, when I am done or if there are more questions. Thank you very much. 🙂
  3. Hello community, we have a website running version 3.0.118. The owner would like to have a watermark merged to the images, that are being uploaded in the CKEditor as a requirement. Image upload besides the CKEditor within galleries and single images works as a charm already. We also use croppable image 3 there. (PIM2) To realize this requirement, I thought of using a hook in the admin area. So, I read a lot in our forums and tested this by adding a hook into the ready.php file. $this->addHookAfter('InputfieldFile::fileAdded',function(HookEvent$event){ wire('log')->save('test','Image upload works'); ... The log entry is being created correctly. But when I try to use the pim/watermark-function like in a template, he cannot find the watermark-image anymore. Furthermore, when I try to get the page-id, it does not seem to be accessible, because the application does not seem to know how to reference it, or I dont know the right way to do so… So my questions are: Is this the right attempt at all or will there be another, better workaround? It seems, I cannot access the page object (of the content page) within this scope or file but I would need it to save the processed image inside the right files/id folder Would it be better to place the hook into the admin-template? (or admin.php) Thanks for any hints in advance. 🙂
  4. @Robin, many thanks for your hints! I also discovered the hook to add custom classes which I added to the secondary menu. That way, I'm able to make it nicely responsive. Have a nice evening.
  5. Hello Robin, thanks for welcoming me and for the solution provided. Sorry for my late reply, I just tried it using the 'xtemplates' option and it worked like a charm! Well, actually, I have another question: Is there a way to provide a 2nd menu using these options which would also collapse with the 'main-menu' into the mobile menu when the page is being resized? But I will try to read all the post in this forum at first.. Thanks once more.
  6. Hello there, I would like to place a weblink into the MarkupSimpleNavigation, that would open this link in a new tab (target="_blank"). Unfortunately, I did not find any solution yet. Thanks in advance for your hints. Best regards
  • Create New...