Jump to content


Popular Content

Showing content with the highest reputation on 01/05/2018 in all areas

  1. 15 points
    Hi y'all! Long time no see. Here's a little module aiming to help you build accessible websites ProcessWire Accessibility Tools Download: http://modules.processwire.com/modules/pwat/ Github: https://github.com/marcus-herrmann/PWAT A small, but hopefully growing toolkit for creating accessible ProcessWire sites. Right now it consists of the following little helpers: tota11y visualization toolkit by Khan Academy A toggle button to see view site in grayscale. The w3c recommends checking your page without colours to see if your design still works (accompanied by a colours contrast check, which is part of tota11y) A link to test your webpage with WAVE, webaim's Web Accessibility eValuation Tool. By the nature of this tool, the website under test must be available online, local hosts won't work. Installation Once you have downloaded PWAT, go to your module Install page and click "Check for new modules". Find "ProcessWire Accessibility Tools" and click "Install". During installation, PWAT creates a new role 'pwat_user'. To use the Accessibility Tools, you have to grant user this role. Following, you can start configuring the module. Usage PWAT starts with only the tota11y script activated. On the configuration page you can decide whether PWAT is visible on admin pages if tota11y is active if the grayscale toggle is active if the link to WAVE will be visible Credits The amazing tota11y visualization tool by Khan Academy Inspiration: Paul J. Adam's bookmarklets Inspiration: WordPress wa11y Plugin Best, marcus
  2. 8 points
    I mentioned last week that we'd look at the roadmap this week. I'm actually still working on that, so will post the 2018 roadmap next week instead. But I do have a version update this week which adds some useful tools to our images field in the admin (InputfieldImage), and I think this is one that both you and your clients will find really handy. https://processwire.com/blog/posts/pw-3.0.88/
  3. 7 points
    To get you started, I give you an example of an ajax request triggered by a noUiSlider's event which update the markup. Do not hesitate to ask if you don't understand something. Javascript code : // slider element var slider = document.getElementById('noUiSlider'); // create the slider object noUiSlider.create(slider, { start: [0, 100], step: 1, // avoid float values range: { 'min': 0, 'max': 100 } }); // change the value when noUiSlider values are updated slider.noUiSlider.on('update', function( values, handle ) { if ( handle ) { $("#noUiSlider-data").data("max", values[handle]); } else { $("#noUiSlider-data").data("min", values[handle]); } }); // on event 'set' send ajax request slider.noUiSlider.on('set', function( values, handle ) { // get the min and max from the data attribute of #noUiSlider-data $data = {min: $("#noUiSlider-data").data("min"), max: $("#noUiSlider-data").data("max")}; // ajax request $.ajax({ url: $(this).data('url'), // url from the data attribute of #noUiSlider type: "post", data: $data }).done(function (response, textStatus, jqXHR) { $('#list').html(response); // write markup to #list element }) }); PHP code : <?php namespace ProcessWire; $list = ''; $limit = 100; if(isset($input->post->min) && isset($input->post->max)) { $min = $input->post->min; // don't forget to sanitize $max = $input->post->max; // don't forget to sanitize $li = ''; $products = $pages->find("template=product, start=$min, limit=$max"); // let assume there is a template 'product' foreach ($products as $product) { $li .= "<li>". $product->title . "</li>"; } $list = "<ol>$li</ol>"; echo $list; } ?> HTML Markup : <div id="noUiSlider" data-url="<?= $page->url; ?>"></div> <span id="noUiSlider-data"></span> <div id="list"> <?= $list ?> </div> #noUiSlider is the slider element #noUiSlider-data will contain values changed from the #uiSlider element #list is the element updated by the ajax response enjoy
  4. 5 points
    If you haven't heard about it yet you should read about these new vulnerabilities that affect almost any computer built since 1995 https://en.wikipedia.org/wiki/Meltdown_(security_vulnerability) https://en.wikipedia.org/wiki/Spectre_(security_vulnerability) https://insights.ubuntu.com/2018/01/04/ubuntu-updates-for-the-meltdown-spectre-vulnerabilities/
  5. 5 points
    Love the image actions feature, thanks! Especially looking forward to this one... ...as I had a need for this recently. I don't intend to give users access to the "special effect" options (B&W and sepia) for the same reason I wouldn't give users the ability to change fonts or text colours - there's always some editor who considers themselves an "artist" and will take a carefully designed site and turn it into a dogs breakfast. In case anyone else feels the same, it's simple to remove these with a hook in /site/ready.php: $wire->addHookAfter('InputfieldImage::getFileActions', function(HookEvent $event) { $actions = $event->return; unset($actions['bw']); unset($actions['sep']); $event->return = $actions; });
  6. 5 points
    Just thought I would share this cool new chrome/firefox addon for https://insight.io that I discovered. It allows you to quickly search or view the folder/file hierarchy of a repository inside of github. It also allows you to list the methods of a class It's very similar to https://chrome.google.com/webstore/detail/octotree/bkhaagjahfmjljalopjnoealnfndnagc, but provides more features. On the github repo page it shows a insight.io button where you can view the current file on github that you are looking at on insight.io for more features like where specific functions are referenced. Note: I'm not affiliated with that company. I just thought it was helpful.
  7. 5 points
    Are the duties "free-form"? Or do you have a structured set of duties? If the latter, I would pagefields. I would do it without repeater matrix. parent page Members + child pages with tpl member Somewhere a parent page with child pages to store each duty. Then just use two text fields (firstname + lastname - gives you more possibilities for sorting), plus pagefields (select or checkboxes) for duties. You can control access rights on field-level.
  8. 5 points
    if($flip) { echo "H" } You are exactly right, I think you just miss a thought: The condition relates to the value of $flip. The value is either 0 or 1. And in PHP, 1 in a condition is β€œlike” true, and 0 is β€œlike” false. So $flip may be 1. In that case PHP will coerce it to true and finally print H because the condition is met. If $flip is 0, PHP will coerce that to false and print T because the condition for the if() was not met. So the else block is executed. Hope that helps?
  9. 3 points
    Not sure if this can help, but this is how i handle csv inport/export with pw: https://gist.github.com/lokomotivan/331aff00152b7cf2ac9b6605576e1e23
  10. 3 points
    If you add a renderReady() method to your inputfield module and load the dependencies there then they should be available for all inputfield usages including repeaters. Check out the Inputfield class, and the AsmSelect inputfield as an example.
  11. 2 points
    @kongondo, @gmclelland, I think @dragan is referring to pasting the URL in the OS dialog you get after clicking "Choose file":
  12. 2 points
    Don't know if you heard about it: There's a great CKEditor plugin called Accessibility Checker: https://ckeditor.com/ckeditor-4/accessibility-checker/ I have started to include it in every new PW installation and tell clients about it. Perhaps there's a way to include this as well?
  13. 2 points
    I'm not seeing it here, but since you are, I'm guessing it&apos;s probably language translation related. I just updated it to use entities1() rather than entities(), which accommodates cases where we don&apos;t know for sure if it&apos;s already entity encoded or not. This action is what you choose if you want to convert to Black &amp; White, aka greyscale.
  14. 2 points
    If you're trying to install ProcessWire on a Synology NAS using the WebStation service, please refer to notes below. I've created this mainly for web searches. I'm going to assume that you're at the installation screen and the first issue you'll have is trying to connect to a database. There's 2 things here you need to note MariaDB is running on Port 3307. You're probably used to running on port 3306 and this might even be what the installation screen pre-populates The Host field must be set to localhost:3307 and not just localhost
  15. 2 points
    This might be useful to you: https://processwire.com/blog/posts/processwire-core-updates-2.5.14/#multiple-templates-or-parents-for-users
  16. 2 points
    Something like this? (Exended FieldtypeFile)
  17. 2 points
    I didn't understood everything but you can take a look at this thread : and this module if it help :
  18. 2 points
    I think one way possibly to encourage more unified documentation would be to allow user comments on official documentation like PHP documentation or MSDN. Currently it appears that there's no way to comment on official documentation, and that encourages fragmentation, as you either have to post in the forums or on another site. I understand moderation might be an issue, as questions belong in the forums, not in the official documentation, but user contributed examples and tips would make sense as comments with the official documentation. Comments allowing links could also refer to relevant threads in the forums or external articles to avoid having to reinvent what's already available. The official modules directory already allows comments, so presumably it wouldn't be too hard to add something similar to documentation?
  19. 1 point
    A quick tutorial how to create file downloads using pages You will be able to create a new page using template "PDF" (or any you setup), upload a pdf file. You then can select this page using page fields, or links in Wysiwyg. The url will be to the page and NOT the file itself. This will allow to keep a readable permanent unique url (as you define it), unlike /site/assets/files/1239/download-1.pdf, and you'll be able to update/replace the uploaded file without worring about its filename. Further more the file will also have an id, the one of the page where it lives. Clicking those links will download or open the file (when target="_blank") like it would be a real file on server with a path like /downloads/project/yourfile.pdf. You'll be also able to use the "view" action directly in the page list tree to view the file. Further more you'll be able to esaily track downloads simply by adding a counter integer field to the template and increase it every time the page is viewed. Since the file is basicly a page. This all works very well and requires only minimal setup, no modules and best of it it works in the same way for multi-language fields: Just create the language alternative fields like "pdf, pdf_de, pdf_es" and it will work without modifying any code! Still with me? ok PW setup Download folder: Create a template "folder" or "download-folder" with only a title needed. Create pages in the root like /downloads/project/ using this template. Setup the template for the pdf files 1. Create a new template in PW. Name it pdf 2. Goto template -> URLs tab and set the URL end with slash to no. (So we can have /path/myfile.pdf as the URL) 3. Create a new custom file field, name it pdf. Set its maximal count to 1 under -> Details tab. 4. Add the pdf field created to the pdf template. Easy. 5. Create a new "pdf" page using the pdf template under a download folder you created earlier. 6. Give it the title and in the name field add ".pdf" to the end (could also leave as is) Template PHP file for the pdf files 1. Create the template file pdf.php in your /site/templates folder 2. add the following code: <?php // pdf.php if($page->pdf){ wireSendFile($page->pdf->filename); } Done. To see the options you have with PW's wireSendFile() you can also overwrite defaults <?php // pdf.php if($page->pdf){ $options = array( // boolean: halt program execution after file send 'exit' => true, // boolean|null: whether file should force download (null=let content-type header decide) 'forceDownload' => false, // string: filename you want the download to show on the user's computer, or blank to use existing. 'downloadFilename' => '', ); wireSendFile($page->pdf->filename, $options); } Simple and powerful isn't it? Try it out. Some thoughts advanced Create as many file types as you like. It might also be possible to use one "filedownload" template that isn't restricted to one field type but evaluate it when being output using $page->file->ext, or save the file extension to the page name after uploading using a hook. One last thing. You can add other meta fields or preview images to the template and use those to create lists or detail pages. It's all open to goodness. Again all without "coding" and third-party modules. Further more you can use the excellent TemplateDecorator to add icons per template and have a nice pdf icon for those pages. This as a base one could also easily create a simple admin page for mass uploading files in a simple manner, and create the pages for the files automaticly. ImagesManager work in the same way. Cheers
  20. 1 point
    Yes, I think so. The method comment says... ...so it should be possible to get the field. E.g. public function renderReady(Inputfield $parent = null, $renderValueMode = false) { $field = $this->hasField; if($field) { //... } //... }
  21. 1 point
    https://www.youtube.com/watch?v=I5mRwzVvFGE but we should not forget this one either: https://www.techrepublic.com/article/is-the-intel-management-engine-a-backdoor/ "Is the Intel Management Engine a backdoor? Yes, of course it is. By its very definition (from Wikipedia): A backdoor is a method, often secret, of bypassing normal authentication in a product, computer system, cryptosystem or algorithm etc. Backdoors are often used for securing unauthorized remote access to a computer, or obtaining access to plaintext in cryptographic systems." By definition Meltdown and Spectre are also backdoors, intentionally designed ones, btw. We are talking about hardware intentionally implemented to bypass security checks by design. It was just not "advertised". @bernhard Please change the title. I get the joke but it is quite misleading...
  22. 1 point
    That would be a good model. If only people with a certain level of contribution could post comments, that would likely prevent new users coming along and posting questions on the documentation site. Stack Exchange uses reputation based management to restrict some activities and responses I think, and the model works well there.
  23. 1 point
    Sure! No client should be allowed to play with their own site. It's a serious tool, not a kindergarten toy Thanks for sharing!
  24. 1 point
    Reading privileged memory with a side-channel https://googleprojectzero.blogspot.fr/2018/01/reading-privileged-memory-with-side.html Meltdown and Spectre Bugs in modern computers leak passwords and sensitive data. https://meltdownattack.com/
  25. 1 point
    Yes, I can confirm PNG and GIFs are working now with 3.0.88
  26. 1 point
    Hi folks, before I'm going to submit a bug report, I would like to make sure it's not my setup. Since commit bac60dc340d66766e7b9c0ce811a2ae152585123 I can't crop any png image (not by api, backend is meant, see screenshot). Could someone with ProcessWire 3.0.86 or 3.0.87 try this and report back here? Many thanks in advance!
  27. 1 point
  28. 1 point
    Hey @szabesz That's interesting. I wonder if it's working for you in that manner because you're using the root dbuser and the IP etc. Who knows ! I too don't *really* need to try run PW on Synology. I have a few "proper" servers so it's more for my own fun and curiosity but that info is helpful. Good to know it works too as I ran into issues with my htaccess file and general permissions. Otherwise I love the Synology NAS. It's probably the best thing I've ever purchased for my office. Backups, streaming, file sharing etc etc. It's all there. Running a PW site from it would be the cherry on the cake.
  29. 1 point
    Then I'd use asmSelect (autoselect multiple), with option to create new items by hitting enter.
  30. 1 point
  31. 1 point
    In addition to what blynx said: if ($flip) means the same as if ($flip!=0)
  32. 1 point
    @kuba2, Moderator Note I have moved your topic to Dev Talk since it has nothing to do with ProcessWire per se.
  33. 1 point
    We have already discussed it, this idea got some "likes" too: https://processwire.com/talk/topic/11998-growing-processwire-in-2016/?do=findComment&comment=111499 If it is possible to check this forum's data then it would be possible to give edit rights to only certain forum members based on that, for example.
  34. 1 point
    @adrian you are right. Now it works. I have cluttered up some of the syntax between html and php. In any case, the foreach loop had to go up, as I had suspected. I'm really excited about Processwire. After using Contao for a few years I am overwhelmed by the flexibility of this system. I will continuing with studying ... Many thanks for your help, guys
  35. 1 point
  36. 1 point
    Although it has worked for some, personally, I wouldn't bother with hooking into file uploads or storing original names in the file description or #4. I would either go for 'one-page-per-file' approach or create a custom Fieldtype that extends FieldtypeFile. 1. Page approach Besides the advantages you've alluded to, other advantages are: You file 'gets a unique ID'. Normally, files/images do not have IDs. For a critical system like yours, you might find an ID useful, e.g. to easily locate files Extensible: Using a page, you can add fields to it if such a requirement arises in the future. Easy to edit files Edit a file in one place, have the changes applied everywhere you are using it Etc... Now, this does look familiar... . Media Manager uses the same approach. It is just a bit more refined. The pages containing media are hidden, are auto-created and users do no interact with them directly. Shameless plug; if all else fails; consider buying MM . I know one developer who used it to manage PDF files for an organisation. 2. Custom field The task at hand is a good opportunity for a custom Fieldtype. Create a module that extends Fieldtypefile. Copy the code in Fieldtypefile, adjusting the schema to accept an additional text column/field (for the database) where you can save your original file name. We can help you with this 3. Profields Table?
  37. 1 point
    Template has to allow pagination not url segments, that two different things.
  38. 1 point
    Visual Page Selector version 005 (released (04/01/2018) Happy to announce that the latest release of Visual Page Selector is now available for Download/Purchase. Documentation has mostly been updated but the screenshots are not all up to date. This is a major update. As of today and this version onward, ONLY ProcessWire 3.x is supported. Changelog Support for namespaced ProcessWire only (ProcessWire 3.x). New UI. Thumbs view resemble normal ProcessWire 3.x image field. Thumbs now displayed in their natural proportions based on the ProcessWire-generated 260px high thumbs. Improved fields selection in the VPS field settings (image fields selection, etc). Display custom columns in Thumbs view (i.e. other fields in the page in the VPS pagefield). New Lister settings (e.g. disable columns, default columns). Improved support for Page Table and Repeaters. Lots of stylistic bug fixes. Notes pocketgrid.css dependency has been removed. Please delete the file if upgrading from VPS versions < 5 The UI has had a major update. We are now using icons only for all actions. In the modal, you first need to select items in order for add/remove icons to appear. If upgrading and using Thumbs view, 260px high thumbs may have to be generated once. May cause an initial slow down. Credits Many thanks to all beta testers - @Macrura, @szabesz and @Robin S. Special thanks to @Robin S for his critical review and ideas to improve the module. InputfieldImage JS/CSS/HTML code used in the VPS thumbs UI. Potential Bugs/Issues In some environments, if using Modal Lister and showing an image column in the Lister, if the image field has the setting Vertical List in image grid mode, the images in the field may fail to display in the Lister. Please use either a Square or Proportional grid images setting. There are a few stylistic issues when using the module in a repeater and using the (original) default admin theme. Screenshots 1. Thumbs View Grid: Page Edit 2. Thumbs View Table: Page Edit 3. Thumbs View Table: Modal 4. Thumbs View Grid: Thumb hover 5. Thumbs View Grid: Thumb selection 6. Field settings: Image settings
  39. 1 point
    I can confirm this, tested with PHP 7.1/7.2, PW 3.0.87/86 on Opera and FireFox, both uikit and default themes.
  40. 1 point
    Take a look at these: https://modules.processwire.com/modules/indexer/ and https://modules.processwire.com/modules/elastic-search/ If these don't do everything you need, and you want to build something different, I would recommend looking at elastica (https://github.com/ruflin/Elastica) and then googling elastic search word/excel/pdf. You might also find some useful code here: https://github.com/pydio/pydio-core/blob/develop/core/src/plugins/index.elasticsearch/src/ElasticSearchIndexer.php https://github.com/pydio/pydio-core/blob/51dd7015831f7d9506fc426d7e81c1ab36e71922/core/src/plugins/index.lucene/Zend/Search/Lucene/Document/Docx.php#L24
  41. 1 point
    With 3.0.86 in Firefox Quantum (Windows 10) I see all kinds of weird stuff: First time after saving a new PNG (upload pic, save page), then click on "crop", I get weird dimensions: someting like 1200 x 33px instead of 1200x1800px. Second try: Image shows in correct width/height proportions, crop seems to work alright. I hit save, and "save as copy", but I get an exact same size copy as the original. No error messages either in JS console.* A third try on that "cropped, but not actually cropped" image gets more weird: the image is now shown as a 50x60px thumbnail, but the values in pixels show something else entirely. * I get heaps of CSS warnings though: e.g. cropper.min.css Editing / cropping JPGs works fine, btw.
  42. 1 point
    I am very glad that you have joined our ProcessWire community, however I'm wondering when are you going to author a post about your use of ProcessWire? You ask very good questions about PHP, other frameworks and other CMS platforms in comparison to ProcessWIre. Our community members have been extremely gracious in answering these questions. Don't get me wrong, these questions have merit, and as Off-topic conversations fit within what the forum is about. What I haven't seen is where you are asking for help building a ProcessWire site or having a problem with a ProcessWire module, inputfield, backup or anything website building related. That's just an observation that I have made over time in reviewing all of your postings so far. I look forward to your additional Off-Topic postings and please don't take this as a criticism. I enjoy the wealth of interaction on the ProcessWire forum regardless of the subject and have looked forward to reading everyone's comments for the last few years. Respectfully, Charles
  43. 1 point
    It turns out the culprit was that I misspelled the locale name in this translation file: /wire/modules/LanguageSupport/LanguageSupport.module Essentially, I had en_GB.UTF8 and es_ES.UTF8 instead of en_GB.UTF-8 and es_ES.UTF-8, that is , I forgot the hyphen. I know it's quite silly, but I'm posting this here just in case someone else runs into a similar issue.
  44. 1 point
    The new Monitor Audio website is a ground up build featuring a completely custom front end design and back end Processwire build. Modules in use include Multi Language, ProCache, Blog, FormBuilder, Instagram and ProFields. The site has a large product catalogue, dealer finder and is in multiple languages. However, one of the main objectives for the project was to deliver a platform that could be easily edited and expanded as needs grow. The client team were involved at every stage. As developers we went a long way to make sure everything was editable. Other features include: IP controlled contact form with multiple email destinations based on enquiry type Product registration form with multi-product registration from a select group of products Company timeline with year filter all based on the blog platform Dealer finder with three dealer types and in multiple countries Newsletter signup with multiple signup opportunities (sign up box and other forms) FAQ section File downloads for products from internally (CMS) uploaded files or external file links There are also several other expansions and features planned. As always we'd love to hear your feedback on the site https://www.monitoraudio.com/
  45. 1 point
    Just to close out this entry. I can confirm that ProcessWire will install and run successfully on a Synology NAS (DSM 6.1 - 15047 Update 1). This was achieved some time ago and we are now developing a visitor information system using this setup.
  46. 1 point
    Sorry Horst, it's just 3 functions to make working with the page status attribute more convenient. I'd say these are work in progress but here's what they look like now. Edit: Skip ahead... These fns were the wrong approach. //with default args will wait up to 4s for locked page to unlock. Returns false or the page. function claimPage($page, $tries=5, $ms=100){ if($page->hasStatus(Page::statusLocked)) $page = waitForPage($page, $tries, $ms); if(! $page) return false; $page->addStatus(Page::statusLocked); $page->save(); return $page; } //if page is locked, wait and recheck. Returns false or the page. function waitForPage($page, $tries=5, $ms=100){ $t = 500; while($page->hasStatus(Page::statusLocked) && $tries--){ $t += $ms; usleep($ms); $this->pages->uncache($page); //so we get current status } if (! $tries && $page->hasStatus(Page::statusLocked)){ $this->releasePage($page); //we're expiring the lock afer a decent wait... return false; //but honoring the lock } return $page; } //unlock and save function releasePage($page){ $page->removeStatus(Page::statusLocked); $page->save(); return $page; }
  47. 1 point
    What might really expose ProcessWire is a book on packtpub.com. These books really helped me to jump start website development about five years ago: http://www.amazon.com/SilverStripe-The-Complete-Guide-Development/dp/0470681837 https://www.packtpub.com/web-development/silverstripe-24-module-extension-themes-and-widgets-beginners-guide I especially liked the first one (The Complete Guide to CMS Development). Nowadays ProcessWire is a lot more beginner friendly then SilverStripe (for example) except that there isn't a well organized book/tutorial for beginners. Such a tutorial should not just scratch the basics, but give an example of how to develop a somewhat complex, database driven website. The above mentioned books did achieve that. (They are outdated and have never been updated, but still good examples.) And I agree that upgrading the cheatsheets with lots of examples is a good idea. I spent 7 years developing Flash/ActionScript games and websites, and I loved the docs Adobe created for ActionScript. It was packet with lots-and-lots of code snippets, most methods had one ore two (or even more) examples, one just had to copy+paste them and tweak them to their liking. Php.net's idea of utilizing the developers to add notes and code snippets is one way to do it, so besides adding "official" snippets, commenters should be able to add their own too. The new WordPress docs site does the same.
  48. 1 point
    Whoops, I just lost the reality 1. Wrap a fantastillion spaces around each statement 2. Use words like "MotherFuck", if you mean "MotherLove" 3. Keep the code on your server and embed it with an iframe 4. Do not ship/deploy the code, entirely 5. Pretend that it is gone 6. Take it easy, don't care about mine and yours
  49. 1 point
    Hey guys, it looks like we're getting nailed with traffic today. Looks like I need to upgrade the server. I'm going to try and setup a mirror at processwire.org and see what the hosting company can do about upgrading the VPS. But wanted to provide advance warning that the server may go down today as the load just keeps rising (up above 50 right now). Looks like today will be our highest traffic day ever. Just hoping I can keep the server going.
  50. 1 point
    yaaaaaaaaaaaaaay!!! PW will get the deserved attention now
  • Create New...