Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/11/2022 in all areas

  1. After a previous request for Webp support (6 years ago, times flies…) that Horst and Ryan kindly introduced in PW 3.0.132, I'm back with another request for a new image file format, AVIF, which has landed in almost all browsers. I'm actually surprised no one here in the PW community has been asking for AVIF support in ProcessWire as it seems to be provide much more consistent gains in compression and greater relative quality over Webp, and of course over good old JPEG. My experience using it definitely confirms this. I've been using Cloudinary to serve AVIF images to the browsers that support it, but of course I'd rather not use a third-party service, and use it natively in ProcessWire. Imagemagick supports AVIF if I'm not mistaken. Anyone else is interested?
    1 point
  2. @tires the hook need to be Session::loginSuccess - the one given by @adrian - to redirect the user, after he log in. You can write the target url in the session, and you do not really need the GET variable. But as I said in the first idea, if you need to differentiate a user which come from the mailed url, you "have" to give a GET variable or a segment. If you do not do that, the url set in the session will be for all users. It might not be an issue for you. I all needed template, just set $page->url in the session. Apply logic there. And as I said, without distinction, it will apply for all users.
    1 point
  3. Thanks - i will check and see if this can be fixed, or I'll add info to the instructions about hidden pages.
    1 point
  4. Ok then it's not about loading order, then I guess that UIKit.modal() does only work if the modal has some content. If your modal html element does not have content then UIkit.modal(el).show() throws an error, so you either need to make sure that you have some content in your modal or that you show it only if the modal is created properly: <?php if ($page->id == 1): ?> <script> let infoShown = localStorage.getItem('infoPopup'); if(!infoShown) { let modal = UIkit.modal('#modal-center'); if(modal) { modal.show(); localStorage.setItem('infoPopup', 1); } } </script> <?php endif; ?> Maybe you need to change the IF condition to if(typeof modal != 'undefined')... btw I copied your code and you had a space before the .show(): That might also cause problems...
    1 point
  5. thanks again @Robin S this could make me try to the module in a repeater as it uses ajax loading a lot even if it uses "transparent" pages too ? will i resist to try? it's such a client helper when editing their website ? have a nice day
    1 point
  6. I updated my example because $input->is('post') is probably a bit too broad. It might be fine for your case but if you want to show the RuntimeOnly field value as a column in a Lister then $input->is('post') is true when the Lister results get AJAX-loaded according to the filter form values. So checking for the Page Edit submit button value with if(!$input->post('submit_save')) is probably better.
    1 point
  7. Hmm, I guess the field is getting output formatting turned on during the save process and the page editor doesn't explicitly turn it off. I can think of a couple of ways around this. You could get the formatted value and output the markup only if the Page Edit form is not in the process of being submitted (as detected by "submit_save" button value not being present in $input->post): if(!$input->post('submit_save')) { $image = $page->getFormatted('your_image_field'); if($image) { // ... } } Or you could deliberately get the unformatted value which will be a Pageimages WireArray. $pageimages = $page->getUnformatted('your_image_field'); $image = $pageimages->first(); if($image) { //... }
    1 point
  8. I would pretty much agree with all the above comments. Having built a number of web apps, I would say that PW is by far my favourite tool to turn a conceptual design into a working application, quickly and in a fairly ‘natural’ way. Obviously you need some reasonable php knowledge. Also don’t underestimate the work in getting the look and feel that you want for the front end - it’s not like Wordpress in that regard (but I hate WP for apps). You will need to give some careful thought as to whether you do one or two sites. If there is a lot of interaction between the front end and the admin functions then one site is probably best. Otherwise two interacting sites gives you a ‘cleaner’ CMS for the public site but is slightly more complex to implement. Last, but not least, the PW forum members are really helpful if you get stuck ? Ps. Not sure if the op is still interested but that’s my twopennorth anyway.
    1 point
  9. The reason for this error is that your code having "UIkit.modal..." is executed too early (before UIkit is available). You need to make sure that you load UIkit before adding the script that shows the modal.
    1 point
  10. This week we have ProcessWire 3.0.206 on the dev branch and a new version of the ProDevTools UserActivity module, which we'll take a closer look at in this post— https://processwire.com/blog/posts/user-activity-v6/
    1 point
  11. You can write a simple hook, and to redirect to a specific url, you can set the url in the user session, once logged, redirect and unset it. An idea could be to set a GET variable in the link you send to your users so it will work only for theses links, then do the logic in the hook (about checking for the existing GET var and setting the url in the session). Check this thread for the hook :
    1 point
  12. Yes, in a file with namespace ProcessWire that will let you use it: $foo = new \stdClass(); You can also put “use \stdClass” at the top if you need it a lot. The same goes for all the other stuff outside PW’s namespace. Often you’ll need \DateTime or \IntlDateFormatter for example. Edit: the technical term is “The Global Space”: https://www.php.net/manual/en/language.namespaces.global.php
    1 point
  13. I have updated the initial post to suggest how to provide full context flexibility, including for repeater matrix items. See also
    1 point
  14. You are getting hit by a variables scope issue. You cannot use global variables like $modules directly inside a function. Instead, use this (there are other variants - see the new docs here) wire('modules');
    1 point
×
×
  • Create New...