Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/06/2018 in all areas

  1. 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.
    4 points
  2. 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.
    4 points
  3. Thanks @BrendonKoz it's updated now.
    2 points
  4. 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.
    2 points
  5. 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
    2 points
  6. 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)
    2 points
  7. I've added a section about how to grab the latest updates of processwire when you already have the setup shown in this tutorial.
    1 point
  8. 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.
    1 point
  9. 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
    1 point
  10. @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/
    1 point
  11. 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.
    1 point
  12. I think $event->arguments is a method not an Array/WireArray. EDIT: Also I think you might just want to set your hook before save not after and or you might get into a recursive loop with setAndSave, and just reassign the $page as an argument. $page->pad_discount = $discount; $event->arguments(0, $page);
    1 point
  13. 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 ...
    1 point
  14. 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.
    1 point
  15. 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.
    1 point
  16. You can add get params to every url: example.com/apagename/?param=value To work with it in processwire template files, we have the $input variable instead of the global $_GET variable. There is also $sanitizer. I'm on mobile, so please look out in the docs for the $input variable. (poviding links via mobile is a pain ?)
    1 point
  17. 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; }
    1 point
  18. @kongondo Thanks for the link. I checked it up and it is interesting approach, however it seems like the post author was trying to render two sources on the same page and paginate the results where in my case I am just trying to show the results of two queries but pagination is needed only for the one.Will try to test the solution provided there, but it is not yet clear for me how that approach would fit in my scenario. Edit: I found a simple way to fix the issue, and it was right under my nose in the pagination markup explanation. To make the queries work where I do not want the PageRendering to happen, I just added start=0 into the find query: $favorite_books = $pages->find("template=books-inner, sort=-random, start=0, limit=3"); Thanks again for pointing me to the initial link which gave me an idea how to phrase my search and bring me to the right spot. As far as I wanted to pull N-random requests, it works perfect. One more step closer to the end
    1 point
  19. Since I recognized a remarkable overflow of my trash bin I made a small module which auto delete pages sustainably from the trash after a period which can be set in module settings. PW modules: http://modules.processwire.com/modules/cronjob-empty-trash/ Github: https://github.com/kixe/CronjobEmptyTrash
    1 point
  20. You just get the textformatter module and use the formatValue(). It accepts Page, Field, String but you can also pass an empty page and field as most textformatters also don't use it except HannaCode I think. $str = $page->textfield; $modules->TextformatterModuleName->formatValue(new Page(), new Field(), $str); echo $str; This is deprecated, but should work for most textformatters still $str = $page->textfield; $modules->TextformatterModuleName->format($str); echo $str;
    1 point
×
×
  • Create New...