Leaderboard
Popular Content
Showing content with the highest reputation on 11/05/2018 in all areas
-
Minimal Fieldset Adds a config option to Fieldset/FieldsetGroup/FieldsetPage to render the fieldset without label or padding in Page Edit. When a neighbouring field in the same row is taller than the fieldset the extra height is distributed evenly among rows within the fieldset. Requires ProcessWire v3 and AdminThemeUikit. Why? This module allows you to create layouts in Page Edit that would not be possible without it. It's useful when you want a layout that has two or more fields as rows that are themselves within a row in Page Edit. It's also useful when you have some fields that you want to add to a template as a group (i.e. via FieldsetGroup or FieldsetPage) but having a heading and visible wrapper for the fieldset in Page Edit would be redundant. Example: Installation Install the Minimal Fieldset module. Usage In the field settings for any Fieldset/FieldsetGroup/FieldsetPage, tick the "Remove label and padding for this fieldset" checkbox. https://github.com/Toutouwai/MinimalFieldset https://modules.processwire.com/modules/minimal-fieldset/4 points
-
This has got to be the craziest website I have ever seen: http://zoomquilt2.com/ http://zoomquilt.org/ It's like infinite zooming. Contains some questionable content, may be NSFW.3 points
-
3 points
-
I have been using Mint for 2 years already on my home desktop and would certainly recommend it to anyone switching from Windows. It has a lot of proprietary drivers included and is based on Ubuntu, which makes looking for answers easy. P.S. I use Cinnamon edition.3 points
-
Thanks ? Yes we built multiple sites for them, all based on the same design with theme/color variations for individual sites. E.g. Osho UTA, UTA Akademie and Osho's Place. Those are built with Drupal though. Hi Bernhard, I agree that a module would be the more ProcessWire-friendly way, I mostly wrote it this way to save time. Since it is client work, we have to budget our development time; given that I haven't really started digging into module development yet, I didn't want the additional overhead. Since the site only has one template, I didn't need to duplicate any code, so I didn't think the benefits of building a module were worth the additional development time in this case. I thought about extending the Page class, but I went with composition over inheritance in this case to avoid unforseen side effects. Though it probably would've been cleaner to use inheritance. I'm not sure this class is general enough to be used in different sites at the moment, but if I have some free time at work or need it for another client site, I'll try to turn this into a configurable module!3 points
-
Just found nolt.io by coincidence and tried it out... It's really simple to setup a Roadmap with voting functionality: https://53261ae5.nolt.io/ What do you think? Could that be useful?2 points
-
Interesting blog post on the sharp looking site of Internet Dreams (via the latest issue of weekly.pw) https://www.netdreams.co.uk/blog/processwire-website-development/2 points
-
@PWaddict https://github.com/processwire/processwire/blob/dev/wire/modules/AdminTheme/AdminThemeUikit/AdminThemeUikit.module#L43 Change it to false.2 points
-
Hi all, I'm looking for a quick suggestion on Linux OS. My genuine Windows 7 OS has suddenly decided to be 'not genuine'!!! I've wasted time Googling and tried all sorts of things but it has refused to even attempt to reactivate. I now have the black screen and the 'key's icon popping up every time telling me to 'click here' to activate windows. The 'click here' takes me to a 404 page on MS site!!! I tried a couple more things and now it is telling me my product key is blocked! Joy! So, I call MS and after going through a few hoops, the contact centre is just taking me round in circles! I haven't even spoken to a human yet! I'm pretty certain a recent Windows Update caused this but I can't be bothered to find out which one. So, I think it is time to say bye to my beloved Windows ?. I think most of the tools I use have Linux versions or alternatives. I'm not sure about my PowerDirector though. I've been down this road before and I always come back to Windows. I'm just looking for a distro that looks like Windows 7, to be honest. If it can run Visual Studio Code without issues (that's the priority) I'll take it. Any suggestions? I'm tired of Googling and would really like to get back to 'normal' ASAP. Thanks. PS: I'm not interested in a mac ?1 point
-
Everybody can make music. ? https://audiotool.com is a powerful pretty unique in the browser sound production studio. I remember back then it was made with flash, nowadays it's a JS app with 600k lines of code. Pretty amazing if you never seen it try it out.1 point
-
Do you have a large number of inputs on this page? Inputs being images, repeater items, other fields. If so you might be exceeding PHP's max_input_vars setting. https://www.virendrachandak.com/techtalk/big-forms-and-php-max_input_vars/ If you do have a lot of inputs and cannot change max_input_vars then it may help if your repeater items are ajax-loaded as needed and not opened by default.1 point
-
1 point
-
I don't have a wireless printer nor a scanner so can't help with that. Maybe this will help with the wireless printing https://www.makeuseof.com/tag/setup-wireless-usb-printer-linux/1 point
-
Please look through this thread for a possible scanning solution https://dev.getsol.us/T49 Also valuable information Re: scanning on Solus1 point
-
@horst Thank you for that code. I was able to ensure that the language was being delivered properly. It turns out that the tech managing our in-house web server had very very aggressive caching enabled through Nginx and purging the entire site's cache fixed the issue. The issues that were coming up didn't look like a caching issue so it was odd. Had odd URL issues and redirect looping. General recommendation to everyone is check with your server admin when all hope is lost...1 point
-
There has been no change here, the WireArray::new() method remains as it was before. It was only the non-static implementation that was removed, which was present not for functional reasons, but purely so that it would show up in the auto-generated API docs to represent the static version. That non-static version was causing issues in PHP versions prior to 7.x. The static version does not cause issues because it's implemented via PHP's __callStatic() handler. While there are WireArray() and PageArray() functions that can be used the the same way as WireArray::new() and PageArray::new(), the ::new() versions are preferable because they will work with any WireArray derived type, and as a bonus, they can also accept variable argument lists.1 point
-
@kongondo Open the software center, search for and install cups. Then you should be able to open the cups admin in the browser at http://localhost:631/admin (you will need to login with your solus user) and there you can manage the printers.1 point
-
The blog module uses PW's core Comments field type. You can either use its render() method and pass in templates that generate the desired output, or iterate over the comments yourself and assemble the HTML. All of that is explained in FieldtypeComment's documentation.1 point
-
1 point
-
Great, then installing gutenprint package should be enough! http://gimp-print.sourceforge.net/p_Supported_Printers.php1 point
-
Can you reveal the model? I have wrestled with a couple of Canons. One was easy as just installing gutenprint package did the trick. Another printer-related annoyance in Manjaro is that the user is not in "sys" group by default and thus is prevented access to fiddling with the printer in the CUPS admin. This does the trick: usermod -a -G sys yourusername1 point
-
1 point
-
I use Arch Linux myself and have installed Manjaro for various family members & friends. KDE for desktop environment. Even though Arch/Manjaro is the bleeding edge, breakage is rare. Most problems are related to printers and that is just a fact of life no matter which operating system we use. I use Arch for a couple of servers as well.1 point
-
I recommend you Solus with the plasma (kde) desktop, it's still in beta (the plasma version), but I had no issues with it. You can download it here., or check the other desktops available. Here is a screenshot of the taskbar and start menu (start menu is a custom one, plasma comes with 3 by default) With some distros you have to add extra repositories for codecs and drivers, which is not always straight forward, Solus provides them in their main repos.1 point
-
You are absolutely right. My request would only be applicable for "Page URLs". For "Select Page" and similar fields where you select a page id it wouldn't be good. I will make a GitHub request. And thank you very much for the hooks! Working great! It would have taken me hours to figure this out.1 point
-
There are different inputfields in ProcessPageEditLink and they need to be treated differently: Link to URL, Select Page, Select Child Page. For Link to URL I agree that there is probably no common use case that needs pages without template files to be visible/selectable here. For Select Page and Select Child Page, I think that pages without template files should appear there because those pages may have viewable child pages, and also I think it is easier for users to understand these inputfields if they show the same pages that they are familiar with from ProcessPageList where non-viewable pages are listed. But the pages without template files should not be selectable as links. I suggest you raise a GitHub request or issue to ask for a change to this. In the meantime here are a couple of workaround hooks for /site/ready.php: // ProcessPageEditLink > Link to URL: exclude pages using templates without template file $wire->addHookBefore('InputfieldPageAutocomplete(name=link_page_url)::render', function(HookEvent $event) { $inputfield = $event->object; $fileless_templates = []; foreach($this->wire()->templates as $template) { if(!$template->filenameExists()) $fileless_templates[] = $template->id; } $inputfield->findPagesSelector .= ', template!=' . implode('|', $fileless_templates); }); // ProcessPageEditLink > Select Page / Select Child Page: prevent selection of pages using templates without template file $wire->addHookAfter('ProcessPageEditLink::execute', function(HookEvent $event) { $css = ''; foreach($this->wire()->templates as $template) { if(!$template->filenameExists()) $css .= ".PageListTemplate_{$template->name} .PageListActionSelect, "; } if($css) { $css = rtrim($css, ', '); $css .= ' { display:none !important; }'; $event->return .= "<style>$css</style>"; } });1 point
-
I need to send E-Mails with embedded images. Therefore the image urls need to be absolute httpUrls instead of relative ones like /site/assets/...; I didn't find one, so I created this: <?php namespace ProcessWire; /** * Converts relative CKEditor image urls to httpUrls * eg /site/assets/files/123/demo.png * to https://www.demo.com/site/assets/files/123/demo.png */ class TextformatterImagesHttpUrl extends Textformatter { public static function getModuleInfo() { return array( 'title' => 'Relative Image Urls to HttpUrls', 'version' => '1.0.0', 'summary' => "Converts relative CKEditor image urls to httpUrls.", ); } public function format(&$str) { $url = $this->wire->config->urls->files; $httpUrl = $this->wire->pages->get(1)->httpUrl; $httpUrl .= ltrim($url, "/"); $url = str_replace("/", "\/", $url); $str = preg_replace("/src=\"$url/m", "src=\"$httpUrl", $str); } }1 point
-
You can enable / disable it in the page editor on the settings tab. There is a checkbox for each additional language near the inputfield for the language page name: If you want to check / debug this in your template file(s) for some roles or users, you may add a code snippet like the following: $languageWarning = ''; if(($user->isSuperuser() || $user->hasRole('NAME_OF_YOUR_EDITOR_ROLE')) && '1' != $page->status1063) { // active checkbox is not ticked! // italien language is disabled !! $languageWarning = "<div style='text-align:center; margin:0; padding:0; min-height:30px; background-color:#EEFFEE; color:red;'> !! WARNING: Content for Italian Language is disabled !! <br /> Go to the settings tab in the editpage and check the box to activate it, if this is by mistake. </div>\n"; } // change the number from status1063 to that from your language id, or you may derive it programatically from the languages object In the page markup I output the content of $languageWarning, what only can have content for certain roles or users. Thus the output can stay in markup of production site templates with no harm.1 point
-
Thanks for sharing! Awesome site ? I wonder why you didn't create a module for that. There was a discussion about that recently: But in your case I think it would make sense to pack it into a module. You could then: update it with one click across several websites extend the $page object via hooks instead of creating a new class share it with the community via github&co and the modules directory This: <?php namespace Processwire; use schwarzdesign\PasswordProtectedPage; $protectedPage = new PasswordProtectedPage($page); $protectedPage->handleRequest(); if (!$protectedPage->userCanAccess()) { [...] Would then become that: <?php namespace Processwire; $page->handleRequest(); if(!$page->userCanAccess()) { [...] And it would be really easy to achieve in your (autoload) module: $this->wire->addHook("Page::handleRequest", function($event) { // your code here }); I think you could even get rid of the "handleRequest" call and do that automatically in the background.1 point
-
Done. Not sure, but I wonder if it's related to the PHP notices from Adminer & plugins I mentioned earlier in our PM conversation. Maybe with debug mode on the error reporting level changes and those notices are being output somewhere before session start.1 point
-
Wonderful write-up, and a very elegant and precise website. Thanks and congratulations! Very much OT, but I was interested to see that one of your clients is the Osho UTA Institute. I saw a fascinating Netflix doco recently about the history of the Osho (aka Bhagwan Shree Rajneesh) movement in the USA: https://en.wikipedia.org/wiki/Wild_Wild_Country1 point
-
I'd really suggest you to sort out why you need to have data in multiple places (especially edit them in multiple places). Keeping things in sync is a task, where so many things can go wrong, that it's often the better solution to keep things in one place. If you really need to sync stuff, one way sync (essentially caching) is the simple option, because you can just discard anything on the receiving end without worrying to overwrite any changes (especially useful if something did went wrong and you need to fix that). Two way sync is the hard part, especially as you need to handle things like potential downtime of both services, network issues, missed updates and so on.1 point
-
Hello Everyone. This is not Strictly just about Processwire, but its something i use with a Processwire website that i created. It´s just a simple little Anti-spam protection system i use to make it more difficult for simple bots to mess around with a contact form on the said website. it seems to be working pretty well. The system is very simple, let me explain. Step 1 In the template file for the contact form have this code: <?PHP /* create a random integer.*/ $sendFormInteger = mt_rand(1000,9999); /* save the integer to session var using PW API or just go PHP vanilla */ $session->set('antispam_code', $sendFormInteger); ?> As you can see we just create a 4 digit integer and save it to a session var using Processwire $session API. https://processwire.com/api/variables/session/ Step two Also in your form have for example a label that display the code we created above, so the poster has to manually fill it out in a form field. For example like this: <label for="antispam_code">Anti spam code: <strong><?PHP echo($session->get('antispam_code')); ?></strong></label> <input type="text" name="antispam_code" value="" class="" placeholder="Fill in antispam code here" /> We simply echo out the code we saved in the session var into the label so the user can read it and then fill it out into our form field below the label. Step Three In the file or template that receives the form data put in a simple check like bellow: <?PHP /* sanitize our data and make sure its a integer */ $antispam_code = $sanitizer->int($input->post->antispam_code); /* check if the code we saved in the session var is equal to the one filled in the form and sent to us */ if($session->get('antispam_code') == $antispam_code) { /* if antispam code correct then delete it and go on */ $session->remove('antispam_code'); } else { /* if code is NOT correct then do something else */ } ?> More info on $sanitizer API: https://processwire.com/api/variables/sanitizer/ Just thought i share this technique with you all. I have no doubt that you could easily come up with something more advanced then a 4 digit integer that i use. My anti-spam system is set up so that it creates a new code everytime the form template is loaded. So it should be hard to guess unless they make the bot read the HTML and find the code in the label and make the bot fill out the correct form field before sending it. Happy coding.1 point