Leaderboard


Popular Content

Showing most liked content since 01/20/2017 in all areas

  1. 28 likes
    Hi Everyone! I became very interested in this GraphQL thing lately and decided to learn a bit about it. And what is the better way of learning a new thing than making a ProcessWire module out of it! For those who are wondering what GraphQL is, in short, it is an alternative to REST. I couldn't find the thread but I remember that Ryan was not very happy with the REST and did not see much value in it. He offered his own AJAX API instead, but it doesn't seem to be supported much by him, and was never published to official modules directory. While ProcessWire's API is already amazing and allows you to quickly serve your content in any format with less than ten lines of code, I think it might be convenient to install a module and have JSON access to all of your content instantly. Especially this could be useful for developers that use ProcessWire as a framework instead of CMS. GraphQL is much more flexible than REST. In fact you can build queries in GraphQL with the same patterns you do with ProcessWire API. Ok, Ok. Enough talk. Here is what the module does after just installing it into skyscrapers profile. It supports filtering via ProcessWire Selectors. ProcessGraphQL supports complex fields like FieldtypeImage or FieldtypePage. The module is ready to be used, but there are lots of things could be added to it. Like supporting any type of fields via third party modules, authentication, permissions on field level, optimization and so on. I would love to continue to develop it further if I would only know that there is an interest in it. It would be great to hear some feedback from you. I did not open a thread in modules section of the forum because I wanted to be sure there is interest in it first. You can install and learn about it more from it's repository. It should work with PHP >=5.5 and ProcessWire 3.x.x. The support for 2.x.x version is not planned yet. Please open an issue if you find bugs or you want some features added in issue tracker. Or you can share your experience with the module here in this thread.
  2. 21 likes
    This week we’ve started developing a new admin theme for ProcessWire that aims to be a community collaboration. We’ve now got some good momentum with lots to share in this post. We also get into some technical details and have screenshots as well. https://processwire.com/blog/posts/working-towards-a-new-admin-theme/
  3. 18 likes
    Consistent with the plans of introducing new site profiles this year, we’ve started work on the new site profile, and have the first version ready this week. This profile contains a blog component and uses the new Uikit 3 front-end framework: https://processwire.com/blog/posts/introducing-a-new-processwire-site-profile/
  4. 18 likes
    Soundmanager2 Audio for Processwire Github: https://github.com/outflux3/TextformatterSoundmanager Modules Directory: http://modules.processwire.com/modules/textformatter-soundmanager/ This module provides most of the free audio player interfaces for Soundmanager2 by Scott Schiller: Bar UI 360 UI 360+ spectrum UI mp3 buttons mp3 links Page Player, muxtape-style UI Cassette Player The module is a Textformatter that works by allowing you to insert shortcodes which are parsed into audio players. The players may be placed anywhere in the content (ck editor or other text field) using the shortcode, for example: [smplayer tag=audio1] The output will be a default single player (as specificed in the module settings), or if multiple audio files have the same tag, and you don't specify a type (UI), it will default to the Bar UI for the playlist. You may also specify page-player for the type as it also supports playlists. Here is a more complex tag: [smplayer tag=audio1 type=bar-ui color=2288CC] the tags available on shortcodes are: tag - *required to find the audio file on the page type (the type of player) limit (limit the number of files to load when using a playlist) Player specific tags for Bar UI: bar-ui (options for the bar-ui player) skin (applies to a bar-ui skin to load) extra (when set to true, it will display the extra controls) color (hex value for color - applies to bar-ui and mp3 buttons) compact (makes the player very narrow) playlist-open (make the playlist drawer open instead of needing to click the playlist button to open it.) dark-text (instead of white) flat (remove the faux 3d effect) When using the shortcode, you can chain the tags using underscore, for exmaple: [smplayer type=bar-ui bar-ui=flat_playlist-open_dark_text] Player specific tags for Cassette: cassette (options for the cassette player) In case you are not familiar with SM2, it powers a lot of major audio on the web, like Soundcloud, LastFM, AllMusic etc). The players are all rock solid and work on a wide range of browsers and devices. Features Multiple Audio Formats SM2 supports many formats, and those can be enabled/disabled in the module config if you want to prevent any from being loaded. So far this module was tested with MP3 and AAC (.m4a). GetID3 Support When enabled, ID3 tags from every audio file that pass through the Textformatter are read and cached as arrays using WireCache. Therefore the first load of a page with new audio files may be slow while the tags are read and stored. The tags are indexed by the filename of the audio, so as long as you don't upload multiple files with the same filename, or change the tags, the system will store the metadata permanently. To remove any metadata, you would need to use Soma's Cache Admin module, or clear it from the database. Schema Support When enabled, some schema tags relating to audio files will be added to the markup. CK editor Plugin Very basic dropdown that inserts some pre-configured player codes into the editor. Copy the plugin into your CK editor plugins folder, enable and add a button for 'soundmanager'. Instructions Before you install: 1) You will need a files field that accepts audio files, so set the extensions you want to use, such as mp3, m4a, mp4, wav etc. 2) Also make sure that you enable tags on the files field because the module references the tags for any audio file in the shortcode. 3) Add the files field to your template. Installation and Setup 1) Install the module and adjust your settings from the module configuration screen. 2) Add the TextformatterSoundmanager textformatter to the field where you want to insert audio (e.g. 'body'). 3) Optionally install the CK editor plugin to enable quick access to preconfigured shortcodes. 4) Add a shortcode into the textarea field that has the textformatter applied to. 5) You must reference the tag you entered in the audio file's tag field in the shortcode, and that will create a player for that audio file. 5a) To create a playlist, put the same tag in multiple audio files. Output 1) In order for the module to output the necessary styles and scripts, you need to echo the $config->styles and $config->scripts arrays into your site's header/footer. Here is an example: // In Header foreach($config->styles as $style) echo "<link rel='stylesheet' type='text/css' href='{$style}' />\n"; // In Footer foreach($config->scripts as $script) echo "<script type='text/javascript' src='{$script}'></script>\n"; API Usage To access the module's player method directly, you would first init the module in your _init.php file: $sm2 = $modules->get('TextformatterSoundmanager'); then anywhere in your templates, you can output any audio file with any player, in an configuration like this: $options = [ 'type' => 'bar-ui', 'skin' => 'gradient-fat', //'tag' => 'audio1', // tag is not needed when using the API //'bar-ui' => 'playlist-open' //all of the classes to apply to the bar ui. ]; foreach($page->audio as $track) { $content .= $sm2->player($track, $options); } Advanced Features Using other pages for storing music as playlists. You can create a field to hold a tag for a **page* and then refer to that tag in your shortcode. The shortcode word would be smplaylist instead of smplayer. The module will search the site for pages with that tag in that field. Then it will output all of the audio files in that page's audio field using the player and settings you specify. See the module configuration to select the tag field and adjust your shortcode words. Caveats Some player will not work well on the same page as other players. Bar UI and Page Player 360 Player and 360 Visual (large) players Also note that the cassette player can only occur once on a page. You can have multiple cassettes output, but they will all play the same audio file. The file that the cassette player uses is set in the script tag. In the future the setup may be modified to allow for cassette players to have their own audio files. About Soundmanager2 http://www.schillmania.com/projects/soundmanager2/ Speak and be heard More sound, in more places Despite being one of the senses, sound has largely been missing from the web due to inconsistent technology support. SoundManager 2 bridges this gap, making it easier to use audio across a growing variety of devices and platforms, both desktop and mobile. HTML5 + flash hybrid Complexity, reduced Supporting HTML5 audio can be tedious in modern browsers, let alone legacy ones. With real-world visitors using browsers ranging from mobile Safari to IE 6 across a wide range of devices, there can be many support cases to consider. SoundManager 2 gives you a single, powerful API that supports both new and old, using HTML5 audio where supported and optional Flash-based fallback where needed. Ideally when using SoundManager 2, audio "just works." The ginsu knife: 12 KB Big features, small footprint Performance is an important metric, too. SoundManager 2 packs a comprehensive, feature-rich API into as little as 12 KB over the wire when optimized; that's less than 8% of the original, uncompressed file size. SM2 is self-contained, having no external dependencies, and is compatible with popular JavaScript frameworks. The source code is BSD-licensed and is provided in fully-commented, non-debug and compiler-optimized "minified" versions appropriate for development and production use.
  5. 18 likes
    This week's version of ProcessWire expands upon our markup regions support introduced last week, and also contains various minor fixes and tweaks. In addition, it adds a $urls API variable which is simply a shortcut to $config->urls. But since this is so commonly called upon, the shortcut can be useful in reducing verbosity in some template files. Meaning, if you want the URL to /site/templates/, you can now use the shorter $urls->templates rather than $config->urls->templates, if you'd like. This also adds consistency with our recently introduced urls() function that's part of the optional Functions API. https://processwire.com/blog/posts/processwire-3.0.50-core-updates/
  6. 17 likes
    Last week we looked at progress on a new admin theme framework for ProcessWire. This week we’ll do the same, as development continues to move forward and we have a lot more screenshots to share (though keep in mind this is largely un-themed/stock). https://processwire.com/blog/posts/continuing-work-on-new-admin-theme-framework/
  7. 16 likes
    I was not aware of this module/topic and spend some time developing a module to backup, clone and move sites to a local folder or even GoogleDrive and Dropbox. The idea begun when I read about this Wordpress's plugin. I was planning to add features like s/FTP, Amazon Cloud, deployment installer and others great features from Wordpress Duplicator and release it for free to the community. Now that I see this @rot's module , I am wondering if it would be benefit to the community to have a second solution and so, if I should finish it.. ? --- Features / Wishlist : Save package to local folder : implemented Save package to Amazon AWS : implemented Save package to Dropbox : implemented Save package to GoogleDrive : implemented Save package to FTP/FTPS : implemented Manual backup with a standalone button : implemented Backup from scheduled cron job : implemented Exclude by file extension / filename / directory : implemented File naming convention (Y-m-d_H-i-s-description.ext) : implemented Protect access to the module screen by role/user Installer / deployment functionality --- 2017-02-07: Starting the CLOSED BETA TESTING. screenshots:
  8. 16 likes
    Thank you @Werner Pilnei. I am excited because I like using ProcessWire . I try to do my best in introducing this module to the community. GraphQL is very young standard and is not mainstream yet. I intentionally started this thread in the Pub section, to make sure this is not a module support page but more a discussion on GraphQL (as this new api standard by facebook) and ProcessWire. To talk about how they could fit with each other, what ways we could use it, the new ways to use ProcessWire and so on. I personally never think about ProcessWire as a CMS. Though it is in fact a true CMS in its literal meaning, it is best at managing your content. But when people are introduced to ProcessWire it is presented as CMS and since the web is cursed by WordPress, people start using ProcessWire with wrong assumptions in their minds which result in negative impressions. I am generalizing here but when an average web developer hears CMS, she thinks it is a ready website with bunch of functionality baked in like tags, searching, blogging, commenting and so on. Those functionalities become the evaluation criteria and when they see that there is no tags in ProcessWire they count that as one of the things ProcessWire is missing. They don't understand that tags are something ProcessWire shouldn't have, because they are used to see tags in a CMS. I don't think that I am telling something new here. The community is well aware of this problem and the release of new site profile states that these problems are being addressed. But it doesn't have to be the only way. The modular architecture of ProcessWire allows us to extend it anyway we want, and this module is one of those attempts in presenting ProcessWire in different perspective. Even if it won't make much difference, I think we should keep trying and experimenting. Who knows what could come up along the way. I was only thinking about SPAs when creating this module. Never thought of PWA and usage with service workers like you approached it. Which is, by the way is great to hear. I hope there will be bunch of other ways people use it.
  9. 15 likes
    PageTableExtraActions A module for ProcessWire CMS/CMF. Allows PageTable items to be published/unpublished and hidden/unhidden directly from the inputfield. Usage Install the PageTableExtraActions module. Use the icons in the "Actions" column of a PageTable field to publish/unpublish or hide/unhide an item. https://github.com/Toutouwai/PageTableExtraActions/
  10. 15 likes
    This week we give extensive coverage on how to optimize 404 requests in ProcessWire. In this post you’ll learn about why 404s are significant issue, and then we’ll look at what you can do to optimize and ensure your site doesn’t waste valuable time and resources serving irrelevant crawlers and bots. This post also briefly covers this week’s core version 3.0.52. https://processwire.com/blog/posts/optimizing-404s-in-processwire/
  11. 14 likes
    I just updated the Captain Hook cheatseheet to latest version 3.x now there's a master and dev version. Thanks to @owzim for providing a cli script to parse the repos automaticly and generate a array to use. It helps a lot to update. https://somatonic.github.io/Captain-Hook/index.html
  12. 13 likes
    hi everybody, this is a preview of a module that i'm working on for quite a long time. I needed it for an intranet office management application that i'm still working on. It makes it very easy to create very customized Datatables using the awesome jquery datatables plugin (www.datatables.net) EARLY ALPHA release! It's very likely that there will lots of changes to this module that may cause breaking your implementations. Module source https://gitlab.com/baumrock/RockDataTables2/tree/master Screencast: Remarks: The module is intended to be used on the backend. Loading styles is at the moment only done via adding files to the $config->styles/scripts arrays. Also the communicaton to javascript is done via the $config->js() method that is built into the admin and would have to be implemented manually on frontend use. But it would not be difficult of course Installation: Nothing special here, just download + install Example setup of the most minimal Table: you always need 2 files to create a table: php file to define the columns and related data (page selector) js file to control the client-side actions like rendering, sorting, etc PHP // init datatables module $dt2 = $modules->get('RockDataTables2'); // setup columns // name $col = new dtCol(); $col->name = 'name'; $col->title = 'Name'; $col->data = function($page) { return $page->title; }; $dt2->cols->add($col); // setup table $dt2->id = 'dt_kundenliste'; // give your table an id $dt2->js('/site/modules/ProcessRockProjects/dt_kundenliste.js'); // tell it where to find the related javascript // ################################## // ajax request -> return data // non-ajax -> render table // ################################## if($config->ajax) { // here you can setup your page selector // this will for sure change in the future to support filtering etc echo $dt2->getJSON($pages->find('template=rockcontact, sort=random, limit=10000')); die(); } else return $dt2->render(); JS $(document).ready(function() { // setup variables var opt = ProcessWire.config.dt_kundenliste; // options from backend var colDefs = []; // column definitions // custom column definitions here (see https://datatables.net/reference/option/columnDefs for all options) // load default column definitions colDefs = colDefs.concat(dtGetDefaultDefs(opt)); // initialise table $('#dt_kundenliste').DataTable({ ajax: './kundenliste/', columnDefs: colDefs, }); }); that's it - as easy as that! Customization example: in the screencast you see an example that i'm using in a process module. i put the table inside an InputfieldMarkup just to have the same look&feel all around the admin. you see that you could also use this module to create tables quickly and easily using @kongondo s runtime markup module. complete PHP code: $this->headline('Kundenliste'); $form = $modules->get('InputfieldForm'); // init datatables module $dt2 = $modules->get('RockDataTables2'); // setup columns // name $col = new dtCol(); $col->name = 'name'; $col->title = 'Name'; $col->data = function($page) { return $page->title; }; $dt2->cols->add($col); // type $col = new dtCol(); $col->name = 'type'; $col->data = function($page) { return $page->rockcontact_type->title; }; $dt2->cols->add($col); // modified $col = new dtCol(); $col->name = 'modified'; $col->data = function($page) { $obj = new stdClass(); $obj->timestamp = $page->modified; $obj->display = date('d.m.Y', $page->modified); return $obj; }; $dt2->cols->add($col); // setup table $dt2->id = 'dt_kundenliste'; $dt2->js('/site/modules/ProcessRockProjects/dt_kundenliste.js'); $f = $modules->get('InputfieldMarkup'); $f->value = $dt2->render(); $form->add($f); // ################################## // ajax request -> return data // non-ajax -> render form + table // ################################## if($config->ajax) { echo $dt2->getJSON($pages->find('template=rockcontact, sort=random, limit=10000')); die(); } else $out .= $form->render(); return $out; what is interesting here is this part: // modified $col = new dtCol(); $col->name = 'modified'; $col->data = function($page) { $obj = new stdClass(); $obj->timestamp = $page->modified; $obj->display = date('d.m.Y', $page->modified); return $obj; }; $dt2->cols->add($col); datatables support orthogonal data (https://datatables.net/extensions/buttons/examples/html5/outputFormat-orthogonal.html). a date column is a good example, because you need to DISPLAY a formatted date (like 10.02.2017) but you need to be able to SORT this column by a different value (timestamp). its very easy to accomplish this by providing both values in your json. Btw: You could also just transfer the timestamp and do the formatting on the client-side via javascript. Next Example will show ho this would work. Both cases can be necessary, it's just an example here. back to topic: now we have both data available and need to tell the table wich data to use for which action. it's easy, just add the definition to the array: // modified date colDefs.push({ targets: opt.colnames.indexOf('modified'), render: { _: 'display', sort: 'timestamp', }, }); this tells the datatable to use the display-value for displaying (and filtering) and the timestamp-value for sorting. see https://datatables.net/reference/option/columns.render you can also easily modify a simple non-orthogonal data via a render function: // name colDefs.push({ targets: opt.colnames.indexOf('name'), render: function ( data, type, full, meta ) { return '<span class="blurry" title="'+data+'">'+data+'</span>'; }, }); this adds the span with "blurry" class to every cell of type "name". i did this to blur all the client data in my screencast the complete javascript: $(document).ready(function() { // setup variables var opt = ProcessWire.config.dt_kundenliste; // options from backend var colDefs = []; // column definitions // custom column definitions here // see https://datatables.net/reference/option/columnDefs for all options // name colDefs.push({ targets: opt.colnames.indexOf('name'), render: function ( data, type, full, meta ) { return '<span class="blurry" title="'+data+'">'+data+'</span>'; }, }); // typ colDefs.push({ targets: opt.colnames.indexOf('type'), render: function ( data, type, full, meta ) { return '<a href="#" style="white-space: nowrap;">'+data+'</a>'; }, }); // modified date colDefs.push({ targets: opt.colnames.indexOf('modified'), render: { _: 'display', sort: 'timestamp', }, }); // load default column definitions colDefs = colDefs.concat(dtGetDefaultDefs(opt)); // initialise table $('#dt_kundenliste').DataTable({ ajax: './kundenliste/', columnDefs: colDefs, scrollY: "400px", scrollCollapse: true, scrollX: "100%", pageLength: 10, }); }); you can also have scrollbars just by adding options to your datatable. also fixed columns are possible. just see the docs on datatables.net Why i created this module: of course i know @Soma s module but i needed a lot more features and the newer datatables version. also i like to define all the columns as objects and have everything on one place. lister & markupadmindatatable: nice for basic tables but lacks of features to modify the appearance of the cell values (like rendering icons, background colors and so on) datatables provides a great frontend API for filtering, showing/hiding columns, getting data, modifying it... it also plays well together with frontend charts like google chart api in this case: todo / roadmap: all kinds of column filters (like seen in the example above that shows an older and bloated version of this module) support for ajax filters and pagination (currently all filtering and sorting is done on the client side. i tried it with up to 50.000 rows and got reasonable results. initial loading took around 10sec. but of course this heavily depends on the complexity of your table and your data.
  13. 13 likes
    Exactly what I was going to write, but you were quicker. I think we should put an emphasis on accessibility when creating this new admin theme. Not just only color contrast but also regarding keyboard-only usage and usage with assistive technologies like screen readers. Creators of WordPress and Drupal already aim for ATAG (Authoring Tool Accessibility Guidelines) compliance, e.g. here and here and ProcessWire should do so as well Although I'm no professional in this topic I'd love to help with audits and Pull Requests.
  14. 11 likes
    I had a need to do this and there were some requests in the Table forum so... LimitTable A module for ProcessWire CMS/CMF. Allows limits and restrictions to be placed on selected Profields Table fields. For any Table field you can limit the number of rows that may be added and also prevent the use of drag-sorting and the trashing of rows. If a limit has been defined then there is an option to show all (empty) rows up to that limit. This module does not support paginated Table fields. Usage Install the LimitTable module. The module configuration screen should be self-explanatory. You can add rows in the module config as needed using the "Add another row" button. Please note that limits and restrictions are applied with CSS/JS so should not be considered tamper-proof. https://github.com/Toutouwai/LimitTable Module config: The effect of the above config in Page Edit. The empty rows up to the limit are shown because "Show all rows" is checked.
  15. 11 likes
    I have just updated my music production site. This shows how even with a very simple site, Processwire has a place. The site is, for the moment, just a single page. I could have just made a static site without much trouble, but by building it on Processwire, I will be able to expand the site in the future without having to rethink the current site. The design used the profield Repeater Matrix for everything except the footer. So, I can reorder the panels easily should I wish. Here be the site: Dancing Bear Music (All graphics by me)
  16. 10 likes
    Hello I made a simple app for reading the main RSS for ProcessWire news. Now you can access ProcessWire Blog, ProcessWire weekly and the Latest Forum Posts in a Single App in your iOS or Android smartphone. Open Source of Course. Made using the http://jasonette.com technology. You can compile your own app if you want. For A Quick Look 1.- Download the Jason App (iOS) https://itunes.apple.com/us/app/jason./id1095557868?mt=8 (Android) https://play.google.com/store/apps/details?id=com.jasonette.jason 2.- Use the Following Url https://raw.githubusercontent.com/NinjasCL/pw-app/master/app.json Source Here https://github.com/NinjasCL/pw-app
  17. 10 likes
    Website: https://gatorade.com.do/5v5/ Modules: Form Builder, Lister Pro, Profiler pro, Tracy debugger, Procache (still not installed) It's a simple landing designed to handle registrations to a Gatorade Tournament, but it's kind of cool to see a big brand like Gatorade running Processwire.
  18. 9 likes
    This module enables you to automatically create pages based on a ProcessWire page template, eg Calender detail page, that has calendar event recurrences. Download from GitHub: https://github.com/clipmagic/ProcessRecurringEvents
  19. 9 likes
    Hey guys, Here is our latest creation, a website for a landscape architecture studio in Freiburg, south of Germany. http://freisign.eu/ As you can see this is a very simple site. The most complex pages are the project pages since here we wanted to give the editors flexibility to construct the content at their will. Because we had a decent amount of different content blocks the obvious choice was to use the "Repeater Matrix" ProField. We also used the oldie "Page List Image Label" by Soma, which works pretty well for organising the admin of this kind of sites. For the slideshows we used the excellent Slick Carousel jQuery plugin. It still amazes me how flexible and easy to use it is The site is responsive, of course. As always, opinions and suggestions are welcome!
  20. 9 likes
    Hello, In this tutorial I show how to use the wirePopulateStringTags function in order to improve translatable strings. https://medium.com/@clsource/better-translatable-strings-in-processwire-621e9e6b18ee#.tv2u23j4i Basically it will improve how the strings are shown in the translation administration. echo wirePopulateStringTags( __('There are {count} {items} in the {place}'), ['items' => 'apples', 'count' => 32, 'place' => 'basket'] ); Will render There are 32 apples in the basket And the Translator will see There are {count} {items} in the {place}
  21. 9 likes
    Hi all! Major overhaul / refactor just committed. To quote Github: Showing 54 changed files with 1,705 additions and 1,295 deletions. Yes, I haven't slept much lately I have tried to test everything very thoroughly, but with so many changes, there might be new bugs introduced. Please let me know if you find any issues. You'll also noticed that I have bumped the version number to 4.0.0 and am using a string now so that I can start being more semantic with the version numbers. Here's a rough highlight of the changes. New skin - a huge thanks to @tpr for all his efforts on this, not to mention lots of other feedback / bug reports while developing this new version! Captain Hook Improvements - it now shows dynamically added hooks, like Page::viewable in both the core and your site module. Also some general cleanup. More SessionHandlerDB fixes - there were still some outstanding issues with some of the lesser used panels. Hopefully we're closer to this being a non-issue. Improved CSS loading - in particular when opening panels in a popup window. General code updates - various things, including updating wire() and $this calls to $this->wire() where appropriate. Lots of bug fixes - mostly issues with the lesser used panels that had gone unnoticed, but still it's amazing what you find when you do a major refactor. Better code documentation - not my strong point in the past - hopefully this is now on the way to being much better. File / folder restructuring - not really of concern to you guys, but will make life a little easier for me going forward with future enhancements. Captain Hook panel showing new dynamic hookable methods and @tpr's fantastic new skin!
  22. 9 likes
    As I have just finished implementing the FTP transfer protocol, I hope it will be available for beta testing this week-end . I have to implement Amazon before. I am going to buy an Amazon account tonight and implement this feature tomorrow.
  23. 8 likes
    Marc, it sounds like you've got a bottleneck somewhere. You mentioned a remote DB connection, and maybe there's something to to that. You also mentioned Windows (I'm in unix), and it's certainly possible there's something platform specific going on. Here are some things you can do to narrow in on where it might be. Edit your /index.php file and before the line that says this: $config = ProcessWire::buildConfig($rootPath); Add this: Debug::timer('pwboot'); Now edit your /site/templates/_init.php file (or whatever gets called first) and add this at the top, after the "namespace ProcessWire;" (old school and rough, but gets straight to the point): die('Boot time: ' . (Debug::timer('pwboot')*1000) . ' ms'); Now you can get a sense of how long it takes ProcessWire to boot, before it hands off the request to you. This should give you an indicator as to whether you need to look at the modules you've got installed, or whether you need to look at the API calls in your templates. Hit reload several times in your site (front-end) to get a sense of the average boot time. On my oldish Macbook Pro and PHP 7, running the site-default profile with no 3rd party modules installed, these are my average boot times: ProcessWire 3.0.52: 53 ms (opcache off) ProcessWire 2.7.3: 104 ms (opcache off) ProcessWire 3.0.52: 35 ms (opcache on) ProcessWire 2.7.3: 35 ms (opcache on) As you can see, without PHP caching the code, ProcessWire 3.x boots nearly twice as fast as ProcessWire 2.7 (at least in my environment). Interestingly, if PHP's cache is enabled, then the boot time is identical. But when Soma said above “ProcessWire is getting slower and slower each iteration”, this is a blanket statement that is the opposite of reality. ProcessWire is getting faster and more optimized with each version. What's real is that clearly something about the conditions present in his environment and your environment is reducing performance, and that needs to be narrowed in upon. So the next steps will be to determine if it's something about the server, something from a module, or something going on in the template file(s), like some specific API call that might be common among your installations. Now go to your Chrome dev tools, Network tab. Hit reload several times like you did before (same URL). Note the first request in your Network tab. Take this time and subtract the time you recorded above. This represents (roughly) the time required to load PHP before it gets to ProcessWire. With opcache off, my PHP takes about 100ms before it loads ProcessWire's /index.php file. If I enable opcache, then I'm seeing almost no overhead from PHP at all. Meaning, Chrome dev tools is showing 40ms or less. I'm guessing that your remote DB connection is going to mean your boot times are significantly higher than if it was local. So maybe you shouldn't be looking for the same boot times that I'm seeing here. But hopefully you can get a better idea of whether the times you are seeing are related to the boot process, or what happens after the boot process. If you are seeing it in the boot process, then uninstall all 3rd party modules and test again. Or go one-by-one until you can narrow in on which one it is. If still seeing a slow boot then we might need to start looking at potential Windows platform issues. If your boot times seem reasonable, then the next step is to start debugging in the template files. Let me know what you find and I can suggest the next steps.
  24. 8 likes
    Hello everyone, I've been fiddling around a lot lately with docker containers for my local development on a linux machine. Tried many different options, also readily available processwire images and tutorials from the forum. But never got it right. Mainly because of permission issues with docker volumes. That is a tricky part on linux machines whereas on OSX it doesn't seem to be an issue. Then I discovered http://www.wordpressdocker.com/. And the setup with nginx as a proxy that routes requests to separate containers with the actual site install appealed to me. The whole thing sits on top of alpine linux containers which are really lightweight. So I decided to give it a try. And, first time since experimenting with docker, I got a running PW install. Rewriting was not working until I adjusted the nginx config. Now I have a fairly complex PW site running in a container. Everything is working, image upload/editing etc. So I'm really exited, especially since the dev site is now blazing fast compared to my old vagrant virtualbox vm setup. Honestly, I don't really understand everything that is happening behind the scene. But I managed to adjust the original files and build a new image that works with PW and doesn't have all the WP stuff. The nginx config I took from https://github.com/elasticweb/nginx-configs/blob/master/configs/processwire-2.conf Not sure if it covers everything for PW3 as well. I would very much appreciate if someone who is more in the know than me could take a look. All files for building the docker image are here https://github.com/gebeer/alpine-php-processwire A working image here: https://hub.docker.com/r/gebeer/alpine-php-processwire/ Documentation is kind of lacking. I took over quite a lot from the original project. But following the github README and the original documentation should get people started who have a little experience with docker already. If someone needs a more in depth step by step tutorial for setting things up, let me know and I'll put something together.
  25. 8 likes
    @Oliver, @bcartier Thanks guys. Glad you like it. No, Language fields are not supported yet. There will be support for them too. Maybe I will implement them this weekend. In any case I will let you know when they are available. For those who are following this module, I make releases almost everyday. Sometimes I introduce new bugs but patch them as soon as I find them. There are bunch of features added since the first introduction. You can follow up the changes/additions in the changelog. Lots of parts are not documented yet but I will provide full documentation and possibly introduction video targeted to ProcessWire users, on what the module is about, how you can use it, along with some todo app tutorial. But for now, feel free to play with it and provide some feedback either here or in issue tracker. It is always easier to make changes in the beginning.
  26. 8 likes
    Having a proper front-end framework power our.. umm, back end.. is a great idea. While keeping dependencies as low as possible makes sense and has, in my opinion, proved out to be a great strategy so far, this is one of those cases where an outside component just plain makes sense. My hope is that this will also simplify the workflow for module authors trying to match the look and feel of existing admin theme(s). Currently you basically have to target a certain admin theme, and even then you'll probably end up inventing a few UI features / components of your own. Not a very good situation for providing a consistent experience for end users Have to agree with @Robin S. I enjoy simplicity as much as the next guy, but the default tab component in Uikit is just plain bad in terms of both usability and accessibility. Another thing that slightly bugs me in current design (which we probably shouldn't be commenting on, considering that it's obviously not the final one) is the low contrast: that's a really common mistake in terms of accessibility, but luckily it's also really easy to fix.
  27. 8 likes
    Looks very clean and sleek. I'm a little concerned the default UIkit styling of some components takes the minimalist aesthetic a bit too far. There's a point where the visual metaphor breaks down and usability suffers. Take the 'tabs' component... In the first screenshot it is much more obvious: that it will respond as a tabbed interface as opposed to some other type of navigation which tab is active which parts of the page are contained within the area the tab navigation controls (e.g. you can see that the "Save" button is outside the tabbed area). Edit: I realise that UIkit will only provide the foundation styling for the admin and will be customised for use there. So this is more just an observation about the decisions made by the UIkit designers rather than something that will be a problem for the finished PW admin theme.
  28. This post cannot be displayed because it is in a forum which requires at least 10 posts to view.
  29. 8 likes
    @Nurguly Ashyrov, this is really awesome. My front-end work is mostly JS/SPA work these days and I learnt to love the “headless”/“api first“ approach of commercial CMSes like Contentful. So I often thought about what a perfect and easy to manage back-end ProcessWire would be with a solid HTTP-based api built right in to allow uncoupling actual front-end/ui parts like admin and user interfaces (as actual self-contained apps) from the CMS itself. A module like yours makes a huge leap in this direction and will make ProcessWire much more interesting for a lot of front-end devs and e.g. as a flexible and fast to set up back-end for app prototyping/mvp development. A pity this didn’t exist 9 month ago!
  30. 8 likes
    I have already started to build upon the new site profile: http://szabesz.hu/ I replaced uikit.min.css and uikit.min.js with their currently up-to-date counterparts (3.0.0 beta 9, February 3, 2017) so it looks OK in IE and Edge too.
  31. 8 likes
    That will all depend on how you configure your api. If you wish this module can expose all pages in your website, including the system ones. Or you can restrict to some very limited data. There are more functionality to come, but at this stage the module supports: Template restrictions. You can choose which templates are enabled, but in addition it will conform to ProcessWire permissions. So you could limit access to certain templates only to certain user roles. You can enable access to only logged in users for example. Field restrictions. Also supports ProcessWire permissions. Including template context permissions. Meaning, you can allow title to be viewable for one template and restrict for another. Max limit support. Like the one you use in selectors. So users won't be able to get list of data for more than say 50 pages at a time. and also many other security options are on the roadmap: Built in field restrictions. At it's current stage api gives access to page fields like children, parents, createdUser..., or there are path, size, basename for files and images fields. Those will be disabled and available as extras. Query complexity limit. Currently you can build queries as deep as you want, to request ridiculous amounts of data. This will also be limited for only couple levels of complexity and you will be able to increase or decrease it.
  32. 8 likes
    Hey there @bernhard! I am happy people like it. To make an AJAX request to your GraphQL api, you need to send a query variable that describes what you want. You should've seen how the query looks like in the first post of this thread. To send the query you can use any of your favorite AJAX libraries. Here is how it looks like in jQuery. $.post( '/graphql/', // this is the url where your GraphQL api is exposed. { query: "{ skyscrapers { list { title } } }", // this is your query, this one requests the skyscrapers and title field for each of them. }, function (res) { console.log(res); } // here you do whatever you want with the returned data ); Or if you prefer to communicate with your api in application/json, you can do that too. Here is how it looks like in my favorite AJAX library - superagent. superagent .post('/graphql/') .set('Content-Type', 'application/json') .send({ query: "{ city { list { title } } }" }) .then(function (res) { console.log(res.body); }); PLEASE NOTE: When making requests to your api make sure the url is pointing where it is supposed to. The request will not work if you omit the trailing slash. With default settings the request to /graphql won't be processed by ProcessWire but instead redirected to /graphql/ and the ProcessGraphQL module will not receive the query parameter you sent. Same might happen with leading www. prefix. The request to http://example.com will be redirected to http://www.example.com which will also loose the query parameter in the middle.
  33. 8 likes
    Is this it? http://stackoverflow.com/questions/19073270/stop-caching-for-php-5-5-3-in-mamp OPcache is enabled by default is some version of MAMP.
  34. 8 likes
    New Captain Hook panel just added! Features: The hooks are parsed directly from the files in your PW installation, so they will always be up to date. They are cached, but will be updated whenever you upgrade your PW version. If you have your Editor Protocol Handler properly configured for Tracy, clicking on the Line Number will open to the method in your code editor. This panel uses @owzim's Captain Hook generator: https://github.com/owzim/PWCaptainHookCLI Please let me know if you have any problems or suggestions.
  35. 8 likes
    I posted something like this a few years ago, but that's obviously not up to date with current versions of ProcessWire. Would be interesting to create an updated version and compare these side by side, just to see how far we've come since then
  36. 8 likes
    index.php ProcessWire Bootstrap Module Init (Hooks to ProcessWire::init) init.php ProcessWire Core ready Hooks to ProcessWire::ready ready.php Template Rendering prependedTemplateFiles template.php appendedTemplateFiles Hooks to ProcessWire::finished finished.php Shutdown This should be almost complete, but I don't guarantee about anything
  37. 8 likes
    Currently the module is functional, I use it on every site and it work quite well, no error since November. At this moment only ProcessWire >3.0.0 is supported but I was planning to release it being compatible with 2.7. What you can do with the module (working features) : You can modify package's settings : name of final filename, ignore some folders, set a maximum number of packages, remove older packages and trigger the backup function with LazyCron or PwCron. Save the package in a local folder Upload package to Dropbox Upload package to GoogleDrive Remove packages from those cloud services (depending on the configuration set) *A package is a ZIP file bundled with a database dump and a full website directory dump (site, wire, etc) I think I will finish the first public version and we'll see what happens as I tested the @arjen's fork of @rot's module and didn't managed to get it working as expected. I also find my module more "simple" to use; I mean you set options, check some checkbox, set a cronjob, click submit and let it run. Also I saw some good features like emailing the logs on failure that could be added easily. I'll look at the module a little closer this afternoon. Thanks for your input guys.
  38. 8 likes
    Technically my rest helper is just some functions that I used when creating simple Rest backend with ProcessWire. So is nothing too fancy, just what I needed. See the voxgram repo that used the Rest Helper . The magic with PW is that you can integrate it with more sophisticated tools like Symphony components using composer if you want to. May be I should write a simple tutorial using Rest and PW?
  39. 7 likes
    hey guys..just stumbled upon this and i think it might be interesting, at least worth a read ;-) https://medium.freecodecamp.com/how-to-build-cross-platform-mobile-apps-using-nothing-more-than-a-json-markup-f493abec1873#.az40aujdt
  40. 7 likes
    Just my 2 cents, but I'd rather see just the one official admin theme that supports top and side menus. The key thing is that I'd like to have that official theme easily skinnable. I would love the options to color and style the theme with CSS while keeping all the html and php standard. The problem with some of the third party themes back in the early PW 2 days was that new features added to the default theme never made it to the third party themes. I'd also love to see the page tree in the sidebar and the other menu items (setup, modules, access) in the top menu. I am not certain, but I think now that the page tree is cached it won't be a performance issue to have it in the sidebar anymore?
  41. 7 likes
    Hey @bcartier and everyone who is following. I implemented a basic language support. Nothing really changed, except now with LanguageSupport enabled in your ProcessWire app, the GraphQL api will return the content in whatever language the user is assigned. In addition, when Language Support module is activated, there is a language field in your GraphQL api. So you can request the exact language you want. It looks like this. { language(name: "de") basic_page{ list{ title summary } } } You need to put the language field on the top. Well, not exactly on top but just before fields that return translatable content, like title, headline, body etc. It's because GraphQL processes requested fields from top to bottom and it will not know what language you want till it gets to language field. Did you also know that in GraphQL you can query same field multiple times with aliases? Here, take a look at this { basic_page_default: basic_page{ list{ title summary } } language(name: "de") basic_page_de: basic_page{ list{ title summary } } } Curious what will be the response? Try this with site-languages profile and find out.
  42. 7 likes
    AdminOnSteroids is nice and it's features should be evaluated for the new admin theme, but I'm not sure there's even remotely the need to implement them in the core like you're describing things. The core should not strive for feature completeness, but rather in the direction of the simplest possible subset of features needed by most of our users. Everything else is a matter for optional (core or 3rd party) modules. Talking about your example I'd imagine that hiding description/notes is rather a anti-pattern for most use-cases as they're usually filled with information the editors/moderators of a site tend to forget but are important none the less.
  43. 7 likes
    Hi, I'm still subscribed to Carl Alexander's blog, which I do not read too often, but his bard new article might be interesting for web developers, especially for those working on a Mac. As he writes: "This article goes through the entire process of setting up my new MacBook Pro. It's pretty exhaustive because I talk about why I chose some of the tools that I'm using. I also go over some of the tools that I tried out and didn't end up using." https://carlalexander.ca/2016-macbook-pro-setup/
  44. 7 likes
    That's right. That's the way it will work when module is done. Currently there is a support for template permissions. Support for Field permissions are on the way, I am working on it but it will take some time. For now you can limit the fields via module settings, I pushed support for legal fields two hours ago. Thumbs up from @horst ! Yeeeey I am a big fan of your modules!
  45. 7 likes
    You are completely right. I can't argue that "enabled-by-default" approach can lead to lots of security issues. That's why I am limiting the exposable pages only to selected templates. While the selector option is quite simple to implement I don't want to enable this kind of option because I believe it should not be this module's concern. The way I see it, if this module stays consistent and retrieves data only through $pages->find() api (or it's equivalent like $page->children(), $page->siblings() etc) that should give the user any type of control with the security. For example what you suggest could be achieved with a single hook. Say this is your template file where you expose your GraphQL api (something like /site/templates/graphql.php). <?php echo $modules->get('ProcessGraphQL')->executeGraphQL(); What you suggest could be achieved like this. <?php wire()->addHookAfter('Pages::find', function($event) { $event->return = $event->return->filter($mySecuritySelector); }); echo $modules->get('ProcessGraphQL')->executeGraphQL(); I would prefer users to approach security this way. This strategy to security gives full control for the user while allowing me to stick to a single rule when concerned about security and makes the code of the module much easier to reason about. I do realize that I could just insert the above code in the module and that's basically an implementation of what you suggest. But I don't want to encourage the user to solve security problems via module settings because no matter how hard I try, I won't be able to make this module dummy proof without limiting it's capabilities. Another thing I wanted to mention is that I see this module as a GraphQL representation of ProcessWire api. Like @Ivan Gretsky mentioned, if done right, this could allow us to build lot's of useful developer tools on top of this module. Even a mobile app that gives you limited site administration capabilities. But only if module is consistent with how ProcessWire behaves. And that includes the security of course. Oh no sir, not at all. I value your opinion very much. That's exactly what I wanted to hear from the community, opinions. I am thankful to you for mentioning this aspect of the module in it's early stage, before I started to implement other features that depend on it, like authentication or others that I might not think of right now.
  46. 7 likes
    You couldn't be more precise! GraphQL and ProcessWire fit each other very well. All this module does is just maps the ProcessWire's fieldtypes with GraphQL type system. It literally tells GraphQL that FieldtypeText is a StringType, FieldtypeDate is DateType and so on. And for getting the data, on average, it is less than a single line of code . Since you can access value of a page field like $pages->$fieldName all primitive fields inherit a method for accessing data from one place. I sure having lots of fun writing this module. I agree with Drupal "godfather" totally. The need for quick bootstrapping of an api service with flexible content structure is in very high demand. I had a hard time landing a job as a ProcessWire developer. So I target myself as a full-stack SPA developer in React.js/Node.js. I tried many of open source REST frameworks in Node.js that would help me get started with a project quickly. But non of them offered enough flexibility for my style of programming (I guess ProcessWire spoiled me ). At the time I figured out the best way to build REST api in Node.js I found out that REST is not flexible either. When an app starts evolving REST gets very messy. The Github built three versions of their REST api and still are not happy with it and now decided to release a GraphQL api which probably will not introduce breaking changes in the future, because GraphQL is designed that way. I think if made correctly, this module could bring a great value to many ProcessWire users. That's right. That is the main goal of this module. I will eventually implement all the features that needed to build a complete SPA with this module. I just try to move carefully and a usage feedback from community would help a lot. Just installing it and making couple queries to confirm that it works as expected would be great.
  47. 7 likes
    Thank you very much for this module, @Nurguly Ashyrov! I missed this graphql thing completely, though was messing around json api a bit. Had some great time reading about it. Seems like ProcessWire fits graphql like a glove. Your module should answer a lot of recent questions about integrating PW with vue.js and alike. Dries Buytaert, the Drupal "godfather", has a nice article in his blog about the necessity for a contemporary CMS to have support for web-services built in. And his choice seems to be graphql and json api. I am sure that improving and promoting PW as a "headless CMS" kind of thing is something that could bring a lot of frontend developers to use PW. This module is the perfect start. As I understand, mutations are a way to not only read, but write data? If so, that is certainly worth implementing, so a complete SPA could be possible with this graphql module alone.
  48. 7 likes
    And now for something completely different - Tracy Debugger ProcessWirified! It's still in "alpha" (meaning spent only 15 minutes on it) but feels much better. Note the semi-transparent borders (no drop shadow), full-height header buttons and the PW colors (borrowed from the Reno theme).
  49. 7 likes
    I tried this module today to output a video preview from a multilanguage field. Worked like a charm. See the screenshot. I created two fields, one for the default language (English) and one for Portuguese. Here's the code for both, if someone's interested: English field: return '<iframe src="https://www.youtube.com/embed/'.$page->youtube_id.'/?showinfo=0&amp;iv_load_policy=3&amp;controls=1" frameborder="0" allowfullscreen width="100%"></iframe>'; Portuguese field: //1021 is the 'portuguese' language page id $youtube_id = $page->youtube_id->getLanguageValue(1021); return '<iframe src="https://www.youtube.com/embed/'.$youtube_id.'/?showinfo=0&amp;iv_load_policy=3&amp;controls=1" frameborder="0" allowfullscreen width="100%"></iframe>'; Thanks @kongondo for this great module!
  50. 7 likes
    http://carolineleeming.com/ New website for still life photographer Caroline Leeming. Website build and design by myself - http://www.benbyford.com Using Jquery, alot of AJAX loading of content and the thumbnail grid with http://isotope.metafizzy.co/, slideshow hand coded by me.