DrQuincy
Members-
Posts
351 -
Joined
-
Last visited
-
Days Won
1
DrQuincy last won the day on August 30 2023
DrQuincy had the most liked content!
Profile Information
-
Location
UK
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
DrQuincy's Achievements
Sr. Member (5/6)
86
Reputation
-
If you enable WebP, it creates variants for all images. However, Ryan's .htaccess code is from here: https://processwire.com/blog/posts/webp-images-and-more/#webp-image-strategies-in-processwire Doesn't rewrite GIFs, I presume this is because they can be animated. RewriteRule ^(.*?)(site/assets/files/)([0-9]+)/(.*)\.(jpe?g|png)(.*)$ /$1$2$3/$4.webp [L] Given this, it seems inefficient to create a webp variants for GIFs. Does the core have an inbuilt way to disable this, or is it by design that this isn't offered/done automatically?
-
The client hosting company has a cap on emails per hour that is fine for now but we might exceed it eventually. Can anyone recommend a paid SMTP service that scales in tems of volume and works well with the stock ProcessWire SMTP module? I just want something that will plug and play but inputting the SMTP credentials rather than having to authorise an app, etc. I have used Mailgun before so that is an option and found the module in the PW directory works. I just find some SMTP services don't always work right away so I wondered if there are any you can recommend. The server is based in the UK so something that has a server nearby would be a bonus for lower latency. Thanks. 🙂
-
Thanks @Macrura I am still using the older UIKit theme. 🙂
-
Any update on this please? 🙂 It seems to be the only module that's giving me warnings on 8.3+. I think just changing line 499 to this would do the trick: $class = static::class; Thanks for this module, I use it all the time.
-
Thanks @FireWire. I tried your PR code but it didn't work for some reason. I have ended up adding this to the $(document).ready() code at the bottom: $('.InputfieldMapMarkerAddress input[type="text"]').each(function() { $(this).on('keydown', function(e) { if (e.key == 'Enter') { e.preventDefault(); // Trigger Geocode by removing focus on search box this.blur(); return false; } }); }); It just prevents the form being submitted on hitting the enter key and blurs the input forcing it to geocode client-side. This seems to work for me although I haven't really tested it much yet.
-
Has something changed with the module? Or has Google changed how the keys work? If you enter an address in the search input once it loses focus it geocodes on the front end. All good. But if you type a new address and save it it tries to geocode on the backend and you get a REQUEST_DENIED error since you can't have a key (unless you have it unrestricted, bad idea) that works by both referrer and IP address and both coordinate fields are set to 0. I'm sure it didn't used to work this way. Why does it even bother to do server side geocoding if you can only set one key? Is there any way to force it to geocode on the front end only? And sorry I might be misremembering but couldn't you click a point on the map and put the marker there? I can't seem to do that now.
-
I just upgraded to .255 and noticed the login user anme and password fields are really close together. Is there a fix for this?
-
This is something I've just noticed when settingup some redirect. Let me use an example on the processwire.com site: https://processwire.com/docs/ https://processwire.com/dOcs/ This both load the same page. Processwire does make the canonical tag lowercase. I just wondered though, is there a system-wide way of directing all requests that aren't files to be lowercase: www.site.com/files/I_am_a_PDF.pdf -> fine www.site.com/folder/I-am-a-Page -> 301 redirects to www.site.com/folder/i-am-a-page Thanks. 🙂
-
Great, thanks.
-
Forgive the possibly dumb question but what does this mean? I notice that the .255 tag has already been added. Does this mean that .255 will receive changes after the tag has been added or that there will be another new master version coming soon? I'm just deciding whether to upgrade my core PW site from .246 to .255 or to wait. Thanks, I love this CMS and its community!
-
I know how to create pages with the API and how to add images and files. I just wondered, though, if there was any in-buit way to handle instant AJAX file uploads as the backend does. As you know, if you submit the files with the rest of the form it can take a while if there are multiple large files. In the PW CMS, however, you upload them and they're applied on save and somehow cleaned up if not used. Is there any way to tap into this workflow or do oyu have to roll your own? Thanks.
-
File access control at field level rather than template
DrQuincy replied to DrQuincy's topic in General Support
Thank you @Robin S I'm pretty sure I did as you said and it didn't work but I have just gone back through. Template set to full access control Images field set to access control but View checked on all roles inc. guest Files field set to access control but View checked on all roles excl. guest And I have accessed the assets in a different browser not logged in and the images can be accessed but not the files. Perfect! My next question is, some of these pages will have a lot of images (20+) and each one of this will now create a new PHP/ProcessWire thread. Now I have got this working, I am worried about overloading the server. Has anyone much experience with this? I wonder if I should: Load the images one-by-one using JavaScript Each time a page is loaded for the first time after being saved copy the images to a public folder before the page is rendered Any other ideas? EDIT: I'm actually thinking make all assets public, prefix restricted ones with “restricted--” or something, block files with that prefix using .htaccess and then create a PHP file (restricted-file.php?file=foo.pdf&page-id=9999) that bootstraps PW and loads the file. I think that would be fairly simple and as light as can be on resources. -
File access control at field level rather than template
DrQuincy replied to DrQuincy's topic in General Support
I've now tried this out. @Robin S This is true but it seems to apply to all image and file fields assigned to the template. In this template I have an images field and a files field. I want the template and everything in it to be accessible by all roles except the files field. I have followed the instructions above. Template: everyone has view access, Prevent direct access… is set to Yes always… Files field: Access set to view for everyone except guest Image field: I tried this as is (manage acess control = No) but that didn't work so I explicitly set everyone to View What happens is PW adds a minus to the site/assets/files folder indicating access control but it seems to be doing it to all fields regardless of how the individual file and image fields are set. Is this expected or have I missed something out? Thanks. -
Let's say I have Fieldset Group called Tables that contains 3 x Pro Fields table. Each table is label, value where label is set via the API and is readonly (see below). If I set the field to be Closed on load, how can I set it so that if in any of the tables if value is empty instead of seeing a closed fieldset: Tables ... I get something like: Tables ... 7 missing values or Tables (7 missing values) ... (either is okay) Additional questions: I also want to hide the new row button but I think I can easily do that with CSS. Use this CSS: li#Inputfield_{myFieldName}pageText a.InputfieldTableAddRow { display: none; } How can I make the label field in the table readonly, add readonly=readonly to the settings for that column doesn't do it. Use this JS: $('input.{myFieldName}-label').attr('readonly', 'readonly').attr('onfocus', 'this.blur()').css('opacity', 0.6); How to sort the table A to Z by label Didn't realise there is a setting for this, great! Thanks. EDIT: Here's how I did it: \ProcessWire\wire()->addHookAfter('ProcessPageEdit::buildForm', function(\ProcessWire\HookEvent $event) { $object = $event->object; $form = $event->arguments('form'); $page = $object->getPage(); $page->of(false); if ($page->myField) { $toAction = 0; foreach ($page->$myField as $row) { if (!$row->value) { $toAction ++; } } if ($toAction > 0) { $form->prependMarkup('<div class="pw-container uk-container uk-container-expand"><div class="uk-alert uk-alert-danger"><span class="fa fa-exclamation-circle"></span> Check the <strong>Page text</strong> tab; ' . (int) $toAction . ' value(s) needs entering</div></div>'); } } });