Jump to content

DrQuincy

Members
  • Posts

    304
  • 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

Sr. Member (5/6)

81

Reputation

  1. Just resurecting this one: Is this possible? I don't want to do it at this stage but I'm just wondering how it might be done.
  2. @bernhard Thanks for your massively helpful debug code. I can see now that the Users::* hooks apply to managing users in the back-end so it was never going to work with LRP — the LRP-specific ones are what I needed.
  3. That's great, thanks, I'm definitely going to try that. 🙂 I do want to know why the User hooks aren't firing but in case anyone is using LRP and wondering the same, I have made what I need to do work with the following hooks: LoginRegisterPro::createdUser: use this to send an admin email to let the site owner know that a new user has registered LoginRegisterProLogin::success: used to set approved=0 on $user More info here: https://processwire.com/store/login-register-pro/docs/#hooks
  4. I have a default front-end user field call approved that is a true|false switch. I want to redirect them to a URL is not yet manually approved. I have this hook in $config->prependTemplateFile file. wire()->addHookBefore('Users::login', function($event) { $user = $event->arguments[0]; $user->of(true); if($user->approved === false) { // Prevent login $event->return = false; wire('session')->redirect('/account/?approved=0'); } }); But it does not fire. Do I have the hook wrong or is it in the wrong place? The file itself is definitely being included and if I replace the contents of the hook to a simple exit statement, still nothing happens. EDIT: I am using LoginRegisterPro, are the hooks different?
  5. Thanks for the link! There is no such option on the TfaEmail module page. I only get two settings for the code, the “from” email and the method of sending the email. I get that option in LoginRegisterPro — but not for back-end users.
  6. Just that really. I'm using Ryan's TfaEmail module. I can force this on users by role in LoginRegisterPro — but how can I do it for back-end users? Is it possible? I.e. So any already created users use it and also any futures ones — and prevent it from being switched off. Thanks.
  7. If you want to use video directly on your site — as opposed to embeding from YouTube, etc — is just .mp4 generally okay now? I know you used to provide several formats but I just worked with a company that are just using <video><source src="video.mp4" type="video/mp4"></source></video>. Is that good enough? I tested on my various browsers and it all worked — even on my Linux machines.
  8. Yes, good point, I don't need two different child templates. Thanks.
  9. Thanks but I want to use different sorting dynamically though to avoid adding a separate template. One is news, most recent first. The other is events where the date would be ascending since the dates would be in the future. I hope that makes sense.
  10. I have a template that has a date field attached to it and I use this to reverse sort items. This works great for my blog feed. However, I want to use the same template for an events field. To save me managing an entirely separate template, is there a hook I can use that will uncheck the “reverse sort” checkbox dyanically? So: /blog/ sorts children per the template settings, most recent first /events/ uses a hook to display pages date order ascending Note I am only referring to the site tree in the admin. Obviously, on the front end I can easily use selectors to get the desired result. Thanks.
  11. And here's the answer to migrating large sites! Thanks Ryan. https://processwire.com/blog/posts/webp-images-on-an-existing-site/#implementing-the-webp-strategy
  12. If you enable webp, where the easiest way on a legacy site to get a webp version of every image in the CMS?
  13. Apologies, everything I need is here: https://processwire.com/blog/posts/webp-images-and-more/#webp-image-strategies-in-processwire
  14. This is a bit vague but I've always been behind the curve with regards to next-gen images. To those of you PW masters that use them I have a few questions please. 🙂 What is you preferred format? In 2024, do you still need to supply a jpg/png fallback? How to you manage this in PW given that support outside of the browser is quote poor. What I mean by that is while us devs can work with them easily, clients tend to only know what jpgs are. Thanks!
×
×
  • Create New...