Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/03/2017 in all areas

  1. i could post an edited version, this one is very marketing oriented and names my company and other clients, and talks about some proprietary modules... Perhaps an idea is to setup a GitBook that could be collaboratively edited, like an open source book about Why Choose ProcessWire; on Gitbook, the books can be read, or downloaded as PDF, ePub etc.. When i use this document at meetings, i usually print/bind it and go through the points with the perspective clients..
    8 points
  2. @codelearner I'm not sure if PW is superior to Django. But some of the strong point of PW is ... that we have that PW2.1 installation running since 6 years without any updates. We don't have to, since there's no security update needed or anything else. But updating it to PW3.x is a matter of 5 minutes, and it still works without doing anything. Except switching the RTE editor, not because it's an issue but CKeditor is now the default RTE. From the PW side mostly there's like 0h maintenance over the years. Developing and supporting projects with PW can be a fun task. ... there's a hierarchical structure that naturally represents a website structure that can be squeezed and squashed and moved around without much efforts, build self containing structures and wrap it up with some code. ... build modules in no time for whatever task. It's consistent with using the API you already familiar with. PW admin itself is built using its API. It's easy to manipulate and extend. ... occasionally you'll hear a "I just love PW" from yourself or your coworker. Usually when the deadline is tight and you have make last minute changes that would be impossible in other Systems. How do you come to this conclusion? Have you already developed something 3 months in PW and then built it in Django?
    5 points
  3. troll feeding on Yes, we are fanboys because PW is a system that can be loved. We enjoy what it has to offer and since you are here I guess Django is not like that. troll feeding off
    4 points
  4. I can try and send it privately/PM, it probably wouldn't be good to post on the forum..
    4 points
  5. I created a 10 page white paper that we provide to prospective clients, which does compare PW to the big three, as well as commenting on topics like SEO, Speed, Security and Ease of use. Sort of a 'ProcessWire to the Rescue' story. Been very helpful during any proposal stage. Now i can also send them to your article..
    4 points
  6. zero lines of code in PW - the admin is built in. Plus what you call an admin site in Django is a piece of garbage, i've used them and it is piss poor compared to PW admin.
    4 points
  7. I think comparing PW to Django is like comparing PW to Laravel. They are different beasts with different use cases. All of them are Awesome (Althought I prefer Flask, Yarrrg for pirates!) Maybe comparing PW to https://wagtail.io/ or https://www.django-cms.org/en/ could be more fair since they are CMS just like PW is. I think the bottom line of chosing a toolbox is down to simple questions: 1- I like using it? 2- What use cases can I fulfill? 3- Makes my team and clients happy to work with? So just use what is best for the requirements, restrictions and overal context of the project at hand. Not all projects can be done with Laravel, Django or PW. Maybe you can mix both and have the best of them :).
    3 points
  8. hey, I wanted to show you my latest redesign that i did a few months ago for fun, hope you like it.
    3 points
  9. Its a good question, this night I tested the three different providers (Dropbox, Google and Amazon) and I read about Dropbox they dropped support for the v1 since September 2017. I was aware of that but I didn't knew the exact timeline. So I removed Dropbox from the module in the version 1.0.2 but I found a small wrapper for the v2 coded by a guy on Github - already forked - I will test it if it can help to get back the Dropbox support on Duplicator. I also checked the migration guide, it should not be difficult to port the code to the v2. I just lack a bit time. There is two things I wanted to implement asap (thanks @horst!), now there is three things A small note: GoogleDrive and Amazon still work like a charm. Also I could tested yesterday a deployment on a Google Cloud VM instance (its a pain to setup, as always with Google) with the minimum resources, success!
    3 points
  10. Damn! I've been away from writing in the forum for so long, and now I'm being pulled in by another stupid discussion... @codelearner If you like Django so much, I can't honestly think of a reason why you're not at their forum instead... can you explain? Are you here because you're seriously interested in PW? Than open your mind, people at this forum have a lot of knowledge to share and they will do it in the most friendly way you've experienced on the internet. If you just want to pick a fight please go somewhere else, Reddit would be a great place to start.
    3 points
  11. In this forum you will not find too many fanboys (ie. members) who are interested in comments like this. I do not know what "bigboys" mean but you should familiarize yourself with the philosophy behind the ProcessWire project: https://processwire.com/blog/posts/new-2.8-version-current-projects-and-pw-usage/ Quote from Ryan: "I'll be honest, I've never cared much about our usage numbers, as I'd be doing the same thing with ProcessWire even if there were just the two of us, you and me. I do this work because I love it, and I don't care about being popular. Popularity is a burden as far as I'm concerned. Our focus has always been to be the best CMS according to our standards rather than anyone else's. But it's also encouragaging to look at things outside every once in awhile and see that ProcessWire is becoming more and more recognized in this market." ProcessWire forum members are open-minded. You came here to insult them.
    2 points
  12. Are you using any javascript in your process module?
    1 point
  13. I modified the AdminThemeUikit for custom colours etc. I copied the module to '/site/modules/' and just used that instead of the '/wire/' one. However, I was thinking it seems pointless using a second copy of a module that may need updating, so I used the 'Primary CSS file' setting in the core to simply link to my customized CSS: However, this the kicks up a bunch of errors in the UI: The new CSS file is being used, but the locations don't exist. Changing the paths would mean modifying these two files before compiling: pw-jquery-ui-custom.less pw-jquery-ui.less ...which is contradictory to the instructions for creating an admin theme. You should only need to modify one Less file to change the entire theme. From 'pw-theme-reno.less': /************************************************************** * Primary variables * * The entire color theme can be adjusted from the @reno * variables below. * */ I guess I could override all the parts that include images in my custom Less file to point at the original images in the wire folder. What I really wanted with this was to enable a total theme change with one CSS file. This would make theming super awesome, just grab a CSS file, point to it in the AdminThemeUikit settings and done. As it stands, you'd have to recreate the path '/custom/pw/images/', then copy the theme images into that in order to only use the CSS setting in core AdminThemeUikit module. An alternative could be for the Less in the module to have a variable pointing to images location (rather than the current hardcoded background: url() ones), then you could just change it in the single Less theme file: @pathToUiIcons: "/path/to/images"; Would make it simple to point straight to the images in the AdminThemeUikit folder. Maybe I'm missing the point of the 'Primary CSS' setting but I can't see how this is useful unless there is also a way to change the path to the UI Icons.
    1 point
  14. Did you google? The web seems to be full of similar questions, e.g. https://serverfault.com/questions/677181/open-litespeed-permission-problems
    1 point
  15. Sounds like something to do with namespaces, but the other members would have a better idea than me for sure. Sorry I can't be of much help! Maybe this (arjens' reply):
    1 point
  16. Ok so I read through this, client side seems a pretty good idea. What isn't so good is that it does require width and height settings whereas I used to just set the max height. I don't care about the width so much (no panoramic photos going on here). I'm uploading stock images so the sizes do vary. I'm not 100% sure how this works tbh. As it stands, I set the max-height to 1200 and use server side resize. I just uploaded an image of dimensions 1920x1280 and the resulting image on the server is 1800x1200. So I guess I could just set the max-width to some large value like 4000 (width will always be within this boundary) so the height will always end up as 1200.
    1 point
  17. I need my head to be examined! I was looking at the wrong setting. What we've always had is the limitFields setting. That limits selectable columns. We also currently have disallowColumns, for columns that should not be selectable/displayed. For the columns to display by default we need to set the properties columns and defaultColumns. These two have been missing from VPS. I have added these to the latest version (5) that I am working on. The former is done programmatically. The latter is what you'll see as a setting in a VPS field. I hope to release this tomorrow to a limited number of users for beta testing. @Macrura, I will also add a setting to allow/disallow other users from seeing the columns filter when using the Lister. This means that they will only be able to work with the columns you've set if you wish. I think this was part of your request, no? I can't recall if this is the normal behaviour in Lister Pro. If it is not, please let me know. Bookmarks are not the only way, as per my explanation above. defaultColumns will sort this out. Sounds like a good idea. I'll have to study this first. It will certainly not make it into the current version of VPS (5). Something else I'll have to study, in this case since I've never used Bookmarks before . If you can get VPS5 by tomorrow, defaultColumns should be able to partly solve your issue I think.
    1 point
  18. The thing weird is that you even get a Permission Denied opening the log file... Which web hosting company is ? I don't think so, it's a matter of seconds: set to true - refresh - set to false.
    1 point
  19. @codelearner Listen my friend, everyone is tired of trolls. If you don't have anything to say, just don't. Consider this an absolutely last warning.
    1 point
  20. Hi @Vigilante Take a look at this page to find out all available options how you can build your URL https://processwire.com/api/ref/page/url/ You can get current URL by $input->url and get current URL with query string by @input->url(true). Take a look at this https://processwire.com/api/ref/input/url/ and https://processwire.com/api/ref/input/query-string/
    1 point
  21. Hi @flydev - thanks for all the hard work on this. I am curious about the Dropbox API - are you planning on migrating to v2, or abandoning completely?
    1 point
  22. Would you mind to share your White Paper with us? Non-public or with a NDA (kind of)? It sounds interesting as a 10-pager should/might be very promising. I'd like to share my insights and arguments as well - if someone is interested.
    1 point
  23. What are you doing here then? Go use django, we wont stop you.
    1 point
  24. @MilenKo I'd go with Less if you're using uikit as you can make your own theme. Maybe you can do this with the Sass version but I didn't bother trying as there doesn't seem much point being stuck knowing just one or the other. You can get comfortable enough with both then you're free to choose whatever framework you want, or write some stuff yourself from scratch, whatever suits you best. Once it's set up, it's not that difficult, and they give you a build script too so you're literally up and running in about 5mins. Then you just override variables, hook existing stuff (like cards, accordians etc...) and add your own custom rules. All compiles to a nice minified CSS file which you can then link to from your webpage. I'm starting a new guide about Uikit on my tutorials site as I've found the uikit instructions to be lacking in detail and an absolute beginner to css pre-processing would have a tough time with it. The guide will serve as a base for when I get round to writing about customizing the PW admin theme, which will be easy once someone has read the first guide.
    1 point
  25. You came to some pretty solid conclusions in less than a week
    1 point
  26. I pushed a small update this night : Fixed changed all _() call to __() for translation string the installer parse correctly the config.php file on windows machine small typo in ProcessDuplicator Added check if ProcessDuplicator module is installed, if yes, then display the link in the local folder overview to the manager I tested Duplicator on a Windows machine with PHP-5.6 and PHP-7.0, I could build a package and cloned the site without issue too.
    1 point
  27. @erikvanberkum I just tested on 3.0.60 (I didn't have easy access to 3.0.62 using the PW Version switcher ) and I can actually reproduce the issue you are having. Turns out it's a bug in the PW core in that version. Look at the difference between: 3.0.60 if($languages) $languages->setLanguage($language); 3.0.84 if($languageID) $languages->setLanguage($language); I would recommend upgrading to 3.0.84 to fix the problem! PS - in my experience, 3.0.84 is more stable than the current "stable" version.
    1 point
  28. @kongondo First: thank you for your response and sorry for my delayed reply. I had some other projects crashing my work on that one. With your help I was able to render the menu also on localized sites. The code now looks like this: <?php $options = array( 'menu_css_class' => 'menu-lvl-1', 'submenu_css_class' => 'menu-lvl-2', 'current_class' => 'active', 'has_children_class' => 'has_children', 'current_class_level' => 3, 'include_children' => 1 ); ?> <?php echo $menu->render($pages->get("id=1930"), $options); ?> But: The menu does not show the localized page titles, those are still German. Am I missing anything else? Edit: I solved it, I just realised that I was missing the following option to translate the titles. 'default_title' => 1
    1 point
  29. Thanks for sharing this! Btw., you could save a few characters where you check if the language in the loop is the default language by simply calling $language->isDefault(), and perhaps also eliminate doubled code. // Lines 85...89 $dataname = $language->isDefault() ? 'data' : 'data' . $language->id; if(!is_string($languageValue)) $sleepValue[$dataname] = number_format($languageValue, $precision, '.', '');
    1 point
  30. I forked this module and made it PW3 compatible. See the readme and the commit for details of what was changed. https://github.com/Toutouwai/ProcessBatcher If folks want to test it and report back I can make a pull request for @Wanze. @tpr, I hid the AdminOnSteroids datatables filterbox and the title case-change button because the layout was a bit messed up. Maybe you could take a look at that when you have time?
    1 point
  31. After this tutorial you'll have learned how to: Build a Process module Make an AJAX request to backend Serve JSON as response Let's say you want to display the latest orders in a dashboard that you can access from admin panel. And you want it to refresh its content with a button click. Most straightforward and proper way (that I know of) is to create a Process module, as they're built for this purpose. First, create a directory under /site/modules/, call it ProcessDashboard, and create a file named ProcessDashboard.module under that directory. Following is about the least amount of code you need to create a Process module. <?php namespace ProcessWire; class ProcessDashboard extends Process { public static function getModuleInfo() { return [ 'title' => 'Orders Dashboard', 'summary' => 'Shows latest orders', 'version' => '0.0.1', 'author' => 'abdus', 'autoload' => true, // to automatically create process page 'page' => [ 'name' => 'order-dashboard', 'title' => 'Orders', 'template' => 'admin' ] ]; } public function ___execute() { return 'hello'; } } Once you refresh module cache from Modules > Refresh, you'll see your module. Install it. It will create an admin page under admin (/processwire/) and will show up as a new item in top menu, and when you click on it, it will show the markup we've built in execute() function. All right, now let's make it do something useful. Let's add create a data list to display latest orders. We'll change execute() function to render a data table. public function ___execute() { /* @var $table MarkupAdminDataTable */ $table = $this->modules->MarkupAdminDataTable; $table->setID($this->className . 'Table'); // "#ProcessDashboardTable" $table->headerRow([ 'Product', 'Date', 'Total' ]); // fill the table foreach ($this->getLatest(10) as $order) { $table->row([ $order['title'], $order['date'], $order['total'] ]); } // to refresh items $refreshButton = $this->modules->InputfieldSubmit; $refreshButton->name = 'refresh'; $refreshButton->id = $this->className . 'Refresh'; // "#ProcessDashboardRefresh" $refreshButton->value = 'Refresh'; // label of the button return $table->render() . $refreshButton->render(); } where getLatest() function finds and returns the latest orders (with only title, date and total fields) protected function getLatest($limit = 5, $start = 0) { // find last $limit orders, starting from $start $orders = $this->pages->find("template=order, sort=-created, limit=$limit, start=$start"); // Only return what's necessary return $orders->explode(function ($order) { return [ 'title' => $order->title, 'date' => date('Y-m-d h:i:s', $order->created), 'total' => $order->total ]; }); } When you refresh the page, you should see a table like this Now we'll make that Refresh button work. When the button is clicked, it will make an AJAX request to ./latest endpoint, which will return a JSON of latest orders. We need some JS to make AJAX request and render new values. Create a JS file ./assets/dashboard.js inside the module directory. window.addEventListener('DOMContentLoaded', function () { let refresh = document.querySelector('#ProcessDashboardRefresh'); let table = document.querySelector('#ProcessDashboardTable'); refresh.addEventListener('click', function (e) { // https://developer.mozilla.org/en/docs/Web/API/Event/preventDefault e.preventDefault(); // Send a GET request to ./latest // http://api.jquery.com/jquery.getjson/ $.getJSON('./latest', { limit: 10 }, function (data) { // check if data is how we want it // if (data.length) {} etc // it's good to go, update the table updateTable(data); }); }); function renderRow(row) { return `<tr> <td>${row.title}</td> <td>${row.date}</td> <td>${row.total}</td> </tr>`; } function updateTable(rows) { table.tBodies[0].innerHTML = rows.map(renderRow).join(''); } }); And we'll add this to list of JS that runs on backend inside init() function public function init() { $scriptUrl = $this->urls->$this . 'assets/dashboard.js'; $this->config->scripts->add($scriptUrl); } Requests to ./latest will be handled by ___executeLatest() function inside the module, just creating the function is enough, PW will do the routing. Here you should notice how we're getting query parameters that are sent with the request. // handles ./latest endpoint public function ___executeLatest() { // get limit from request, if not provided, default to 10 $limit = $this->sanitizer->int($this->input->get->limit) ?? 10; return json_encode($this->getRandom($limit)); } Here getRandom() returns random orders to make it look like there's new orders coming in. protected function getRandom($limit = 5) { $orders = $this->pages->find("template=order, sort=random, limit=$limit"); return $orders->explode(function ($order) { return [ 'title' => $order->title, 'date' => date('Y-m-d h:i:s', $order->created), 'total' => $order->total ]; }); } And we're done. When refresh button is clicked, the table is refreshed with new data. Here it is in action: 2017-04-29_19-01-40.mp4 (227KB MP4, 0m4sec) Here's the source code: https://gist.github.com/abdusco/2bb649cd2fc181734a132b0e660f64a2 [Enhancement] Converting page titles to edit links If we checkout the source of MarkupAdminDataTable module, we can see we actually have several options on how columns are built. /** * Add a row to the table * * @param array $a Array of columns that will each be a `<td>`, where each element may be one of the following: * - `string`: converts to `<td>string</td>` * - `array('label' => 'url')`: converts to `<td><a href='url'>label</a></td>` * - `array('label', 'class')`: converts to `<td class='class'>label</td>` * @param array $options Optionally specify any one of the following: * - separator (bool): specify true to show a stronger visual separator above the column * - class (string): specify one or more class names to apply to the `<tr>` * - attrs (array): array of attr => value for attributes to add to the `<tr>` * @return $this * */ public function row(array $a, array $options = array()) {} This means, we can convert a column to link or add CSS classes to it. // (ProcessDashboard.module, inside ___execute() method) // fill the table foreach ($this->getLatest(10) as $order) { $table->row([ $order['title'] => $order['editUrl'], // associative -> becomes link $order['date'], // simple -> becomes text [$order['total'], 'some-class'] // array -> class is added ]); } Now, we need to get page edit urls. By changing getLatest() and getRandom() methods to return edit links in addition to previous fields protected function getLatest($limit = 5, $start = 0) { // find last $limit orders, starting from $offset $orders = $this->pages->find("template=order, sort=-created, limit=$limit, start=$start"); return $orders->explode(function ($order) { return [ 'title' => $order->title, 'date' => date('Y-m-d h:i:s', $order->created), 'total' => $order->total, 'editUrl' => $order->editUrl ]; }); } protected function getRandom($limit = 5) { $orders = $this->pages->find("template=order, sort=random, limit=$limit"); return $orders->explode(function ($order) { return [ 'title' => $order->title, 'date' => date('Y-m-d h:i:s', $order->created), 'total' => $order->total, 'editUrl' => $order->editUrl ]; }); } and tweaking JS file to render first column as links function renderRow(row) { return `<tr> <td><a href="${row.editUrl}">${row.title}</a></td> <td>${row.date}</td> <td>${row.total}</td> </tr>`; } we get a much more practical dashboard.
    1 point
  32. This worked like charm for me with Debian 7 + Nginx 1.2.1 + PW2.3 setup. Only change I did is instead of 'fastcgi_pass unix:/var/run/example.com_fpm.sock;' I am using 'fastcgi_pass 127.0.0.1:9000;' Any advantages of using one over other ? Thank you for posting complete config file @u-nikos
    1 point
×
×
  • Create New...