Jump to content

thausmann

Members
  • Content Count

    13
  • Joined

  • Last visited

Community Reputation

5 Neutral

About thausmann

  • Rank
    Jr. Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hey @adrian, thanks a lot, I've tested your modified version. For me, subfields as top level options are totally fine, already adds a lot of possibilites for user references! I found that my columns have type pageAutocomplete and not pageSelect, I think that's why they were exported as IDs only. I added pageAutocomplete to the fieldType checks and this works! – unless I export both "User" and "User.email", then somehow the $subfields indexes are off (Undefined offset ...). So I made one more change where the main page "User" is not added as an option anymore. To cover all cases I also added id as a subfield option. I marked my edits with //@TH SUBFIELDS There is also pageAutocompleteMultiple, that seems to procude other problems I didn't dig into. TableCsvImportExportSubfieldsTH.zip
  2. Hey @adrian, thanks for this great module. Is there a way to choose a page field instead of the id when exporting a table with a page reference? I have a table with users and it would be awesome to export the name or email instead of the id. As an idea, maybe just a checkbox to export "labelField" instead of value.
  3. @horst thanks, we still need the session / active login somehow but maybe this is a starting point. @LostKobrakai thanks for the link, the Storage Access API looks very promising (requesting user permissions) and matches our use case (user is already signed in in the main window). Apparently this has no Chrome Support (yet). For the OAuth Solution I need more time to understand it 😬 Will post updates here if I find a solution!
  4. Hi all, is there an easy way to implement login and session handling that doesn't require cookies? I'm thinking about passing the session ID as a URL parameter instead of a cookie (like good old PHPSESSID) but I cannot get it working. I can easily append the URL parameter, but I cannot "restore" the session on the server. Do you think it's possible or is the cookie behaviour hardcoded in Session.php? Background: Browsers are working towards more privacy protection and banning "3rd party cookies". While this primarily targets tracking services, it applies to all sites embedded as an iframe. We are using Processwire like an iframe "Applet" for other websites and we start seeing problems (user logins reset) due to the new privacy policies. Safari has already implemented this, Chrome has scheduled this as a standard for 2022 but already has a privacy setting for this feature.
  5. Hey, I just refactored my site to use markup regions and noticed slower responses / rendering times by two-four times. I'm having a landingpage with a Pagetable that has 15 blocks, most of them have a little CSS with mediaqueries that I can now put in the header with pw-append, which is nice, but seems especially costly to do it 15 times. I put together a minimal example showing the speed impact: https://gist.github.com/timohausmann/e7643d75e26135450dab63e33c94de8f This effect scales up so my real page went from 600ms to 3.2s. The page gets cached in the end so it's not a total deal breaker, but I'm wondering if I'm doing something wrong, or if this is normal and markup regions and pw-append aren't designed to be used repeatedly? Thanks for reading!
  6. Okay, issue created: https://github.com/processwire/processwire-issues/issues/1209 As a quick fix I will re-upload my affected non-transparent PNGs with JPGs. Another possible workaround on template level: if($image->width == $width) { $imgUrl = $image->webp->url; } else { $imgUrl = $image->width($width)->webp->url; }
  7. Thanks for your reply! I just tried that and apparently it gives me the same png url filename.1280x0.png. As soon as I go 1 pixel up or down I get a webp URL.
  8. Hey, I'm trying to completely switch over to WebP and noticed some strange behaviour. Let's say I upload a PNG in Processwire of size 1280x800. $page->image->url ➝ correct URL (filename.webp) $page->image->width(800)->url ➝ correct URL (filename.800x0.webp) $page->image->width(1280)->url ➝ wrong URL (filename.1280x0.png), webp file is not generated $page->image->width(1280)->url(false) ➝ correct URL (filename.1280x0.webp) but webp file is not generated So: When I request a size that equals the original file, no WebP conversion is happening (no webp file is created, although a new PNG is generated (...1280x0.png)). When I use url(false), I get the expected URL but still the file is not generated. Also interesting: this issue is only occuring with PNG, not JPG. My Configuration: $config->imageSizerOptions('webpAdd', true); $config->imageSizerOptions('defaultGamma', -1); GD Pageimage::url Hook from here Also tried to output width(1280)->webp->url, it makes no difference I checked that the PNG version is not smaller in filesize (PNG=450KB, WebP (from other tool)=60KB) Tested with Processwire 3.0.148 and 3.0.160 dev I think this post is about the same issue and where I got the url(false) from. Setting 'useSrcUrlOnFail' => false inside $config->webpOptions results in correct output URL (filename.1280x0.webp), but still the file is not generated. So maybe the webp conversion fails? Apparently I see zero webp logs in logs/image-resizer.txt "Don't use resize" seems like a solution here but this is a generic approach in my code, sometimes uploaded images are simply already in the correct size. Any ideas how to fix this and always get dem sweet sweet WebP images? Or did I find a bug? Maybe @horst has an idea what the cause of this phenomenon could be? 😇
  9. For anyone like me who's slowly descending into madness wondering why their fields are ignoring the required validation: Make sure to set required=1 before setting the HTML5 required attribute. Otherwise the required flag will reset to 0. Correct order: $field->required = 1; $field->attr('required', true); Using requiredAttr is more fool-safe, here the order does not matter (and it looks nicer): $field->required(true); $field->requiredAttr(true);
  10. A bit late but hey: If you only pass one argument to attr it will retrieve the value. So to set / tick a checkbox try $field->attr("checked", 1). Note that even attr("checked", 0) will set the checked attribute, so simply do nothing to leave it un-checked. If discard is already an InputfieldCheckbox from your template, you can simply do $field = $page->getInputfield('discard'); and it will automatically come with the correct label, value and checked attr from the backend. To also make this work in a "create new" form (when there is no $page yet) you can also get fields via $fields and a NullPage: $f = $fields->get('discard'); $p = $do_we_already_have_a_page ? $page : new NullPage(); $field = $f->getInputfield($p);
×
×
  • Create New...