Leaderboard
Popular Content
Showing content with the highest reputation on 02/26/2016 in all areas
-
For this week we've got a new version of ProcessWire 3.x, version 3.0.9. This version adds some useful UI enhancements in the admin that were originally envisioned by members of the ProcessWire community. ProcessWire 3.0.9 and also has a few other refactoring, bug fixes and tweaks. We've also got more info on the new version of ProDrafts released yesterday. https://processwire.com/blog/posts/processwire-3.0.9-adds-new-long-click-and-save-actions/7 points
-
Latest version now includes a new Diagnostics /Debug panel. The diagnostics are currently just filesystem stuff - the idea coming from the excellent ProcessDiagnostics module (http://modules.processwire.com/modules/process-diagnostics/). I just wanted a way of making the filesystem stuff available on the frontend of live sites as a quick and easy way to check if there are any problems. Please help me to test the results this is returning and the logic regarding the Status and Notes - I expect this may not be perfect yet. I also added Owner (User:Group) and Permission (chmod) info for the template file of the current page to the Template Info section of the ProcessWire panel. I have moved the Debug section from the PW Info panel into the Debug panel because I thought the PW Info panel was getting too long. I have renamed a few classes and file includes, so you will probably need to revisit your "Show Panel" settings because some by now be hidden for you initially). The panels are also now orderable. PS Those results are not my real settings - just playing to get a variety of status and notes entries for you to look at4 points
-
New version 0.6.0 brings an improved new command and a brand new module:upgrade command. I've been missing this for a very long time and finally I managed to implement it. Check if module upgrades are available. $ wireshell module:upgrade --check An upgrade is available for: - FlagPages: 0.0.8 -> 0.2.3 - ImageExtra: 0.0.1 -> 0.0.3 Download and upgrade existing module. $ wireshell module:upgrade ImageExtra An upgrade for ImageExtra is available: 0.0.3 Downloading module ImageExtra... 840.40 KB/840.40 KB ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ 100% Preparing module... Module ImageExtra downloaded successfully. Module `ImageExtra` was updated successfully.3 points
-
Hi everyone, The latest version fixes the error on Windows, although I have had to remove the "Owner" details if that function isn't available. Thanks for the suggestion Kongondo, but I think it is more complicated than using "getenv". That allows you to get the current running user - what I need is the username of the ID returned by the "fileowner" function. It also seems that perhaps "fileowner" doesn't even work as expected on Windows: " - http://www.w3schools.com/php/func_filesystem_fileowner.asp I don't have a Windows dev environment to test, so if there is someone out there who wants to test this and submit a working PR, I'll happily include it. Please let me know if anyone has any problems with the latest version.2 points
-
sendgrid has a free plan of 25.000 mails if you signup via their google partner site: https://sendgrid.com/partner/google2 points
-
2 points
-
Maybe this moudule from Kongondo will take care of it for you: https://processwire.com/talk/topic/12050-module-jquery-file-upload/2 points
-
Google today announced it's competitor to Facebooks "Instant Articles": "AMP"(Accelerared Mobile Pages)HTML. Based on open source technologies (Basically it's a set of Web Components and a JS-Framework that loads and caches resources) it seems very promising. As far as I understand media is cached, served and proxied by google (and some tech partners). Btw: processwire as a system could benefit from/partner with it, too: https://www.ampproject.org/faq/#accelerated-mobile-pages-9 I'm really looking forward to playing around with it. Anyone else already fired up his editor and started fiddling around?1 point
-
Dynamic Roles are a powerful access control tool for ProcessWire. They pick up where traditional roles leave off, and allow you to assign permissions at runtime based on any factor present with the user. Once a user receives one or more dynamic roles (at runtime), those dynamic roles then specify what pages the user can view, edit, or add children to. If traditional roles are a sledgehammer, Dynamic Roles are a scalpel, allowing nearly any finely tuned access control scenario. Traditional ProcessWire roles are limited to assignment of view/edit/add access on a per-template basis. Dynamic roles go outside those limitations and enable you to assign that access based on any factors present with a page (i.e. match any field values). Dynamic Roles assign new access, but do not revoke existing access provided by traditional roles. As a result, Dynamic Roles can be used together with traditional roles, and the two work beautifully well together. Though Dynamic Roles can also replace all situations where you would use traditional roles for access control assignments. If using Dynamic Roles to assign page-view access, you would typically want to use traditional roles to revoke view access from at least the "guest" role at the template level. Then use Dynamic Roles to assign view access to those pages in a more granular manner. This module directly affects the results of all page getting/finding operations by applying the access control directly to the database queries before pages are loaded. As a result, it is fast (regardless of scale), pagination friendly, and requires no further intervention by the developer other than configuring the dynamic roles as they see fit. Because it relies upon new features present only in ProcessWire 2.4.6+, it requires the current dev branch. Sponsored by Avoine Concept by Antti Peisa Code by Ryan Cramer PLEASE NOTE: This module is in pre-release state (like the PW dev branch it requires) and is not recommended for production use just yet. Though we do appreciate any testing and/or feedback that you are able to provide. While not required, this module benefits from ProFields Multiplier. If you have ProFields Multiplier installed before installing this module, it will make this module more powerful by making all of your access control selectors have the ability to use OR-group conditions. Depending on your access control needs, this enables you to accomplish more with fewer Dynamic Roles. How to install Make sure you are running ProcessWire 2.4.6 (dev branch) or newer. Download from GitHub (we will add this module to the Modules directory later). Place all files from this module in /site/modules/DynamicRoles/. In your admin, go to Modules > Check for new modules. Click "install" for the Dynamic Roles module (ProcessDynamicRoles). Click to Access > Dynamic Roles for the rest (see example and instructions below). Example and instructions Lets say you ran a Skyscrapers site and wanted a role enabling users with "portmanusa.com" in their email address to have edit access to skyscrapers designed by architect John Portman, with at least 40 floors, and built on-or-after 1970. Yes, this is an incredibly contrived example, but it is an example that also demonstrates the access control potential of this module. 1. In your admin, you would click to Access > Dynamic Roles. 2. Click "Add Dynamic Role". Enter a name for the dynamic role, like: "skyscraper-test-editor" and save. 3. Under "Who is in this dynamic role?" section, click "Add Field" and choose: Email => Contains Text => "portmanusa.com". This will match all users having "portmanusa.com" in their email address. 4. Under "permissions" check the boxes for: page-view and page-edit. 5. For this contrived example, we will assume the user already has view access to all skyscrapers, so we will leave the "What can they view?" section alone. 6. For the "What can they edit?" section: Click "Add Field" and choose: template => Equals => Skyscraper. Click "Add Field" and choose: architect => Equals => John Portman. Click "Add Field" and choose: floors => Greater Than Or Equal => 40. Click "Add Field" and choose: year => Greater Than Or Equal => 1970. 7. Click Save. Now users matching the conditions of your dynamic role will be able to edit the matching pages, but not any others (unless assigned by traditional roles).1 point
-
I received an email from Mandrill today which talked about upcoming changes. Here is a link to their Blog entry http://blog.mailchimp.com/important-changes-to-mandrill/1 point
-
Field Generator is a module to help you create random character strings and automatically assign them to one or multiple fields of your choice when a page is created. When setup, it will automatically do so whether you create a page through the administration panel or through code, meaning you don’t need to set $page->name or any other field of your choice, it just works automagically. Field Generator uses PHP’s openssl_random_pseudo_bytes() function to generate its random strings. It thus has both PHP >= 5.3.0 and OpenSSL as dependencies. Usage After installation, add rules through Setup > Field Generator. That’s it! Rules only run when first creating the page. For more information : https://github.com/plauclair/FieldGenerator Release : Version 0.9.0 This is the initial release. This is near stable and you shouldn’t be too worried to use it in production. Here is a screencast on how to use it.1 point
-
There is no ls command on windows. There is icacls that shows: C:\inetpub\wwwroot>icacls install.php install.php: Access denied. Successfully processed 0 files; Failed processing 1 files Access is denied because I (my login account) don't have access to the file. The only user with access to the file is the user under which web server is running. On linux that would be 400 and file is owned by user apache. If I change the ownership to my account and run icacls again: C:\inetpub\wwwroot>icacls install.php install.php NT AUTHORITY\IUSR:(RX) Successfully processed 1 files; Failed processing 0 files It shows that iusr user has read+execute access. I wouldn't bother too much with windows permissions, they are more complicated than on linux, and maybe wouldn't even show permission, status and notes columns? Many php functions don't give reliable results on windows (I think that chmod does nothing on windows, but haven't tested...). There are also differences with rename/move operations etc.1 point
-
The first thing to understand is, that real progress bars are not possible when using standard html forms without any javascript involvement, as the files are uploaded after a form is submitted, after essentially the current page is "left behind", but before the actual site reload with the response data from the server. That's why you need some javascript/ajax upload to get progress bars. If you're currently not using any ajax logic this might bring some need of refactoring on the server-side as well. And that's also the reason why WireUpload is not really the part to ask for, as it's only responsible of handling already submitted files on the server. How files are send to the server doesn't matter for it.1 point
-
@Peter: duplicate content is not an issue as you also need to have a canonical link on the AMP page, directing to the 'full' page. So Google is fully aware of the two pages - they actually asked for a 'separate mobile content', didn't they? Basically nothing really new. There were days when we had seperate mobile sites, and our server selcted what content to be sent out. Now again we have two different offerings/pages, and Google does the pick.1 point
-
1 point
-
did you google? https://processwire.com/talk/topic/11055-ckeditor-wont-allow-classes-left-right/ https://processwire.com/talk/topic/10123-how-to-allow-an-id-in-ckeditor/#entry965261 point
-
1 point
-
1 point
-
Thank you Adrian. I tried PageProtector, but it didn't work on my site. I don't know why though, but it was the part where inserting the login form on a template that didn't work. I ended up just adding a login form to the template, checking if the user is logged in or not. Thanks everyone for chipping in with ideas and feedback!1 point
-
A module is needed doing this. How to build a module: http://wiki.processwire.com/index.php/Module_Creation Get informed about hooks here: https://processwire.com/api/hooks/ This one should do the job <?php /** * ProcessWire Module Modify View Url * * @version 100 * @copyright 2016 Christoph Thelen * @author kixe (Christoph Thelen note@qualyweb.com) * */ class ProcessModifyViewUrl extends Process implements Module, ConfigurableModule { static public function getModuleInfo() { return array( 'title' => 'Modify View Url', 'summary' => 'Provide alternative url for the action button \'view\' and the view tab under /page/edit/', 'author' => 'kixe', 'version' => 100, 'singular' => true, 'autoload' => true, 'icon' => 'mail-forward' ); } static public function getDefaultConfig() { return array( 'url' => 'http://example.org' ); } public function __construct() { foreach(self::getDefaultConfig() as $key => $value) { $this->$key = $value; } } public function init() { $this->addHookBefore('ProcessPageEdit::buildFormView', function($event) { $event->arguments(0, $this->url); }); $this->addHookAfter('ProcessPageListActions::getActions', function($event) { $actions = $event->return; $actions['view'] = array( 'cn' => $actions['view']['cn'], 'name' => $actions['view']['name'], 'url' => $this->url ); $event->return = $actions; }); } public function getModuleConfigInputfields(array $data) { $inputfields = new InputfieldWrapper(); $defaults = self::getDefaultConfig(); $data = array_merge($defaults, $data); $f = wire('modules')->get("InputfieldText"); $f->attr('name+id', 'url'); $f->label = __("Alternative Url"); $f->value = $data['url']; $inputfields->add($f); return $inputfields; } }1 point
-
Thank you horst! Anyway your code is awesome, so much cleaner! Even though I added a second loop to handle multiple comma (or dash) separated tag groups and added comments your version is still shorter! function processTags($tags, $tagParent = 'tags') { $vars = array('sanitizer', 'pages'); foreach ($vars as $var) ${$var} = wire("$var"); // added this loop to split CSV strings // now we can enter multiple seperate tags with children // like "Tag1,Tag2>Child Tag,Tag3" $tagsArray = $sanitizer->array($tags); $return = new PageArray(); foreach ($tagsArray as $tagGroup) { // parts now holds the hirarchical ordered parent list, without the rootParent named in $tagParent $parts = explode('>', $tagGroup); // we need to set the parent for every tag group // which can be a single comment or can have children // otherwise "Tag 3" (above example) would be a child of "Child Tag" $parent = $pages->getByPath("/$tagParent/"); foreach($parts as $part) { // try to get a childpage with name $part and parent = $parent // added second argument (2) to pageName sanitizer for translation // because the page creation uses this, so without it wouldn't find existing pages.. $p = $pages->getByPath($parent->path . $sanitizer->pageName($part, 2)); if(!$p->id) { // if it do not exist, create it now $p = new Page(); $p->parent = $parent; $p->template = 'tag'; $p->title = $part; $p->save(); } // switch parent to the next level: $parent = $p; $return->add($p); } } return $return; } Thanks a lot horst!! EDIT: I changed the $pages->get() queries to $pages->getByPath() which requires PW 3.0.6. Check out Ryans blog post with benchmarks EDIT 2: It's now returning the created (or existing) tags.1 point
-
Take a look at what I did in AdminRestrictBranch: https://github.com/adrianbj/AdminRestrictBranch/blob/master/AdminRestrictBranch.module#L220 You can hook into Page::editable and set up your own logic to return true/false as needed.1 point
-
hi fliwatuet, i really do not understand this question. have you done the hello world tutorial i mentioned above? it seems you are still not familiar with the basic concepts of processwire? https://processwire.com/docs/tutorials/hello-worlds/ it's a fully flexible and customizable system and NOT a click-click-and-ready-but-take-it-as-it-is-thing like so many other systems. to your question regarding a file manager. there's this module right now in development - but it will be a commercial module and only kongondo knows when it will be available https://processwire.com/talk/topic/11224-media-manager/1 point
-
ProDrafts version 2 is now available for download in the ProDrafts board. This one includes the "Live Preview" capability shown in that video above. It also includes "View Both" capability, and several other improvements.1 point
-
Hi Can, a short code example how I would go with it. It is written in the browser, not tested, and it is the bare core of my idea, you need to add the rest by yourself, if it works: // $tags is a string like: "Processwire>Docs>Security" function doTags($tags, $tagParent = 'tags') { $vars = array('sanitizer', 'pages'); foreach ($vars as $var) ${$var} = wire("$var"); $parts = explode('>', $tags); // parts now holds the hirarchical ordered parent list, without the rootParent named in $tagParent $parent = $pages->get("name=$tagParent"); foreach($parts as $part) { // try to get a childpage with name $part and parent = $parent $p = $pages->get("parent=$parent, name=" . $sanitizer->pageName($part)); if(0 == $p->id) { // if it do not exist, create it now $p = new Page(); $p->parent = $parent; $p->template = 'tag'; $p->title = $part; $p->save(); } // switch parent to the next level: $parent = $p; } }1 point
-
Line 713 typo: $_timespamp private static function _getCacheName($files, $prefix = 'css_', $ext = '.css') { // ------------------------------------------------------------------------ // Initialize timestamp variable. // ------------------------------------------------------------------------ $_timestamp = ''; // ------------------------------------------------------------------------ // Calculate timestamp of all files // ------------------------------------------------------------------------ foreach ($files as $file) { $_timestamp = ($_timespamp + $file['last_modified']); } // ------------------------------------------------------------------------ // Create a unique MD5 file name with the specified prefix. // ------------------------------------------------------------------------ return (self::$developmentMode !== true) ? $prefix.md5($_timestamp).$ext : $prefix.md5($_timestamp).'_dev'.$ext; }1 point
-
Yes, if the WordPress site supports webmentions. If the site doesn't support webmentions and does support pingback, this module will fallback to sending a pingback. There are WordPress plugins to add webmention support,. See http://indiewebcamp.com/WordPress for more info. As I understand it, there's actually two plugins to get the full features: Webmention and Semantic Linkbacks. The latter gives you more user-friendly text for linkbacks (of all types). There's a pretty active group of WordPress users in the indiewebcamp community and I know they'd love to help anyone get set up with these plugins. Feel free to stop by the IRC for any help: http://indiewebcamp.com/IRC1 point
-
Hi fliwatuet and welcome to processwire. Many pw users report that working with processwire has a php learning side-effect I can confirm from my own experience with processwire that working with processwire you will learn php along with it. With processwire you don't have to learn first a new cms or need to have a lot of coding experience. Instead you can immediately use all html, css, js and php experience that you already have and start using it with processwire. Processwire comes with multi-language out of the box ! With only a few steps you will have it configured. They all have their place, but when compared, processwire is going to save you a lot of time and headache.1 point
-
What you've got as a result is a PageArray so you'd need to check the count like this (edit: ..and change find to get as diogo says below): if(count($info) >= 1) { // do stuff } If there are potentially lots of children, it would be better to do it for example like this:$childCount = $pages->count("parent.title=previous caption winners"); if($childCount >= 1) { // do stuff } This way you wont end up fetching all the children just to count them.1 point
-
Pagination module doesn't work with in memory page arrays. Once you manipulate or merge arrays you operating in memory. Pager does need a single find db query to work. You'd need to create your own pager functions for in memory page arrays using the start and limit selectors.1 point
-
1 point