Popular Content

Showing content with the highest reputation since 12/04/2018 in all areas

  1. 4 points
    So If this topic exists, I think I need to mention a fully open source alternative. It is not as mature yet though. It is an app from the developers of ERPNext.
  2. 4 points
    For all the reasons people here love ProcessWire, thought I'd share a great accounting app with a similar feel / philosophy. It's called Manager https://www.manager.io and it is amazing. I used to use it years ago and am now moving back from Quickbooks, it almost makes me enjoy doing my books.
  3. 4 points
    The admin search is JqueryUI Autocomplete. http://api.jqueryui.com/autocomplete/ there are some Extension Points such as _renderMenu and _renderItem that are using some custom logic to return the required markup. (look at the AdminThemeUikit/scripts/main.js, as well as the _search-form.php. It does work well and looks nice, but can achieve the same basic look and functionality for a front end site with possibly less work using typeahead.js and with the Bloodhound using local storage, it could mean for faster lookups.
  4. 4 points
    Just for the records: There is a simpler solution now: $siblings = $page->siblings(false);
  5. 3 points
    https://www.spiria.com After several sites made with ProcessWire, Spiria decided it was time to get rid of its cumbersome Drupal site. To be honest, ProcessWire is still difficult to sell to customers, because this CMS/CMF is not as well known as the most popular ones. The migration to ProcessWire therefore served several purposes: Eliminate the frustrations experienced with Drupal (especially with image management and some structural problems). Allow integrators to learn the CMS during quiet periods, when they are not needed on other projects. Promote the CMS by adopting it. The challenges were many, but by no means insolvent, thanks to the great versatility of this programming framework. Indeed, if ProcessWire can be considered as a CMS in its own right, it also offers all the advantages of a CMF (Content Management Framework). Unlike other solutions, the programmer is not forced to follow the proposed model and can integrate his ways of doing things. The blog The site includes a very active blog where visuals abound. It was essential to cache the various dynamic components. For example, in all sections of the blog, there is a list of recent articles, a list of "short technical news", another list from the same author, a classification by category. In short, these lists evolve independently. ProcessWire's cache system, including its ability to classify by namespace, has significantly improved loading speed. Cache file management has been placed in a "saved" hook in the useful "ready.php" file. Data migration Importing the blog data was complex because at the time the site was designed in Drupal, programmers had not been used the easily translatable "entities", so each article resided in two different "nodes" (pages). We would have liked to use the core ProcessWire import module, but it does not yet take into account multilingual fields. However, we have used this code as a basis for building our own import module. This is one of ProcessWire's great qualities, as a CMF, it is easy to use existing code to design your own solutions. Reproduce the layout The current layout of the site has been reproduced exactly as it serves the company's needs very well. ProcessWire has simplified the work in many ways. Apart from the blog, which is very structured, the other sections of the site are more free, especially the case study section ("Our Work"). The use of page reference fields has particularly helped developers. As everything is a page in ProcessWire, you can create a pseudo relational database within the site itself. The administrator user becomes more aware of the data hierarchy and has better control over the data. Programming architecture The separation between controllers and Twig visualization files facilitates the management of the multiple components of the site. We haven't really explored the "regions" of ProcessWire, because we prefer not to mix these aspects of programming. This greatly facilitates the timely arrival of programmers in our department, used to an MVC structure, because they have a better understanding of what does what. The Search Once again, we were able to simplify what had been done in Drupal. There are two types of searches on the site, the blog search and the more general search on page 404 ( https://www.spiria.com/potato). The Drupal site search was driven by an Apache Solr server in Drupal. We decided to rely on the ease of ProcessWire and the Typeahead library (for the blog), because we didn't need the power of Solr (or Elasticsearch) anyway. Work to improve performance still needs to be done in this area. We would have liked to have seen the excellent search tool offered on the administrative side available on the frontend. We have not yet had time to explore the possibility of harnessing this code from the core of ProcessWire. Our wish here is that the CMS designer, Ryan Cramer, sees this as an opportunity to offer an exciting new feature to his CMS! Powerful modules We have the excellent modules ProCache (static caching), ProFields (fields that greatly improve the functionality of existing fields) and ListerPro (data search and processing tool). As the site is installed on a nginx server, we have ruled out ProCache for the moment and we are satisfied with the use of the cache() function alone. The ProFields fields are a blessing just like ListerPro. This last module is very useful to correct, for example, import errors (we had more than 800 blog articles, some of which date back to 2013). We used a functional field to gather translations of terms that would normally have remained hard coded and difficult to access in the translation interface (an aspect to be improved in ProcessWire, in our opinion). By grouping translations in a single page, site administrators can easily change or correct terms. Language management What remains a very small irritant for us is the management of languages, which is fantastic in many ways. The fact that there is a default language is both a blessing and a problem. For example, in 2013, blog articles were not systematically translated. We experienced the same situation with a customer's site. If the article is only in English, no problem, we only have to not check French as an active language. However, if the article is only in French, we are still required to create the page in English and make tricks in the code, thanks in particular to a checkbox such as "Not present in English" to reproduce the behaviour naturally present for English (or any language deemed by default). Perhaps there is a more elegant solution here that we have not yet discovered. It's not much, but some clients don't see why there are two ways to do it here. In conclusion In any case, ProcessWire's great qualities continue to appeal to programmers, integrators, graphic designers, users and even our UI/UX expert. The solidity of the CMS/CMF, its functionalities all translated into objects/variables ($pages, $page, $config, $sanitizer, $input... the list is long) allows us to systematize our workflow, easily recover code and reduce production costs. Although it is dangerous to offer only a CMS solution to our customers (hammer syndrome that only sees nails), it is tempting to consider ProcessWire as the Swiss Army knife par excellence of Web programming. As mentioned above, the CMF is suitable for all situations, has very good security tools and its designer has successfully improved PHP methods to make programming very pleasant and intuitive. For us, migrating the company's website to this platform was the best tribute we could pay to its designer, @ryan.
  6. 2 points
    I'm really in love with FormBuilder, but the one thing missing to match all my end users' expectations were repeatable field groups. Think repeaters, in ProcessWire terms. Our primary application of PW is our corporate intranet, so "lines" of fields are quite common in the forms I build. We have all kinds of request forms where the information for a varying number of colleagues needs to be entered (from meal order to flight booking request) and where it is simply impractical to send a form for each, and I don't want to clutter my forms with multiple instances of fields that may only get used ten percent of the time. That's why I started to build FormBuilderMultiplier (link to GitHub). What it does: Adds an option to make a regular Fieldgroup repeatable Lets you limit the number of instances of a Fieldgroup on the form Adds an "Add row" button the form that adds another instance of the Fieldgroup's fields Adds a counter suffix at the end of every affected field's label Stores the entered values just like regular fields Makes the entered values available in preview and email notifications Supports most text based fields, textareas and selects (really, I haven't had enough time to test all the available choices yet) What it doesn't do (yet): Support saving to ProcessWire pages (i.e. real Repeaters) I haven't tested all the validation stuff, Date/Time inputs etc. yet, but since I'm utterly swamped with other stuff at work, I didn't want to wait until I have it polished. Any feedback is welcome. There might also be some issues with different output frameworks that I haven't encountered yet. The forms I work with mostly use UIKit. Status: Still alpha, so test well before using it in the field. Known issues: When rows are added, the form's iframe needs to be resized, which isn't completely clean yet. How it works: The Fieldgroup settings are added through regular hooks, as is the logic that adds the necessary field copies for processing the form and displaying previews. "Multiplied" field instances are suffixed with _NUM, where NUM is an incremental integer starting from 1. So if you have add two fields named "surname" and "givenname" to a fieldgroup and check the "multiply" checkbox, the form will initially have "surname_1" and "givenname_1" field (I'm still considering changing that to make the risk to shoot oneself into the foot by having a regular "surname_1" field somewhere else in the form less likely). When a "row" is added, the first row is cloned through JS and the counter in the fields' IDs, names and "for" attributes as well as the counter in the label are incremented before appending the copies to the Fieldset container in the form. To keep backend and frontend in sync, a hidden field named [name of the fieldset]__multiplier_rows is added to the form. Both the backend and the frontend script use this to store and retrieve the number of "rows". ToDo: Naturally, add the option to store the data in real repeaters when saving to pages. Do a lot of testing (and likely fixing). Make a few things (like the "Add row" button label etc.) configurable in field(set) context. Add a smooth API to retrieve the multiplied values as WireArrays. The mandatory moving screenshot:
  7. 2 points
    The ProcessWire modules directory link for Fieldtype Leaflet Map Marker is pointing to the master branch's ZIP archive which is the 2.8.1 version. I'm assuming that needs to be updated to point to the proper Github location.
  8. 2 points
    I've tried some experiments with Processwire on Heroku (with multiple Dynos). It worked - I used For Sessions: Heroku Redis + https://modules.processwire.com/modules/session-handler-redis/ + https://elements.heroku.com/addons/heroku-redis For Uploads: Amazon S3 + https://modules.processwire.com/modules/amazon-s3-cloudfront/ For the DB: https://devcenter.heroku.com/articles/jawsdb-maria
  9. 2 points
    There are three things to consider for load balancing: You need a central database, central file management (if people do upload things) and central session management (as the default also uses the filesystem). Each can be solved in various ways and depends mostly on your project's constraints. Database Probably as simple as running the db on it's own external server. File Management - Cloud storage (S3 or equivalent; minio for self hosted S3) - rsync (this is at best eventually consistent as you need to wait for the sync) - mount network share (I've not tried this and read a lot of bad things, but it might work) Session Management - Use the central db for session (SessionHandlerDB; might be slow) - Use a central redis server (can be done directly in php)
  10. 2 points
    Thomas, I recently found your module, good job. Right now im thinkering with Electron and making Processwire to serve as a headless CMS. So your module is quite handy. I forked the module on GitHub and made it a little bit more connected to Processwire. To sum things up, I creates a "Endpoint Container" in the page tree where you can add your routes and methods. It still needs to add responding classes to provide content ;) I added a skeleton Class called "Blog" to get all contents under the "Home" Page or a specific Page via ID. I created a Pull Request, maybe you like my approach. https://github.com/Luis85/RestApi
  11. 2 points
    You should not overwrite this file. Instead, edit the config in site/config.php.
  12. 2 points
    You overide each pagereload the complete session vars. I think that the $gebruiker is not created and available on every page load, but only on a special template. You may use a conditional that secures you that a (new) gebruiker is sent and need to be transfered into the session: $gebruikerarray = json_decode($gebruiker); if(!empty($gebruikerarray->naam)) { // add new data to sessions vars ... } OR you look if $gebruiker is available or not, or if a post submitt was sent, or ...
  13. 2 points
    Just for the curious, your garbled text error was caused by using the wrong operator. A single pipe character (|) is the bitwise OR-operator in PHP. Bitwise operators perform comparisons on the bits of integer values. They aren't really useful for strings, as the results are pretty much random. From the PHP manual: What you were looking for is probably the logical OR operator (||). However, your original $key1 assignment still wouldn't work because of operator precedence in PHP: $key1 = $vars['key1'] || "Default1"; // executed as $key1 = ($vars['key'] || "Default1"); In this case the OR operation will be executed first, and the expression will always evaluate to true because non-empty strings are true-ish. Then the result of the expression is assigned to $key1. A cleaner way that works and will never throw errors: $var1 = !empty($vars['key']) ? $vars['key'] : 'Default1'; In PHP 7 you can use null coalescing: $var1 = $vars['key'] ?? 'Default1'; Keep in mind that this will only assign the default value if $vars['key'] is NULL, but not if it is (int) 0 or an empty string!
  14. 2 points
    it depends! // ADD PAGE // adding a page via API can be triggered by the guest user even if he has not the permission to add children under a specific parent (12464) if ($user->isGuest()) $pages->add('contribution', 12464); // works // VIEW PAGE or FIELD VALUE // if guest user has not the view permission it depends on outputformatting if ($user->isGuest()) var_dump($pages->get(12985)->title); // "I am the Page Title" if ($user->isGuest()) var_dump($pages->get(12985)->of(true)->title); // NULL // MODULES // Call of a Module via API. User has not the permission to use the module if ($user->isGuest()) $modules->get('MyModule')->execute(); // Fatal error: Exception: You do not have permission to execute this module (if debug mode is on/ 500 otherwise) if ($user->isGuest()) $modules->getModule('MyModule', array('noPermissionCheck' => true))->execute(); // works!
  15. 2 points
    From what I understand, you could create/publish pages regardless of roles/permissions. However, if you were to wrap the page creation in an if statement like : if($user->hasPermission('permission-name', $page)) { // user has this permission, for this $page } then that person with the permission could perform whatever action you created.
  16. 2 points
    Languages are Pages in PW (like almost everything else). A user viewing any page in multilanguage environment has a language property attached (see here). So you can do it like this: <?php if($user->language->name != 'default') { echo 'Hello, multilanguage world!'; } You can use $user->language->id if you want.
  17. 1 point
    Are you sure your hook gets triggered? Always proceed step by step. I usually start with a hook that only outputs "triggered" via tracy: bd("triggered!"); If you don't see the dump in the tracy bar, your hook does not fire and you have something else wrong (and that's the case here). Try this one and then update the inner code: $wire->addHookAfter('Pages::saveReady(template=product)', function($event) { $page = $event->arguments(0); // your logic here bd("hook fired!"); }); To update your field you don't need "setAndSave", just set your field's value like this: $page->yourfield = 'yourvalue'; That's it
  18. 1 point
    You can use a shorter form of the API to get the field values: // instead of $price = $fields->get('pad_price'); $rrp = $fields->get('pad_rrp'); // use $price = $page->pad_price; $rrp = $page->pad_rrp; you also want to use the hookEvent saveReady instead of save, because See http://processwire.com/api/hooks/#before_or_after for details.
  19. 1 point
    @kimkuekas There is also WireCache and Page Cache that you can turn off in templates settings. You can try to you CleanCacheAdmin module https://processwire.com/talk/topic/13042-clearcacheadmin/
  20. 1 point
    Damnnn... Or you name your module properly instead of having .php as extension. I could not find it among the modules, but I was confused with some other hooks that are not modules (like in ready.php) that just do their thing. Luckily, it works now.
  21. 1 point
    @horst This works perfectly in alle pages. many, many thx
  22. 1 point
    @lenoir - I think all those old themes should be removed from the modules directory - hopefully with the imminent site rebuild they will be. I think the problem with PW's admin theming approach is that new functionality doesn't make it into 3rd party themes. I have always said that we need a skinning approach, rather than (or perhaps in addition to) theming. That said, the approach that AdminThemeBoss takes is in effect a skin, rather than a separate theme and I think this is great and is perhaps a model for others to follow.
  23. 1 point
    i just use a function to output the code from realfavicongenerator function favicons($options = []) { $defaults = array( 'appleColor' => '#4d9db4', 'msColor' => '#da532c', 'themeColor' => '#ffffff', 'path' => null ); $options = array_merge($defaults, $options); $folder = 'site/templates/favicons/'; if($options['path']) $folder = $options['path']; $folderUrl = wire('config')->urls->root . $folder; $filePath = wire('config')->paths->root . $folder; if(!is_dir($filePath)) return; $out = <<<OUT <link rel="apple-touch-icon" sizes="180x180" href="{$folderUrl}apple-touch-icon.png"> <link rel="icon" type="image/png" href="{$folderUrl}favicon-32x32.png" sizes="32x32"> <link rel="icon" type="image/png" href="{$folderUrl}favicon-16x16.png" sizes="16x16"> <link rel="mask-icon" href="{$folderUrl}safari-pinned-tab.svg" color="{$options['appleColor']}"> <link rel="shortcut icon" href="{$folderUrl}favicon.ico"> <link rel="manifest" href="{$folderUrl}site.webmanifest"> <meta name="msapplication-config" content="{$folderUrl}browserconfig.xml"> <meta name="theme-color" content="{$options['themeColor']}"> OUT; return $out; }
  24. 1 point
    By default PHP's bundled GD 2 library is used. If you're using a recent ProcessWire 3 version, ImageMagick is also supported (if you can have it installed on your server of course). Perhaps you could have better results. https://processwire.com/blog/posts/processwire-3.0.10-expands-image-resize-options/ NB: in /wire/config.php you can also see some settings, copy them to /site/config.php and modify them...
  25. 1 point
    So, here we are. Sorry the actions are a little hectic in respect of the file size (though its still huge enough to get trouble with the forum upload). tried imgur now:
  • From Twitter

    • New post: The RC1 version for our next master release is here. We also look at a a new PageAction module added to L… twitter.com/i/web/status/1…
      December 8 12:27 am
    • New post: ProcessWire 3.0.120 on the dev branch, plus discussion of our work towards the next master version. In ad… twitter.com/i/web/status/1…
      November 30 9:15 pm
    • New post: This week we take a look at what's new in ProcessWire 3.0.119 and then we finish up by taking a look at a… twitter.com/i/web/status/1…
      November 16 9:04 pm