Leaderboard
Popular Content
Showing content with the highest reputation on 09/09/2019 in all areas
-
Thanks both, it's been fixed in v2.0.20. Sorry for the inconvenience.4 points
-
What exact consent do you want to save/document/store? Cookie banner? Newsletter signup/opt-in/double-opt-in? Marketing / Re-Targeting opt-in? I'm not a lawyer by any means so I don't want you to follow my approach but this is the way I do it and my legal advisors don't scream in total panic when I tell them about it. Cookie banner Client side cookie (simple true/false) if true: cookies were set and the banner doesn't pop up again if false: no cookies at all (besides session cookies) cookie banner pops up every time Newsletter most of the time I use Mailchimp as I have a GDPR/DPA contract with them to handle everything - they store and document all opt-ins and opt-outs and are responsible for it. Users have to tick up to two checkboxes in order to signup for the newsletter - the first a common privacy checkbox, the second is a detailed explanation that the newsletter is handled by a third party. I will receive a sign-up notification via email I can archive, print or whatever. Related database entries will be deleted a few days later. Mailchimp uses double-opt-in in all cases and documents these. Unconfirmed signups will be deleted once a week. Marketing / Re-Targeting I stopped using it as my marketing budget isn't that high to pay even more lawyers. ?3 points
-
Pushed a new version yesterday that fixes the issue that .ready and .hooks files might be publicly readable thanks to @jens.martsch and @teppo Please update the module to the latest master version and rename all your .ready and .hooks files to .ready.php and .hooks.php! https://github.com/BernhardBaumrock/RockMarkup2/commit/e9c0bcf43d84078e36ee9e219d19b911c180e1683 points
-
I doubt it is a desired solution but unbinding click event which is binded in setupButtonStates function like posted before would do the trick. $(document).ready(function() { $(document).off('click', 'a > button') .on('click', 'a.InputfieldButtonLink', function(e) { e.preventDefault(); var $el = $(event.target); console.log($el); }); });2 points
-
2 points
-
Hi @MateThemes, ProcessWire allows you to have any custom folder you want in its root, so you can leave your cam-directory where it is. The path to the images will stay the same. So, if you included an image with <img src="/cam/someimage.jpg"/> before, you do it just like that in your processwire-template file. Just a small restriction to notice: You must not create a page with "cam" as path in processwire, because that will block access to your folder.2 points
-
Hi @Hardoman I post you a code example below that works for me since ages and also with recent PW versions. It includes watermarking too! It is called in a custom module and the event is >before "InputfieldFile::fileAdded" <, but you can call it in ready.php too. Hopefully it is of help for you. Otherwise please ask further. :) public function importImage($event) { $inputfield = $event->object; // handle to the image field if(!$inputfield instanceof InputfieldImage) { // we need an images field, not a file field return; // early return } if(version_compare(wire('config')->version, '2.8.0', '<')) { $p = $inputfield->value['page']; // get the page, PW < 2.8 } else { $p = $inputfield->attributes['value']->page; // get the page, PW >= 2.8 | 3.0 (or only from 3.0.17+ ??) } if('images' != $inputfield->name) return; // we assume a field with name: images if('album' != $p->template) return; // don't do it on other pages than archive album $image = $event->argumentsByName('pagefile'); // get the image // prebuild variations // AdminThumb $image->height(260); // AlbumThumbnail $portrait = $image->height > $image->width; $w = 228; if($portrait) { $w1 = intval($w); $h1 = intval(($w1 / 3 * 4) + 38); } else { $w1 = intval($w); $h1 = intval(($w1 / 3 * 2)); } $image->crop("width=$w1, height=$h1"); // Slick-Slideshow $wmPng = $this->pages->get('id=13967')->getUnformatted('watermark')->first()->width(403); // sharpening added, quality from 80 to 90 $master = $image->contain('width=1000, height=700, quality=100, sharpening=none'); $master = $master->pim2Load('full', false)->watermarkLogo($wmPng)->setQuality(100)->setUpscaling(true)->setSharpening('none')->pimSave(); $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')); } // sharpening added, quality from 80 to 90 // prebuild variations // check / import IPTC data $additionalInfo = array(); $info = @getimagesize($image->filename, $additionalInfo); if($info !== false && is_array($additionalInfo) && isset($additionalInfo['APP13'])) { $iptc = iptcparse($additionalInfo["APP13"]); if(is_array($iptc) && isset($iptc["2#025"]) && is_array($iptc["2#025"]) && count($iptc["2#025"])>0) { $tmp = $iptc["2#025"]; $tags = array(); foreach($tmp as $k=>$v) { if(empty($v)) continue; $tags[] = jhpTextConversion(trim(strtolower($v))); } $p->images->trackChange('tags'); // prepare page to keep track for changes $image->tags = implode(', ', $tags); $p->save('images'); // save the page } } // check / import IPTC data }1 point
-
I do the opposite: I tend to use != and == when it is necessary, eg. when we are expecting multiple types and coercing can be harvested as a lazy programmer's tool ? Remebering what != and == do can be a challenge: https://dorey.github.io/JavaScript-Equality-Table/1 point
-
Thx for the explanation. I'm aware of that, but my question was more if there is a good reason in this special case why I should use !== instead of != I tend to use !== whenever it is NECESSARY (eg when doing strpos where a 0 is something different than FALSE) and != whenever it is not necessary. That way I know instantly that the type matters... PS: Welcome to the forum ?1 point
-
@bernhard the != or == comparison operator will simply check for a value no matter of the type in example checking against 1, '1', or true will always return true, whereas triple comparison operator will also check for type, therefore if a variable value was set to like var a = 1; checking against boolean like if(a === true) will return false because value of variable a is actually integer. It's best practice using triple comparison operator but it also depends on situation if in example the type of value you are checking against is always known and you always expect it to be the same.1 point
-
Pushed a fix for RockMarkup2 and related modules (RockTabulator) not working in subdir installations. Thx for finding that @dragan1 point
-
Pushed a fix for RockMarkup2 and related modules (RockTabulator) not working in subdir installations. RockFinder2 was also affected because of the wrong api endpoint url.1 point
-
@wbmnfktr I haven't worked out all the details of this part yet. But fields in an integrated form are still present when it comes to what actions can do with them. They are just renamed to have the field name that represents the "form" field as a prefix for each field in the integrated form. So anything that maps the fields in a form to something else (like a page or spreadsheet) will likely continue to work the same way that it currently does, but would have the integrated forms "opened" (for lack of a better term) so that their fields can be mapped like the others.1 point
-
@Sebi, I'm trying out both the single and double JWT auth methods. Double JWT works fine in my tests. With single JWT, it seems that when Bearer token is being ignored if it is not supplied. Meaning, if I submit a request with only an API key (no JWT token), the request is accepted. At the same time, if I submit the request with a wrong Bearer token, it responds appropriately with error 400. In my understanding, both scenarios should return a 400. I'll perform more tests to verify and report if it really is the case or if I'm missing something.1 point
-
1 point
-
I haven't had a look into repeaters yet. I'm avoiding them at all for all my projects as they brought up several problems (especially for finding data via RockFinder). I have a lot more control using regular pages for that tasks and using RockGrid / RockTabulator for presentation and as GUI. Though it should be quite easy to support Repeaters. That's what the concept of relations is for. The column would list the page ids of the repeater pages and the relations would hold the data of those pages (using regular RockFinder2 syntax $repeater->addColumns(['foo', 'bar'])). If you need further help you can PM me.1 point
-
Just added support for really easy translation of all aspects of your field ?1 point