Leaderboard
Popular Content
Showing content with the highest reputation on 01/27/2019 in all areas
-
We're finally launching a redesign of our website! Doesn't feel like it to us, but our previous design was already from 2013 ? https://ed-works.com/ We like to keep things simple, so the only third-party modules that we installed were Tracy debugger, Admin on steroids and Admin Theme Boss, which we tweaked a little bit to our taste. All in all, there's not much going on inside PW. Our main concern was to serve the frontend with responsive images with a close quality to the originals, and for this, it's important that PW allows us to use ImageMagick for resizing them. We also love to use PW's image tags to add classes to the images. In this case, we use them to display the images with three different sizes. We also had to change the templates to serve the projects to the homepage via Ajax. We hope you guys like our new baby ? Edit: I forgot to refer that we also changed our logo and tweaked our name to ED works.4 points
-
Background I'm creating a module to integrate https://pushalert.co/ into ProcessWire. You actually don't even need a module. You could just use the "Other Websites" javascript provided by PushAlert for basic functionality, ie send a broadcast notification to all subscribers. This is essentially what all the other integrations, including WordPress, do. The WP integration installs a widget with a form enabling the admin to enter details such as title, message, etc from a blog post. It does not: collect any statistics within the CMS about the notification enable audience fine tuning to eg a particular subscriber or subscriber segment within WP. The admin needs to use the PA dashboard for that functionality PushAlert has a javascript and REST API. It's intended that this module will use both. https://pushalert.co/documentation What my module does so far: associate a subscription with a user. FE user clicks a button on the website front end to subscribe and/or agrees to the browser popup to accept notifications from this site send broadcast push alerts from a page within admin It doesn't have a 'widget' but easy enough to create a fieldsetpage with the relevant fields and add that fs page to any appropriate templates, then with a hook, send the notification. Need to be careful that once published/sent, the notification is not automatically re-sent on subsequent page edits. Looking for help/collaboration on how best: to send a notification, eg from a blog post, then track the statistics. Dilemma is that the push notification must come from the admin page. Responses go to the sending page which, as it's an admin page, is restricted and will not accept the https response. This is where the other CMS integrations stop. The only json response from PushAlert is the status, eg 'success', and the notification id. There is no opportunity at this point to capture the sending page id. handle, 'once sent on page publish', do not automatically resend on future page edits Am thinking along the lines that FS Page will have a @kongondo runtime markup field https://modules.processwire.com/modules/fieldtype-runtime-markup/ to pull the stats from PushAlert. Every time an admin visits the page, the stats will update. Once an admin checks the 'Send notification on page publish' checkbox, a hook creates new front end page that records the 'sender page', sends the notification request to PA, which then uses that newly created frontend page, as the response endpoint. Another rook re-associates the front end page with the admin page (eg blog post), to update the stats. Potential use cases: Notify individual and/or users with a particular role of an event, eg "New work opportunity" for job seekers; new blog post published; entries now open, etc... Looking for help/ideas/collaboration on this module. Please let me know if you're interested and as I do, believe this would be a great addition to ProcessWire3 points
-
@Robin S Good point, I need to update that phpdoc in that file and will. I think it'll be more convenient for users if I keep it up to date with Sanitizer, rather than removing it completely. At least I like my code editor being able to recognize them as function calls rather than errors. As far as I know, there's not anything we can do phpdoc-wise to cover instruction methods (like text50_entities), since there's basically an infinite possible combination of them. Though will be translating the blog post into regular documentation for these new additions.3 points
-
I've made some development using OneSignal's API which has the caveat that if you use their free service they can use your data for their purposes. For the 'once sent on page publish' issue, I just put a checkbox on the pages that enable notifications and check them if I wan to actually send the notification. Why would you not be able to get the response? I don't remember having any trouble getting responses from the OneSignal API, all code ran through a hook in ProcessPageEdit. I then saved the response data and basically just checked on page load for the notification info with its ID, I see push alert has a similar API. (if it had been completed, and how many had received it,failed, clicked). In my case, I thought the API was really nice and offered an easy way to manage mulitple websites straight from the API. (that way i handle multiple website's notifications from one place) . Also the Js to actually display subscription buttons info frontend or call their API in an easier fashion from a custom button. I even configured some color fields and text fields in PW to customize every text/color that rendered from their Js UI passing a customization object. Also didn't have to build any reporting stuff which for my case, wasn't necessary.2 points
-
ProcessWire 3.0.125 has several useful new $sanitizer methods and options, as well as new ways to access them directly from the $input API variable. This makes dealing with user input even easier than it was before. This version also brings updates to our translation functions and improvements to our API documentation: https://processwire.com/blog/posts/pw-3.0.125/1 point
-
Your cache function doesn't return JSON though, but rather a PageArray with the full user objects. I suggest only returning the JSON data you need to see if that makes a difference. That's correct. A solution is to use $pages->findMany() with the user template. $members = $cache->get('members', '+10 minutes', function($pages) { $member_pages = $pages->findMany('template=user, roles=member, sort=lastname, limit=3000, check_access=0'); return json_encode($member_pages->explode(['name', 'email'])); // Whatever fields/properties you need from the member pages });1 point
-
1 point
-
@adrian do you ever sleep? ? The API explorer works like a charm. I also just discovered Adminer: Beautiful. I needed to use it just now to get rid of a stubborn module + fieldtype that wouldn't go away properly using the standard de-install routine. I have a small question re: Tracy file editor: on one PW installation you can't do "save". The page reloads, but the changes will never be saved. I see nothing in PW or Tracy logs. Do I need to modify server settings somewhere? (I don't remember having to do that for any other PW site yet). SERVER DETAILS ProcessWire: 3.0.124 PHP: 7.0.7 Webserver: Apache MySQL: 5.5.50-38.0-log Latest Tracy1 point
-
Someone else once mentioned that he didn't get the console errors in the response tab - turns out he didn't have "Disable Cache" checked on the Network tab and apparently that made a difference. I always have it checked because Chrome caching drives me crazy but this might be a helpful hint for others.1 point
-
Have you checked out Foxpush? The free plan has unlimited subscribers. Maybe overall has better features than PushAlert?1 point
-
I am generally interested, but I'm wondering: What's the advantage of using a service such as pushalert.co? Apparently there is a PHP library you could use: https://github.com/web-push-libs/web-push-php/blob/master/README.md I'm guessing the hard part about the whole setup is to create server keys? Guess I have to dig deeper into this whole topic...1 point
-
Feel free to keep reporting here. I am checking in here for errors like this every few days and then fixing them as they come up. I'm guessing not too many more of these will turn up, as I've been continuing to update the logic in our 404 hook, plus logging 404s in ProfilerPro to catch any others that might have been missed.1 point
-
It looks like there is a PHP error message breaking the JSON - in your dev console click on the image upload ajax call (Network tab) and go to the response tab.1 point
-
1 point
-
I can confirm this. Just stumbled over this today myself. @ryan I wonder if there's a central place where we can report such outdated links? (like a JIRA ticketing system) I pointed to a (probably forgotten) Hanna-Code in the docs a few days ago, which was supposed to load an iFrame or screenshot from somewhere (but nothing was rendered anymore), but I guess it was overlooked. On another doc page there is a TOC link which isn't valid anymore*; where can we post such issues and can make sure you will actually see it? I fully understand that a scattered bunch of forum posts is not the ideal way to handle such scenarios. * Example: https://processwire.com/docs/fields/dependencies/#themes - the corresponding chapter is not there anymore.1 point
-
Also, on https://processwire.com/docs/fields/dependencies/ you have a couple of links to the form builder module, but these are linking to http://modules.processwire.com/modules/form-builder/ instead of the new https://processwire.com/store/form-builder/1 point
-
1 point
-
Hi bernhart ;-), thanks, that did the trick! Here's my code, if someone also needs to do this: wire()->addHookAfter('ProcessPageEdit::buildForm', function (HookEvent $e) { // skip the whole thing and return, if the user has not the proper role if (!wire('user')->hasRole('superuser') && !wire('user')->hasRole('useradmin')) return; $form = $e->return; $boxes = ['privacy', 'consent']; foreach ($boxes as $box) { $boxfield = $form->getChildByName($box); if($boxfield){ $boxfield->required = false; } } });1 point
-
All done. @bernhard I had to modify return false to true to to keep processing other tables in the loop (if any).1 point
-
@ryan - just found another "Internal Server Error" on the new website for you: https://processwire.com/search/?q=%24page( You can get to this by typing: $page( in the live search and hitting Enter1 point
-
@ryan On the Docs' page The $pages API variable, the first red link $pages API methods is linking to the page itself (instead of https://processwire.com/api/ref/pages/ ).1 point
-
In the API documentation, for some reason all the methods under any of the Core Classes (e.g. Fieldgroup, Template) are trying to link to pages under the "Page" documentation - often linking to pages which don't exist. For example... Fieldgroup::getTemplates() links to: https://processwire.com/api/ref/page/get-templates/ Templates:getNumPages() links to: https://processwire.com/api/ref/page/get-num-pages/1 point
-
1 point
-
Not sure if you need this anymore and if I understand your issue properly, but this is how you can hook to get your custom translations. I use it for testing purposes in one of my modules, adding here too, perhaps somebody will find it useful. wire()->addHookAfter('LanguageTranslator::getTranslation', function (HookEvent $event) { $args = $event->arguments; // do something here... $event->return = "aa"; });1 point
-
I am also using dsnmasq on my local dev setup and I think all you should have to do is uncomment this line in the standard PW htaccess file: RewriteBase /1 point