Leaderboard
Popular Content
Showing content with the highest reputation on 12/08/2017 in all areas
-
We relaunched the website for the famous Opernhaus Zürich https://www.opernhaus.ch with ProcessWire. Lots of stuff going on on the front-end. The "design" was made by an inhouse designer that also does their print work and previous website designs. We used patternlab node with mustache template engine as the design/prototype system. Building elements and component as kind of modules (mustache, css, js) which then are 1:1 imported into PW, which then can be rendered using mustache (php version) via a custom "controller" system.16 points
-
9 points
-
I went "crazy" quite a few times over all frontend churn as well, FOMO, etc. At the end of the day, use the best tool for the job. Right now, practically all of my needs are met with the following stack: ProcessWire UIkit3 (it's so good; but, but the horror of using UIkits classes in your HTML!) Some PW premium modules: ListerPro ProCache (it's become my build process tool; you can build UIkit3 with it perfectly fine; I'm dumping Node, Webpack, and whatever the "latest" way to do things is) FormBuilder Pulling in whatever packages I need via composer VueJS if needed (loading it via CDN, oh my god the horror!) Digital Ocean for hosting (manually configuring their Ubuntu LAMP 16.04 droplet... takes only a few minutes) If your clients want to use some crappy shared host, switch them to DigitalOcean; it's practically the same price. I develop all my sites on Windows (but technically it's Linux thanks to WSL). No VMs, no Docker (again, the horror of what happens if my server ends up being PHP v7.0.23 and my local machine is 7.0.22!). Simple and reliable 99.99999999999999% of the time. I deploy with a simple shell script (horror! not using Capistrano, Ansible, whatever the latest tool is). Sure, your site won't be able to handle all of earth's traffic if everyone were to visit your site at the same moment, but it'll be fine for 85.7% of the sites you most likely take on. I've built very complex sites with just those tools and I move extremely rapidly while keeping the site client-maintainable! Even if you became Mr. Expert on the latest frontend tools, it's going to change significantly by this time next year and the year after that. Perhaps sit on the sidelines for a bit. End rant.9 points
-
Add Image URLs A module for ProcessWire CMS/CMF. Allows images/files to be added to Image/File fields by pasting URLs or using the API. Installation Install the Add Image URLs module. Configuration You can add MIME type > file extension mappings in the module config. These mappings are used when validating URLs to files that do not have file extensions. Usage A "Paste URLs" button will be added to all Image and File fields. Use the button to show a textarea where URLs may be pasted, one per line. Images/files are added when the page is saved. A Pagefiles::addFromUrl method is also added to the API to achieve the same result. The argument of this method is expected to be either: a URL: "https://domain.com/image.jpg" an array of URLs: ["https://domain.com/image1.jpg", "https://domain.com/image2.jpg"] Example: // Get unformatted value of File/Image field to be sure that it's an instance of Pagefiles $page->getUnformatted('file_field')->addFromUrl("https://domain.com/path-to-file.ext"); // No need to call $page->save() as it's already done in the method Should you have an issue using the method, please have a look at the "errors" log to check if something was wrong with your URL(s). WebP conversion The core InputfieldImage does not support images in WebP format. But if you have the WebP To Jpg module installed (v0.2.0 or newer) then any WebP images you add via Add Image URLs will be automatically converted to JPG format. https://github.com/Toutouwai/AddImageUrls https://modules.processwire.com/modules/add-image-urls/8 points
-
This week I've been back in the office and enjoying working on the core. Big thanks to Bernhard Baumrock for his great post last week about Process modules. I was offline for about 10 days, so version 3.0.85 of ProcessWire on the dev branch has been largely focused on getting caught up with and resolving issue reports (at GitHub). Though there are a couple new things too, which are covered in this week's post: https://processwire.com/blog/posts/pw-3.0.85/8 points
-
What g**gle want you to do is optimizing your images beyond what GD or imagick or other image libraries do. They want you to optimize *every* *final* image variation with tools like jpegOptim or others. Or to use an image optimization service for your final variation images. And besides the image compression, this analyzing system is not very intelligent! As an example, when you use one single css and one single js file for a whole site, and you use it with aggressive client caching, you will get bad results for a single page url, because gpsi doesn't take into account, that a browser has this already in its cache after retrieving it one time. And another thing is, that I never have seen a bad ranking for fetching g**gle fonts from there servers with every f**ckig page reload or page call. You know why those fonts are not kept in the browser cache, yes? When selfhosting those fonts, every page load after the first one gets the fonts from the browser cache, no extra remote connection is needed!4 points
-
I read you too fast! Ok yes I forgot to update this link! Will fix it in 1.1.6 - Thanks theo ! @msavard and did you tried the 1.1.5 if it solve your issue ? Also a small tip for you in case you're not aware. You can use this module - ProcessWireUpgrade - and update the module you want in one click.3 points
-
I think it is the same problem (I read the rest of the thread). Updating made progress but then I was getting the same error as @theo. I'm a beginner with processwire so I will let you two hash things out and try to update again in a few days.3 points
-
Answering from my mobile. Good catch ! I will update the module with your patch, we need now to alert the user that some files are not resdable and thus excluded from the zip. Thanks again @theo!3 points
-
OK, some success here: Please add "is_readable" check in function zipData } elseif (is_file($file) && is_readable($file)) { $filecount++; $zip->addFile($file, str_replace($source . '', '', $file)); $limitItems++; Like this it works. If a file is not readable, it silently fails otherwise.3 points
-
3 points
-
Hey guys, It turns out just as the error said. I had all these errors because mysql.sock was missing, or shut down? It should be here, even AMPPS is running and MySql is started/running (I tried restarting AMPPS, MySql, no luck). Regarding the (2) in error: https://stackoverflow.com/a/23448805/512353 So I restarted my machine and then fired up AMPPS again. Sure enough, this time mysql.sock started and everything is back to normal. I don't know what caused it to die in the first place, but I hope this doesn't become a frequent occurrence. For now however, it is fixed Hope this helps someone in the future.3 points
-
Hi All, Recently I've been trying to improve my development skills with R&D projects. My skills are mostly with HTML, PHP and Javascript. I class myself as a front-end developer however I can build back-end applications. I remember when Web 2.0 was realised and there was a shift in ideology and a design guideline to come along with it. But recently things are moving quicker than ever. I'm seeing a huge amount of people dropping jQuery in favour of ES6. But more than that, they are using framework's like React, Angular and Vue. Recently I learnt about JAMStack, and idea that you use API's to generate a flat file website which you serve through an CDN and honestly, I'm feeling way out of my depth here. I really want to stay up to date, but it seems developing a website is like engineering an engine, once you get to the top end of "speed" making it go faster is 100x harder. Don't get me wrong, I'm happy with the performance of ProcessWire, but these JAMStack websites are blazing. I guess you could call this Web 3.0 and it's all about speed and lightweight. Things like ASYNC and lot of other things that can come together to make a pleasurable experience even on the slowest of mobile networks. Is all of this a fad or is it really the next big movement? Is that how we should be developing websites now, or are they just buzz-words? I do like the idea of the CMS generating flat files and routing that through a CDN, but also using Git to manage all the changes it seems very fluid. (https://www.netlify.com, https://github.com/netlify/netlify-cms). I would love to learn all of this, but I feel like there is so much to catch up on I don't know where to start. Like, what is gulp? postCSS? I guess they are pre-processing like LESS to have all this power but still serve small files over the browser. As you can probably tell, I'm overwhelmed by all these things and it doesn't stop, now the "next big thing" is Gatsby (https://www.gatsbyjs.org) and whatever happened to Node.js? I feel like I'm going crazy haha! My question is, how do you guys deal with all of this? Is it something that ProcessWire can be used with as ProcessWire uses a database and requires PHP. I recently read: which touched upon these things, but I didn't understand it all.2 points
-
So true all what you've said @horst It is insane that we are sort of forced to adhere to google standards and not to common sense. However, I still find that content is king, so I do not push it too far optimizing things to google's liking. Instead, I tell my clients to write frequent news/blog posts. That works2 points
-
If you want a non-default theme, I would recommend setting the config variable in your config.php file. $config->defaultAdminTheme = 'AdminThemeReno';2 points
-
2 points
-
Hello, maybe you could be interested in this post Basically the JAMStack is just a Website with JS and a REST or GraphQL API. Wich can be easily done with PW if you need to. A JAMStack is not needed for every project though2 points
-
@flydev "Delete All" seems OK, but I was talking about the trashcans. <button id="deletePackages" class="ui-button ui-widget ui-corner-all ui-state-default" name="deletePackages" value="Delete All" type="button" data-action="http://localhost/~theo/mysite/processwire/setup/duplicator/?action=deleteAll"><span class="ui-button-text"><i class="fa fa-trash"></i> Delete All</span></button> Trashcan is wrong: <a href="?action=delete&file=2017-12-07_15-22-42-localhost.package.zip" class="trashTrigger" data-action="http://localhost/~theo/mysite/~theomysiteprocesswire/setup/duplicator/?action=none"><i class="fa fa-trash"></i></a>2 points
-
Thanks for your input. @psy: your idea of downloading their version of the images and uploading those did cross my mind, but hell, are our clients supposed to go through all that trouble after we hand over the keys? @dragan: no wysiwyg field images. Only controlled rendering of image fields. <rant> In this particular case I've added a condition for displaying the analytics chunk for everyone except Google, cause it was complaining about me not caching the file that's on their server. It also complains about the font that I'm loading from Google Fonts. The inline critical CSS thing is another insanity. We're already minifying, caching and gzipping everything and STILL need to overengineer our frontends to appease the beast. So to make them happy our users will have to see fonts changing for a split second after page loads and a whole bunch of other weirdness. Then there's the 200 byte SVG that can be reduced by 20% if compressed. </rant>2 points
-
@horst Google is Google... not %100 certain but strongly suspect G adds meta to jpgs it optimizes and so gives higher scores even if the original was fully optimized first. Even so, still regularly getting GSPI scores on mobile 75%+ and desktop 90%+ with PW, Procache etc and with careful coding so no errors on https://validator.w3.org/ . Can only do what I can do. I use the PW site results as comparisons to WordPress site performances to show my clients that PW is the way to go. For me, it's not about getting upset with G, it's more about proving how well PW performs2 points
-
Thanks, I discovered this myself while I was experimenting yesterday, but it seems less than ideal for a couple of reasons. 1. When you do this, it seems that the image is first downloaded to your local disk, then uploaded to the site. This makes it unnecessarily slow for larger images or on slow connections. 2. The filename of the image is not preserved as per the original. On Windows Chrome at least, every filename gets "_1" appended to it. But on the positive side this approach does allow for client-side resizing. I had a go at a module that allows images to be added to a field via pasted URLs: I had a few concerns about the approach because the page and image field are identified by values that could potentially be manipulated client-side. But I've included some checks that hopefully mitigate this. Another niggle is that the API method $page->images_field->add() is surprisingly relaxed about what it will add to an images field. It doesn't seem to do any validation against the field settings or even disallow non-images from being added to an images field. So all the validation must be done independently (@Macrura, this might be something that affects your module too). I think I've accounted for most things, but if you guys will take a look and let me know if you spot any potential issues that would be great. Because the browser is not involved in the upload, no client-side resizing is possible but is done server-side instead (for max width/height settings).2 points
-
I can confirm this (PW 3.0.84). Must be a bug. To get around this, like you said previously, just choose the one under Multiple Page Selection (sortable). It will still work with your Single Page field.2 points
-
The module is updated : - fixed ProcessDuplicator - packages listed in ProcessDuplicator are now blended and re-ordered correctly by timestamps @msavard Hi and welcome here! About your issue, it is hard say without furthermore information. It can be a memory issue or a timeout issue. Which version of ProcessWire / PHP are you trying to run Duplicator on ? Which hosting provider are you using ? Are you on vps, shared host ? Could you check the duplicator log (in /site/assets/logs/duplicator.log), the server and PHP error logs ?2 points
-
Some backgrounds about the wp-login Jonathan mentioned you'll find here: https://processwire.com/blog/posts/optimizing-404s-in-processwire/ A must-read IMHO.2 points
-
Like you, I've tried lots of different compression techniques. Seems Google only likes its own compressed files. What I do to get the scores up... 1. Run the test then download the zip containing the compressed images generated by Google Page Speed Insights and expand the file 2. Upload the images to the assets/files/[page#] directory and overwrite the images generated by PW 3. Run GPSI again and your score will soar It's not a long-term answer but helpful in development.2 points
-
Thanks for the code snippet @adrian , I think that checking for mod_userdir is not needed anymore as the only issue occurring with this apache module was getting the backend url, which is fixed by using $config->urls->httpAdmin I will push the update in an hour or so. Thanks!2 points
-
Interesting read and a very nice PW site: https://www.ancientworldmagazine.com/dev/blog/built-using-processwire/2 points
-
I'm working on a module that scans the textarea field and imports external images, and replaces the reference to them in the editor with the local version. This is the function that is hooked after Page save. Mods: http://modules.processwire.com/modules/import-external-images/ Github: https://github.com/outflux3/ImportExternalImages1 point
-
Are, you are having a problem after upgrading to PW 3.0.85? If so, please provide some additional information that will help us help you. Thanks.1 point
-
Depending on how complex your needs are, the core does offer some support. Use something like this for the selector value for a page field: parent=page.otherpagefield That allows for ajax population of one select based on the selected value of the otherpagefield1 point
-
I feel your pain @Tom. Except I came at all this in a different way and learned HTML and CSS until I was blue in the face (then nodejs/gulp/SCSS/Less/postCSS) and now webpack (which I'm finding horrible). Now however, after spending years ignoring JS/PHP (i.e. actual programming), my skills in that area are not good enough. I'm very lopsided towards CSS and the tools themselves. But now JS is so popular, I don't understand react/angular/vue or any of that stuff. You're certainly not alone with the feeling of "too much to learn"!1 point
-
A big thanks to Ryan! He has included this feature request in PW 3.0.85 Read more1 point
-
There is another little problem. I guess it has to do with mod_userdir. If you go to the package manager page and delete a package (trashcan), the item will be deleted but you will get redirected to an invalid URL. Sort of: /~theo/mysite/~theomysiteprocesswire/setup/duplicator/?action=none Thank you.1 point
-
Hi @Mailte, thats bad. There were a pull request added some time ago, that should make the config page a bit more shiny. Unfortunately, now I recognized that it broke the backwards compatibility. I have tested it with PW 2.5.0, where I get exactly the error you described. With PW 2.5.11+ it runs as expected, without errors! So, you may have 2 options now: my prioritized option is to get the WireMail SMTP version 0.2.5, they are known to work with PW 2.4.1 - 2.5.10 too, (https://github.com/horst-n/WireMailSmtp/tree/532dd94752597a4b2b9f3a2c02ef48b21db77f84) or upgrade your pw version to at least 2.5.11 or 2.6.0. But when upgrading your PW version, please first try it in a copy, not on a live site. With and after PW +2.5.11 there were some changes in images variation naming scheme, that may lead to issues like massive images recreations and a lot of orphaned variation files! Or, you have to wait until I get time to rearange the last commits to also work with prior PW versions than 2.5.11, as it was before. I updated the code of the config screen to make it backwards compatible again. Please download / install the latest module version 0.3.0 to use it with PW 2.5.3 https://github.com/horst-n/WireMailSmtp or http://modules.processwire.com/modules/wire-mail-smtp/1 point
-
I've sent a couple of you the latest VPS to beta test please before the official release. Thanks!1 point
-
I do it differently, I use the google recaptcha module here - can install it via classname (MarkupGoogleRecaptcha) in the admin (modules page). So, in my form at the top (where you include valitron): $captcha = $modules->get("MarkupGoogleRecaptcha"); ...then to render it, just: <label for="recaptcha">Recaptcha (required)</label> <!-- Google Recaptcha code START --> <?php echo $captcha->render(); ?> <!-- Google Recaptcha code END --> ...and to check the response: if ($captcha->verifyResponse() === true) I found this way easier. You fill out the secret key and stuff in the module instead of pasting it into your php file.1 point
-
Not sure how that’s possible, but it could be related to caching. If you provide more information about your setup and what jumplinks you have created, I might be able to assist. It’s on ice at the moment due to new work that’s come in. Time is super limited until earlyish next year, at which point I can revisit v2. Sorry for the delays, but it’s unavoidable at the moment.1 point
-
Are you using the HTML5 srcset attribute to provide different sizes of the images for different screen resolutions? I've found about 60 quality is as optimised as is needed, so long as the images are the right size for the resolution they are displaying at. Even if you're only a few pixels larger than the screen resolution being rendered, I think Pagespeed insights can make a fuss. Also, in the core - can't remember the exact module, I think I changed the image resizing function to use progressive encoding, as that can result in faster rendering of jpgs as they can start rendering before they're loaded. I can't find where I did this now, and it would be nice for it to be officially part of the core to have the option for progressive encoded jpgs.1 point
-
Maybe this way can help ... I often use delayed loading for images from this page https://appelsiini.net/projects/lazyload/ Adds a script in bottom with async or defer to better load page time <script src="<?php echo $templ_url?>assets/js/lazyload.min.js" defer></script> <script> window.addEventListener("load", function(){ lazyload(); }); </script> And I add the lazyload class for the image along with data-src <img class='lazyload' data-src="/your-image-url" alt="img-alt">1 point
-
Very good article. I also like how they don't hide information regarding developing this website, to include both a Changelog and Roadmap section under their "Dev Index" https://www.ancientworldmagazine.com/dev/1 point
-
Thanks for all the suggestions. GreenShot didn't work (captured only closed dropdown, not the open state). PicPick works great Back to the original question: Here's what I mean... If I choose the option shown in single.png, the settings panel never shows up. If I choose the option shown in multiple.png, everything works as expected.1 point
-
https://www.blue-tomato.com/blue-world/ Everything under /blue-world/ is from Processwire1 point
-
Just found a few... International Bank of Azerbaijan https://ibar.az/ CinemaPlus Azerbaijan http://www.cinemaplus.az/ (PW is big in Azerbaijan, obvs) Canada business Network https://canadabusiness.ca/ Steinberg Help (Steinberg user manuals repository) https://steinberg.help/1 point
-
1 point
-
» A more exhaustive version of this article is also available on Medium in English and German « First, we'd like to thank the very helpful community here for the excellent support. In many cases we found guidance or even finished solutions for our problems. So a big THANK YOU!!! We are pleased to introduce you to the new Ladies Lounge 18 website. The next ICF Women’s Conference will take place in Zurich and several satellite locations across Europe. We embarked on bold new directions for the development of the website — in line with the BRAVE theme. Ladies Lounge 18 — ICF Woman’s Conference website on Processwire ICF Church is a European Church Movement that started 20 years ago in Zurich and since experienced tremendous growth. There are already well over 60 ICF churches across Europe and Asia. ICF is a non-denominational church with a biblical foundation that was born out of the vision to build a dynamic, tangible church that is right at the heartbeat of time. With the growth of the Ladies Lounge from a single-site event to a multi-site event, the demands and challenges to the website have also increased. A simple HTML website no longer cuts it. Simplified frontend Our goal with the development of the new site was it to present the different locations — with different languages and partly different content — under once uniform umbrella — while at the same time minimising the administrative effort. In addition to the new bold look and feel, this year’s website is now simpler and easier and the information is accessible with fewer clicks. Some highlights of the new website Thanks to processwire, all contents are maintained in one place only, even if they are displayed several times on the website 100% customised data model for content creators Content can be edited directly inline with a double-click: Multi-language in the frontend and backend Dynamic Rights: Editors can edit their locations in all available languages and the other content only in their own language Easy login with Google account via OAuth2 Plugin Uikit Frontend with SCSS built using PW internal features (find of files…) Custom Frontend Setup with Layout, Components, Partials and Snippets Only about 3 weeks development time from 0 to 100 (never having published a PW before) Despite multi-location multi-language requirement, the site is easy to use for both visitors and editors: The search for a good CMS is over It’s hard to find a system that combines flexibility and scope with simplicity, both in maintainance and development. The search for such a system is difficult. By and large, the open source world offers you the following options: In most cases, the more powerful a CMS, the more complex the maintenance and development It is usually like that; The functionality of a system also increases the training and operating effort — or the system is easy to use, but is powerless, and must be reporposed for high demands beyond its limits. Quite different Processwire : You do not have to learn a new native language, you don’t have to fight plugin hell and mess around with the loop, you don’t have to torment yourself with system-generated front-end code or even learn an entierly new, old PHP framework . All our basic requirements are met: Custom Content Types Flexible and extensible rights-management Multilanguage Intuitive backend Well curated Plugin Directory Actually working front-end editing Simple templating with 100% frontend freedom In addition, Processwire has an exceptionally friendly and helpful community. As a rule of thumb, questions are answered constructively in a few hours . The development progresses in brisk steps , the code is extremely easy to understand and simple. Processwire has a supremely powerful yet simple API , and for important things there are (not 1000) but certainly one module which at least serves as a good starting point for further development. Last but not least, the documentation is easy to understand, extensive and clever . Our experience shows, that you can find a quick and simple solution with Processwire, even for things like extending the rights-management — most of the time a highly complex task with other systems. This is also reflected positively in the user interface. The otherwise so “simple” Wordpress crumbles when coping with more complex tasks. It sumbles over its apparent simplicity and suddenly becomes complex: Old vs. New — Simple and yet complicated vs. easy and hmmm … easy Our experience with Processwire as first-timers Before we found out about Processwire, we found CraftCMS on our hunt for a better CMS. We were frustrated by the likes of Typo3, WP or Drupal like many here. CraftCMS looked very promising but as we were digging deeper into it, we found it did not met our requirements for some big projects in our pipeline that require many different locations, languages and features. Initially we were sceptical about Processwire because; A. CraftCMS Website (and before UiKit also the admin interface) simply locked much nicer and B. because it is built on top of a Framework It was only later, that we found out, that NOT depending on a Framework is actually a very good thing in Processwire's case. Things tend to get big and cumbersome rather then lean and clean. But now we are convinced, that Processwire is far superior to any of the other CMS right now available in most cases. The good Processwire is the first CMS since time immemorial that is really fun to use (almost) from start to finish— whether API, documentation, community, modules or backend interface. Every few hours you will be pleasantly surprised and a sense of achievement is never far away. The learning curve is very flat and you’ll find your way quickly arround the system. Even modules can be created quickly without much experience. Processwire is not over-engineered and uses no-frills PHP code — and that’s where the power steams from: simplicity = easy to understand = less code = save = easy maintanance = faster development … Even complex modules in Processwire usually only consist of a few hundred lines of code — often much less. And if “hooks” cause wordpress-damaged developers a cold shiver, Hooks in Processwire are a powerful tool to expand the core. The main developer Ryan is a child prodigy — active, eloquent and helpful. Processwire modules are stable even across major releases as the code base is so clean, simple and small. There is a GraphQL Plugin — anyone said Headless-CMS?! Image and file handling is a pleasure: echo "<img src='{$speaker->image->size(400, 600)->url}' alt='{$speaker->fullname}' />"; I could go on all day … The not soooo good Separation of Stucture and Data The definition of the fields and templates is stored in the database, so the separation between content and system is not guaranteed. This complicates clean development with separate live- and development-environments. However, there is a migration module that looks promising — another module, which is expected to write these configurations into the file system, unfortunately nuked our system. I'm sure there will be (and maybe we will invest) some clever solutions for this in the future. Some inspiration could also be drawn here, one of the greatest Plugins for WP: https://deliciousbrains.com/wp-migrate-db-pro/ Access rights The Access-Rights where missing some critical features: Editors needed to be able to edit pages in all languages on their own location, and content on the rest of the page only in their respective language. We solved it by a custom field adding a relation between a page the user and a role that we dynamically add to the user to escalate access rights; /** * Initialize the module. * * ProcessWire calls this when the module is loaded. For 'autoload' modules, this will be called * when ProcessWire's API is ready. As a result, this is a good place to attach hooks. */ public function init() { $this->addHookBefore('ProcessPageEdit::execute', $this, 'addDynPermission'); $this->addHookBefore('ProcessPageAdd::execute', $this, 'addDynPermission'); } public function addDynPermission(HookEvent $event) { $message = false; $page = $event->object->getPage(); $root = $page->rootParent; $user = $this->user; if ($user->template->hasField('dynroles')) { if ($message) { $this->message('User has Dynroles: '.$user->dynroles->each('{name} ')); } // for page add hook… if ($page instanceof NullPage) { // click new and it's get, save it's post… $rootid = wire('input')->get->int('parent_id') ? wire('input')->get->int('parent_id') : wire('input')->post->parent_id; if ($message) { $this->message('Searching Root '.$rootid); } $root = wire('pages')->get($rootid)->rootParent; } elseif ($page->template->hasField('dynroles')) { if ($message) { $this->message('Page "'.$page->name.'" has Dynroles: '.$page->dynroles->each('{name} ')); } foreach ($page->get('dynroles') as $role) { if ($role->id && $user->dynroles->has($role)) { if ($message) { $this->message('Add dynamic role "'.$role->name.'" because of page "'.$page->name.'"'); } $user->addRole($role); } } } if (!($root instanceof NullPage) && $root->template->hasField('dynroles')) { if ($message) { $this->message('Root "'.$root->name.'" has dynamic roles: '.$root->dynroles->each('{name} ')); } foreach ($root->get('dynroles') as $role) { if ($role->id && $user->dynroles->has($role)) { if ($message) { $this->message('Add dynamic role "'.$role->name.'" because of root page "'.$root->name.'"'); } $user->addRole($role); } } } } } With the Droles and Access Groups Modules we were not able to find a solution. I thought it was hard to get absolute URLs out of the system — Ha! What a fool I was. So much for the topic of positive surprise. (Maybe you noticed, the point actually belongs to the top.) But while we’re at it — that I thought it would not work, was due to a somewhat incomplete documentation in a few instances. Although it is far better than many others, it still lacks useful hints at one point or another. As in the example above, however, the friendly community quickly helps here. processwire.com looks a bit old-fashioned and could use some marketing love. You notice the high level to moan with Processwire. There is no free Tesla here. Conclusion Processwire is for anyone who is upset about any Typo3, Wordpress and Drupal lunacy — a fresh breeze of air, clear water, a pure joy. It’s great as a CMF and Headless CMS, and we keep asking ourselves — why is it not more widely known? If you value simple but clean code, flexibility, stability, speed, fast development times and maximum freedom, you should definitely take a look at it. You have to like — or at least not hate PHP — and come to terms with the fact that the system is not over-engineerd to excess. If that’s okay with you, everything is possible — with GraphQL you can even build a completely decoupled frontend. We are convinced of the simplicity of Processwire and will implement future sites from now on using it as a foundation. Links & resources we found helpful API documentation and selectors API cheatsheet pretty handy, not quite complete for version 3.0 Captain Hook Overview of Hooks Weekly.PW newsletter a week, exciting Wireshell command line interface for Processwire Nice article about Processwire Plugins & Techniques that we used Custom Frontend Setup with Uikit 3 and SCSS, and Markup Regions Uikit Backend Theme ( github ) Oauth2 login modules In-house development Login with E-Mail Pro Fields for repeater matrix fields (infos, price tables, daily routines) Wire upgrade to update plugins and the core Wire Mail Mandrill to send mails FunctionalFields for translatable front-end texts that are not part of a content type (headings, button labels, etc.) Runtime markup for dynamic backend fields (combination of first and last name) Tracy debugger for fast debugging Textformatter OEmbed to convert Vimeo and Youtube links into embed codes HideUneditablePages thanks to @adrian1 point
-
I always look for free HTML templates or buy one for about $10. It takes me to about a day to incorporate it in PW. After that you have all fexibility of PW with a kick-ass template.1 point
-
don't forget to sell yourself (and not the system that you are using) find out what your client is looking for and then tell them what you can offer. if they are looking for a quick & cheap wordpress website (they can have good reasons for that), maybe you are not the right person for the job... (and maybe its also better for you to create one great PW site with a great client than 2 cheap websites with 2 not-so-great clients) think of the following 2 approaches and how the client may feel or what the client may hear: or this one: how would you feel? what would you think? maybe in situation one you would feel bad and confused because there is somebody telling you that something that most of the others are using is a bad choice? in situation two you can see instantly how the client reacts: does he want that quick&dirty way? does he want to be like everybody else? same situation but maybe totally different feelings for your client if he asks you for your reasons you know that he is interested (or at least curious). he knows that you are not the quick&dirty guy and he should not feel offended or over-instructed (telling him if he decides like 80% of all others he will regret - actually, when i read that, that sounds really strange and i totally understand my clients ). thanks for all the other input. i'll try to remember some points for future talks. especially yours @Jonathan Lahijani @DaveP thanks for that example. totally valid points too. especially for us as developers. but think of that in context of my first quote. that may create the total opposite message in your clients head: ah, this guy is a nerd. he speaks a language i don't understand and talks about things most other website owners obviously don't care about...1 point
-
As I tried to tell you above ProcessWire cannot know how to handle pagination pages, where the selector returns an empty set. Pagination isn't more than just limiting the returned set of pages. PW cannot guess what else you're doing on that page, or if maybe this empty set will be modified later. Blindly throwing 404 errors would make this system greatly more inflexible. You can always handle those things on your own just like you need it. To iterate on your 404 problem: 404 errors do always respond directly on the requested url, no matter where in pw. Only the status-code will change to 404.1 point
-
The following solution seems to work for me. I'm not sure what downfalls there may be to my approach, if any; I'm not an htaccess or regex expert. My solution is a mix of htaccess (a solution raydale touched upon) and one of Ryan's suggested options (downloading through a passthrough PHP script/PW template). Firstly, the htaccess file that I manually placed into the protected page's file directory. (Example: placed into mydomain/site/assets/files/1072) IndexIgnore * Options +FollowSymlinks RewriteEngine On RewriteCond %{REQUEST_URI} ^/site/assets/files/(.*)/(.*)$ RewriteRule (.*) http://www.mydomain.com/file-download/?page=%1&file=%2 [L] Any requests for any file in that directory get redirected to my passthrough page. (A hidden PW page using the following template.) <?php // Get page that owns the file if(!$input->get->page) throw new Wire404Exception(); $page = $pages->get((int) $input->get->page); if(!$page->id) throw new Wire404Exception(); if ($page->viewable()) { // Visitor has access to the page // Build file's URL $filePath = $config->paths->files.$page.'/'.$_GET['file']; // Force download of the file header("Content-type: application/force-download"); header("Content-Transfer-Encoding: Binary"); header("Content-disposition: attachment; filename=\"".$_GET['file']."\""); readfile($filePath); } else { // Visitor does not have access to the page $redirectURL = $pages->get("/login/")->httpUrl; /** * Or alternatively, redirect to Processwire's login page if you don't have a custom login page * $redirectURL = substr($pages->get('/')->httpUrl, 0, -1).$config->urls->admin; */ $session->redirect($redirectURL, false); } ?> The template checks to see if the page is viewable to the site visitor. If so, it forces the download of the file. If the user does not have page view access, it forwards them to a login page. It seems to work really well for me. Thoughts? Does anyone see any downfalls? At some point, the creation of the htaccess file can be automated based on the template's access settings. (One standing, though non-critical, question I have is, why does $config->urls->root always return a forward slash for me?)1 point