Leaderboard
Popular Content
Showing content with the highest reputation on 01/16/2020 in all areas
-
Hi all. Just thought I'd add the updated site I made for the Judo/BJJ club I run. For some odd reason I decided I wanted to try making a single-page website but still use ProcessWire's great page management tools. The site uses the excellent Template Engine Twig module (slightly modified to work with Twig 3) and dynamically builds itself using the page tree (no hard-coded sections). I'm no great designer, but using the above along with Bootstrap 4 and some probably-excessive animate-on-scroll effects I think it looks clean enough to differentiate itself from more standard martial arts websites. Anyways, you can visit the site at http://jkma.club and hopefully enjoy!2 points
-
For anyone wanting to trace how it is that Pages::trash is called twice... Pages::trash (first call) calls PagesTrash::trash, and when the "save" argument is true (as it is when trashing via the admin) then Pages:save is called, which calls PagesEditor::save. And if that saved page is in the trash then Pages::trash is called (second call) with the "save" argument false. As to whether this second Pages::trash call is necessary and correct, I don't know. Best thing is to hook Pages::trashed as suggested above - this method only fires if the page is successfully trashed, which is probably what is wanted in most cases.2 points
-
You could use PHP output buffering to read your file into a variable. Something like: ob_start(); include('./emailbody.inc'); $emailBody = ob_get_clean();2 points
-
The GDPR doesn't actually handle cookies specifically. GDPR is about processing personal data. A cookie is processed by a webserver when a user accesses your website, so GDPR is applicable IF there is personal data involved in regards to the cookie. Even a simple session cookie is personal data, because it identifies a certain browser session, which in turn likely identifies a person. There are a few things GDPR demands you to provide to users in such a case, like what the data is used for (Art. 13/14) and it needs to have a legitimate reason (Art. 6) for you to be allowed to do so. This is even more complex if it's not a cookie set by your website, but by a third party. There it's the shared responsibility between your and the third party that everything is handled correctly. This is usually done with DPA (data processing agreement) which is a binding contract where both parties essentially guarantee each other GDPR compliance. The GDPR gives users the right to deny consent wherever you cannot use Art. 6 1.f) as legitimate reason. Therefore cookie-banners with the option to not have certain cookies set. The GDPR also says you may not auto opt people into giving consent, therefore the default for optional cookies should be unset. Besides the GDPR there's afaik a law in Germany for cookies specifically, which has been the kinda predecessor for the long overdue EU wide ePrivacy directive. I'm not as well versed with this one. It was essentially the law, which started all the cookie banner stuff.2 points
-
Just one, I think. document.querySelectorAll returns a NodeList. Unlike with jquery collections, you can't call addEventListener on the NodeList but rather need to iterate over its elements and attach a listener to each one. Array.forEach.call(nodeList, function(el) { el.addEventListener(/* your class toggle code here */); })2 points
-
So true. I share your frustration. If it was for me, I wouldn't care (as you can see on my website, if you speak German). But what to do if clients are pushing? I'd like to see a reliable source for that, too. The thread @szabesz linked to, contains a link to Art. 6 GDPR. But like with all legal texts, as a layman it is hard to interpret them correctly. And even if you ask 3 lawyers you might get 3 different answers... In this thread @ceberlin links to an article on a well known German site for legal advice. I'm no subscriber to that site, so cannot access that information. The whole topic remains mysterious and frustrating. At least clients pay for cookie consent implementation. But I'd rather spend my time with more thrilling tasks...2 points
-
FYI - https://www.smh.com.au/business/companies/google-says-goodbye-to-the-cookie-monster-increasing-user-privacy-20200115-p53rj5.html2 points
-
Yes it is good and in use on the site https://www.p-jentschura.com/ I added this directly in the HTML so it has nothing to do with ProcessWire in general, but I am thinking about developing a module for it to set the options. But thats only for the far future and next website project.2 points
-
Hello @Brett. Thank you for your feedback! I was able to reproduce your issue and hopefully tracked down the bug. Please, install the latest version and give it a try. Let me know if the issue is resolved for you. New Release 1.1.3 - Fixed bug with FieldtypePage returning only single value.2 points
-
ProcessWire Dashboard Download You can find the latest release on Github. Documentation Check out the documentation to get started. This is where you'll find information about included panel types and configuration options. Custom Panels The goal was to make it simple to create custom panels. The easiest way to do that is to use the panel type template and have it render a file in your templates folder. This might be enough for 80% of all use cases. For anything more complex (FormBuilder submissions? Comments? Live chat?), you can add new panel types by creating modules that extend the DashboardPanel base class. Check out the documentation on custom panels or take a look at the HelloWorld panel to get started. I'm happy to merge any user-created modules into the main repo if they might be useful to more than a few people. Roadmap Panel types Google Analytics Draft At a glance / Page counter 404s Layout options Render multiple tabs per panel Chart panel load chart data from JS file (currently passed as PHP array)1 point
-
Hello all, sharing my new module FieldtypeImageReference. It provides a configurable input field for choosing any type of image from selectable sources. Sources can be: a predefined folder in site/templates/ and/or a page (and optionally its children) and/or the page being edited and/or any page on the site CAUTION: this module is under development and not quite yet in a production-ready state. So please test it carefully. UPDATE: the new version v2.0.0 introduces a breaking change due to renaming the module. If you have an older version already installed, you need to uninstall it and install the latest master version. Module and full description can be found on github https://github.com/gebeer/FieldtypeImageReference Install from URL: https://github.com/gebeer/FieldtypeImageReference/archive/master.zip Read on for features and use cases. Features Images can be loaded from a folder inside site/templates/ or site/assets Images in that folder can be uploaded and deleted from within the inputfield Images can be loaded from other pages defined in the field settings Images can be organized into categories. Child pages of the main 'image source page' serve as categories mages can be loaded from any page on the site From the API side, images can be manipulated like native ProcessWire images (resizing, cropping etc.), even the images from a folder Image thumbnails are loaded into inputfield by ajax on demand Source images on other pages can be edited from within this field. Markup of SVG images can be rendered inline with `echo $image->svgcontent` Image names are fully searchable through the API $pages->find('fieldname.filename=xyz.png'); $pages->find('fieldname.filename%=xy.png'); Accidental image deletion is prevented. When you want to delete an image from one of the pages that hold your site-wide images, the module searches all pages that use that image. If any page contains a reference to the image you are trying to delete, deletion will be prevented. You will get an error message with links to help you edit those pages and remove references there before you can finally delete the image. This field type can be used with marcrura's Settings Factory module to store images on settings pages, which was not possible with other image field types When to use ? If you want to let editors choose an image from a set of images that is being used site-wide. Ideal for images that are being re-used across the site (e.g. icons, but not limited to that). Other than the native ProcessWire images field, the images here are not stored per page. Only references to images that live on other pages or inside a folder are stored. This has several advantages: one central place to organize images when images change, you only have to update them in one place. All references will be updated, too. (Provided the name of the image that has changed stays the same) Installation and setup instructions can be found on github. Here's how the input field looks like in the page editor: If you like to give it a try, I'm happy to hear your comments or suggestions for improvement. Install from URL: https://github.com/gebeer/FieldtypeImageReference/archive/master.zip Eventually this will go in the module directory, too. But it needs some more testing before I submit it. So I'd really appreciate your assistance. Thanks to all who contributed their feedback and suggestions which made this module what it is now.1 point
-
Yeah, makes me wonder if it would have been better if the Pages::trashed method was called immediately before saving the trashed page rather than after. Maybe Ryan has a good reason for doing it that way. I still think it's better to hook after Pages::trashed if you want to know for sure which pages are trashed because when hooking Pages::trash there are still instances where the trashing can fail. For example, there might be another Pages::trash hook in a module that deliberately prevents trashing of particular pages. If you hook Pages::trashed you can parse the parent page ID (and some other info) from the name of the page in the trash: $pages->addHookAfter('trashed', function(HookEvent $event) { $page = $event->arguments(0); $pages = $event->object; /* @var PagesTrash $trasher */ $trasher = $pages->trasher(); $name_info = $trasher->parseTrashPageName($page->name); if(!empty($name_info['parent_id'])) { $parent = $pages($name_info['parent_id']); // ... } });1 point
-
An alternative is to use $files->render($filename). See the documentation about where the file is allowed to be. $emailBody = $files->render('/path/to/emailbody.inc');1 point
-
Seems like the _() function encodes entities only on multi-language installs. I have a working fix for this, but it's not yet on GitHub. I'll throw it in with the next release ?1 point
-
You can hook Session::redirect and check the redirect URL and the current process. Not perfect, but as far as I can see the deletePage() method uses a redirect URL that is unique in ProcessPageEdit and is therefore identifiable as coming from that method. $wire->addHookBefore('Session::redirect', function(HookEvent $event) { $url = $event->arguments(0); if($this->process == 'ProcessPageEdit') { $admin_url = $event->wire('config')->urls->admin; if(strpos($url, $admin_url . 'page/?open=') === 0) { $event->arguments(0, '/your/custom/url/'); } } });1 point
-
You can add your own validation with a small hook in site/ready.php. wire()->addHookAfter("InputfieldDatetime::processInput", null, "validateFuture"); function validateFuture(HookEvent $event) { $field = $event->object; // Make sure to enter the correct name of your field here: if($field->name == "crondate") { // Compare field with current time plus 30s * 1000ms: if($field->value < time() + 30000) { $field->error("Date is not in the future!"); } } } Adapting the datetimepicker isn't easy if possible at all.1 point
-
Thank you very much for the reply. Yes, we tried all of these options. The problem seems to be fixed for now by turning off Tracy Debugger and our Hosting provider made some changes as well. Because of that I do not really know what actually fixed the problem, but I'm glad it is actually fixed.1 point
-
1 point
-
Images from cloud storage providers could be added via URL with this module. I agree that it would be awesome to have all these options available in the core image field. Maybe file a feature request? EDIT: But that would add too many setting options to the core field that most of the users won't need. The image field is extendable via hooks and class inheritance. So other modules can add that functionality to the core field on demand.1 point
-
I know this is an older post, but you should be able to do some of this now with this module:1 point
-
Hello all, sorry for getting off-topic, but I am curious: I have read about those new regulations but my understanding was, that this was just about a special case (a gambling website), so that nothing would change for normal websites. But now everybody seems to jump on the train just to be safe, even though it is not necessary. Could somebody please explain to me, why you have to add this new cookie banner to your website? Are you saving personal informations of users in cookies? Or could somebody please point me to a reliable source, that explains or states that you have to add this new cookie banner? I only have cookies from ProcessWire and Google Analytics (with anonymized IPs). I have never read a clear statement, that I have to add a cookie banner and never has somebody complaint that I don't have a banner. In my opinion, everybody adds those banners because they are not sure and jump on the bandwagon. But I am no lawyer, so maybe I am completely wrong. But those new banners are really worse. I saw some that covered the whole website before you could get to the content. Its like we are back in the 90s, where you have a start page for the homepage. ? Thank god there a browser extensions like I don't care about cookies. Regards, Andreas1 point
-
I fixed the issue (thanks for reporting it) so you could access the process module again, but I don't have idea at this moment where is or what's the error. Could you try to make others AWS backups with different website and post the result ? Meanwhile I will re-read the code to see if I can catch something.1 point
-
1 point
-
Hello, Just ideas, Have you tried to access the new deployed website in a incognito browser window, clearing cache and cookies ? If yes then did you compared the .htaccess on both host and the settings (webserver/php/cache settings) ?1 point
-
1 point
-
1: I don't know the answer to this, maybe the icon appears if you enable trash for non-superusers (see point 3) 2: Take a look at 3 3: Please take https://processwire.com/blog/posts/processwire-3.0.107-core-updates/#trash-for-all1 point
-
https://processwire.com/api/ref/page/get-unformatted/ $timestamp = $page->getUnformatted('event_start');1 point
-
New version v2.1.0 is available on github. New features: Images in folders can now be uploaded and deleted from within the input. I am pretty excited about this feature. It gives you an image field that holds images independent of a page where images can be edited (upload/delete) and outputs PageImage objects in the frontend that can be cropped and resized. EDIT: forgot to mention that the module install 2 permissions imagereference-folder-upload and imagereference-folder-delte. Any non-superuser role needs those. Short preview edit-folder-images.mp4 Also now you can have the folder under either site/templates/ or site/assets/. The module will find it in both locations. If you have folders with same name in both locations, it will pick the one in site/templates/ The module is almost ready to go. One major thing, I need to fix, though, is getting it to work inside RepeaterMatrix fields. It is working fine inside normal repeaters. But eventually I will get there. Feel free to grab a copy and do some tests. Your feedback is much appreciated.1 point
-
New version v2.0.2 is available from github. This version fixes the problems with getting thumbnails displayed via ajax. At least in my extensive testing everything was working. @LMD can you please give it a try now? While trying to fix the ajax issue, I was running in circles for hours on end. Tried various methods I found in the forum and @bernhard's hook. I always got it working as superuser but got very strange results when logged in as an editor user with page edit permissions. Until I discovered that the problems were due to my module not always loading for ajax requests. I added 'autoload' => 'template=admin' to my module info and suddenly all was working as expected. Still scratching my head why a module's init() method would get called when logged in as superuser but not when logged in as editor. Any ideas here? New in this version is the feature for uploading files to the predefined folder from within the inputfield. Here's a short preview of that feature. uploadtofolder.mp4 Now that this is working, I'm thinking about adding the ability to delete them from within the inputfield, too. As always, I shall be happy to receive your comments and issue reports ?1 point
-
Exactly the same thought came to my mind. Will implement this as an option.1 point