Leaderboard
Popular Content
Showing content with the highest reputation on 04/03/2021 in all areas
-
This week ProcessWire gained the ability to maintain separate read-only and read-write database connections to optimize scalability, cost and performance. The post covers why this can be so valuable and how to configure it in ProcessWire— https://processwire.com/blog/posts/pw-3.0.175/13 points
-
Funding Processwire, Here are my thoughts, I think it could be a really good cash cow for many people, but only if they focus on something so many people out there want. Mind you I am not a developer, but an end user who needs developers to build stuff for me. Two of my sites are: www.rugpijnweg.nl and www.backpaingoodbye.com both made by people here on the forum. For me, like many others, my sites have to make me money. Therefore speed is important, hence I use procache on all my sites. Building blocks are important for easy building of pages that generate the action I need. Backpaingoodbye is good with that, all repeatermatric things in there. What I love about processwire is the speed and that anything can be built. The last part is also the problem, if I want something new, it has to be built. What I think processwire needs is something like www.thrivethemes.com, which is a separate company with an offering on top of wordpress, like there are more, but I particularly like many of the things they are making. What I hate about my sites with processwire, is that if I have some changes added to a site of mine, it just is a stupid nightmare to port new stuff to other sites that use the same profile. I guess rockmigrations would be great for that, but there you go, I need a developer to run things again, and I now have 4 sites running the same profile. For that reason I am now even considering moving over to wordpress, I got me a subscription to thrivethemes, but I HATE wordpress with a vengeance... all these stupid updates all the time. Thrivethemes itself is buggy and does not make sense, it produces slow sites, but hey I can get a lot of functionality. The underlying problem with processwire and its funding is that it is IMHO too much tech oriented, brilliant minds who build incredible things, but the huge market out there is just forgotten, and wordpress gobbles it up. And then people build stuff on top of wordpress and make a very good living. So here's what I believe would work: - get a group of people together and decide on & build a basic site structure that has all the fields anyone needs, with upgrade paths in place should the structure be extended - on top of this site structure build a storehouse of repeateable blocks with a page builder like thrive themes is using, but then better, more processwire like - then have the designers go crazy on developing a number of front end variations that change the look and feel of the whole site, just by pointing the whole show to a different css file - have some developers working on creating more building blocks focused on different niches, par example the coaching business would require agenda booking, same for hairdresser salons. - this way it would be possible to offer niche specific sites, including hosting I have ideas how this could work, and would like to hear if people are interested to develop these ideas further Let me know3 points
-
Great update - working with access control got a lot easier today ?? Access Control ProcessWire has a powerful access control system. When using RM to create new templates and pages it is quite likely that you also want to create roles and define access for those roles on the new templates. The basics of access control can easily be done via RM - for more advanced topics you might need to implement custom solutions. PRs welcome ? Let's say we created an Events calender and we wanted to store all events (tpl event) under one page in the page tree. This page (tpl events) would only allow pages of type event. To manage those events we create a new role on the system called events-manager. $rm->migrate([ 'templates' => [ 'events' => [...], 'event' => [...], ], 'roles' => [ 'events-manager' => [ 'permissions' => ['page-view', 'page-edit'], 'access' => [ 'events' => ['view', 'edit', 'add'], 'event' => ['view', 'edit', 'create'], ], ], ], ]); On more complex setups you can use the API functions that are used under the hood directly. For example sometimes I'm encapsulating parts of the migrations into separate methods to split complexity and keep things that belong together together: /** * Migrate all data-pages * @return void */ public function migrateDatapages() { $rm = $this->rm(); // migrate products (having two custom page classes) // these have their own migrations inside their classes' migrate() method // where we create fields and the template that the class uses $product = new Product(); $product->migrate(); $products = new Products(); $products->migrate(); $rm->setParentChild(Products::tpl, Product::tpl); $rm->setTemplateAccess(Products::tpl, self::role, ["view", "edit", "add"]); $rm->setTemplateAccess(Product::tpl, self::role, ["view", "edit", "create"]); // same goes for all other data pages // ... }2 points
-
I have to disagree with this, to an extent. If I did client projects of my own I'd very much appreciate the option of off-loading the hosting and day-to-day maintenance of said sites to someone else. Sure, most of the time a "general purpose" hosting plan is good enough and ProcessWire is great in that it has very rarely really "required" updates, but I could imagine a plan dedicated to ProcessWire providing some extra services that a general purpose one won't and can't ? At the same time I don't really see why this wouldn't work for business clients as well. We host the sites we build in-house, and I can say that a lot of time and effort has gone to tweaking that setup, and maintaining the platform and the sites on it is an ongoing process. If hosting wasn't an important part of what we do, or we weren't quite as familiar with the inner workings of ProcessWire, it would make plenty of sense to subcontract that service from someone who actually specializes in it. Many companies that work on other platforms, such as WordPress, choose external hosting — not because they can't do the hosting, but rather because it's not their core business. There are also numerous "developer oriented" hosting platforms out there.2 points
-
I've tried, but so far have been unable to reproduce this. Any additional pointers would be welcome ? Glad to hear you got it solved. Just for the record, with latest release 0.29.6 $query->results is also available. It's otherwise the same as getResults(), but adds additional check in case there were no results (in which case it will return null instead). I believe my initial idea was to avoid multiple ways to access the same data, but this is more in line with other features ?2 points
-
My wife loves to cook, and I always like to further my knowledge around Processwire. So I thought I'll build a small page with the some small function to learn something. Used modules: ProMailer RepeaterMatrix Pages2PDF AIOM and some other litte modules Current functions: JSON-LD for recipes and page search Automatic ingredient calculation when changing the number of servings Creation of a PDF of the recipe Basic PWA (here is something to do, actually) Planned functions: a lot ? Site: https://www.dothiscookingthing.de1 point
-
Since most Operating systems support unicode file names, I'm wondering why PW still sanitizes (image) filenames to [-_.a-z0-9] characters only. I've used @adrian's Custom Upload Names module before to change file names, but it still depends on @ryan's core Pagefiles->cleanBasename, which strips out all non ascii characters. HDPI images are often named "image@2x.jpg" and from a copyright perspective "image©2019-company.jpg" would be far more practical (obvious) than hidden exim data. Something like "image-ab&cd.jpg" or "image(v2).jpg" isn't a weird thing either. Linux, Windows and MacOS can all handle this kind of file names, and offcourse modern browsers too. Is there any particular reason why this couldn't be implemented as a default in PW?1 point
-
@Ivan Gretsky - glad you got the issue with the other module sorted out. Regarding the edit permissions for all allowed branches, I completely agree that this should be how it works. Even without Teppo's add-on module I think ARB should probably support this because there is the option to only restrict editing rights but still show all branches so this could be a nice enhancement. Can't promise a delivery timeframe for it but I'll do my best.1 point
-
@adrian, @teppo, thanks to both of you. I think I spotted the problem. There is the Page Edit Per User module installed on the same project that causes errors in some cases. I manages to get Admin Restrict Branch Select to work. But I now face another less mysterious problem with frontend editing. It is available only for the branch that is currently selected. So when I switch from Branch A to Branch B in admin, Branch A is no longer editable on the frontend. It must be the way the module is intended to work. But is there a way to make the Page List in admin show only the currently selected branch, but keep the edit permissions to all of the selected branches? I think that even seems to be more expected from the user point of view, so maybe a might be a good improvement for the module)))1 point
-
1 point
-
This sounds very exciting! I know someone who has already put thousands of hours into modules and techniques that could serve such a scenario very well... ?1 point
-
I've created an issue in the requests repo - please give it a thumb up to show demand for such a feature! https://github.com/processwire/processwire-requests/issues/3961 point
-
Have you tried this: $regionEvents = $pages->find("template=veranstaltung,selectLocation.parent.parent=$reg,limit=$limit"); If this doesn't work, a subselector might be the tool of choice: $regionEvents = $pages->find("template=veranstaltung,selectLocation=[template=location,has_parent=$reg],limit=$limit");1 point
-
I'd be happy to be wrong with my opinion here ? I've put a lot of effort in setting up my infrastructure and it looks like finally I've found a good combination of all the puzzle pieces playing well together (Hosting+Server administration, GIT for version control, RockMigrations for Migrations, RockShell for all the maintanance and installation stuff to spin up a new pw instance, create db dumps and restores etc.). I just have the feeling that 90% are happy with the usual workflow: develop locally or directly on the server (I've done that myself for years) and then simply copy files over. That's something that any regular hosting provider supports... and my feeling is 80% of the remaining 10% are happy managing it on their own. If I'm wrong and anybody is looking for processwire hosting in DACH write me a PM ?1 point
-
Crazy stuff - I hope I'll need this feature one day ?1 point
-
I'm not sure who would really pay for such a service. Most of PW users are tech-savvy, so I guess they WANT to have the control over their infrastructure (or choose any of the cheap hosting providers out there...). Installing PW is no problem for them. On the other hand people that dont want to handle any technical aspects (like hosting or installing PW) are likely more happy with one of the plug&play CMSs?!1 point
-
$query = $modules->get('SearchEngine')->find($input->get->q); Is it possible to get a PageArray from this? So i can render my own markup... I know i can use "search_index%=q" to find pages, but i would like to take advantage of the module settings, so dont have to hardcode the operator... I'm trying: $results = $query->results; I get "Method Query::get does not exist or is not callable in this context" When i try "renderResults()" method, it works as expected. Never mind, solved it after looking into Query class. $results = $query->getResults();1 point
-
In the meantime you can go using this: https://www.uniformserver.com/ it has worked wonderfully for me1 point
-
@Ivan Gretsky - sorry for the trouble - could you please debug which of these conditions (https://github.com/adrianbj/AdminRestrictBranch/blob/4964a3f5b83338f7313f7c6daeefe6c6793640b0/AdminRestrictBranch.module.php#L228) is resulting in the error message? And if it's the last one, then figure out where in this method: https://github.com/adrianbj/AdminRestrictBranch/blob/4964a3f5b83338f7313f7c6daeefe6c6793640b0/AdminRestrictBranch.module.php#L236 or in this hook (https://github.com/teppokoivula/AdminRestrictBranchSelect/blob/3ac88e7f4da482a5a16dad1abe3f221fdaeb2742/AdminRestrictBranchSelect.module.php#L54) in @teppo's module it's returning "1", rather than one of the allowed branch parents? BTW - are you having the same issue with ARB without this addon module?1 point
-
I would go this way, without invoking ready.php or other resources: <div class="grid"> <?php foreach($page->grid_ext as $item): ?> <div id="pteg_<?= $item->id ?>"> <?php // specify the template viewfilename like this, if it is a single viewfile: $viewFilename = $wire('config')->paths->templates . 'blocks/myblockviewfile.php'; // or if you have different files get them from template properties: $viewFilename = $item->template->altFilename ? $item->template->altFilename : $item->template->name; $viewFilename = $wire('config')->paths->templates . 'blocks/' . $viewFilename . '.' . $wire('config')->templateExtension; // check if viewfile is available if(!is_readable($viewFilename)) { echo logSectionError('Missing Template-View-File!', '<strong>' . basename($viewFilename) . '</strong>'); continue; } // now pack a bag with all needed variables for the block render template file: $viewBag = []; $viewBag['item'] = $item; $viewBag['page'] = $item; // if you use the $page var in your template file, pass here the current item-page to it ! $viewBag['pages'] = $pages; // optionally if you need other vars, add them here $viewBag['config'] = $config; // " // and render the block echo "\n " . wireRenderFile($viewFilename, $viewBag); ?> </div> <?php endforeach; ?> </div> https://processwire.com/api/ref/functions/wire-render-file/1 point
-
I mean, you could do something like this: //in site/ready.php $this->addHook("Page::renderBlock", function($event) { $page = $event->object; if ($page->template->altFilename) $blockPath = $page->template->altFilename; else $blockPath = $page->template->name; $blockPath = "blocks/{$blockPath}.{$this->wire('config')->templateExtension}"; $event->return = $page->render($blockPath, $event->arguments(0)); }); Now you can call $page->renderBlock() or $page->renderBlock(['this' => 'that']) and the block’s template path will be determined automatically according to the template settings. Or this, maybe: $this->addHook("Page::renderBlock", function($event) { $page = $event->object; $templatePath = $this->wire('config')->paths->templates; $templatePath = substr_replace($page->template->filename, 'blocks/', strlen($templatePath), 0); $event->return = $page->render($templatePath, $event->arguments(0)); });1 point
-
In the past I've worked with a few translation platforms (Launchpad, Twitter translation center, translate.wordpress.org, etc. — there are plenty of good examples) and one of the projects on my "things I want to do as soon as I find the time" list is a similar platform for ProcessWire. The way I envision this working would be a shared service (website, essentially) where translators can register and do pretty much the same thing they would do in the translations screen in Admin, and then share those projects with others who can both use them and contribute (obviously after an approval process). This would likely be split into "projects" (core, individual core or third party modules, site profiles, etc.) For the site you'd still need a module to install these translations, but the main concept here is a common library of translation files that would do most of the heavy lifting and provide an API for the module. I've been struggling a lot trying to keep up with who manages which translation for what language and where and how (and which version is the recommended, when there are many competing translations), and that's really the biggest thing I'd like to solve with this. In a multi-language environment I feel that this is almost a must-have feature in the long term... and, should it gain some momentum, I could really see that being a valuable addition to our "official site bundle" (translate.processwire.com or something along those lines), though obviously that part depends on how Ryan sees this ? Anyway, just wanted to let you know that you're not along with this need. The problem for me is that I've got a pretty good idea of what I need to do, but I still need the time to do that. I hope to find just that (unless someone nails something similar down first, that is) in a few months, but that's not a certainty yet ?1 point
-
This code that I just wrote might help: // Lets clone the "mallitoimipiste" that has all the required pages $fc = $this->pages->clone($model); $fc->title = $this->input->post->name; $fc->name = $name; $fc->location->address = $this->input->post->address; $fc->removeStatus(Page::statusLocked); $fc->save(); // create role for this fitness-center $fcrole = $this->roles->add("fitness-center-" . $name); $fcrole->addPermission("page-view"); $fcrole->addPermission("page-edit"); $fcrole->addPermission("page-sort"); $fcrole->addPermission("profile-edit"); $fcrole->save(); // add template permissions for the new role in fitness-center template $fctemplate = $this->templates->get("fitness-center"); $addRoles = $fctemplate->get("addRoles"); $addRoles[] =$fcrole->id; $editRoles = $fctemplate->get("editRoles"); $editRoles[] =$fcrole->id; $createRoles = $fctemplate->get("createRoles"); $createRoles[] =$fcrole->id; $fctemplate->roles->add($fcrole); $fctemplate->set("addRoles", $addRoles); $fctemplate->set("editRoles", $editRoles); $fctemplate->set("createRoles", $createRoles); $fctemplate->save(); // add the current role as a edit_role for the page $fc->edit_roles->add($fcrole); $fc->save(); Not sure if that set("createRoles", $createRoles) is even required, probably works with ->add just like "roles" does.1 point
-
I was thinking about this alot in the past since translations are in PW. I can't remember if it was discussed already, I think only little. That's a valid question or concern I think we should have to recommendations for 3rd-party modules. I don't think it's tedious, just a question of how you handle it. Translations in core was added not so long a go and was a sponsored by Antii's company (?) feature Ryan added. It's s very well implemented but in some areas still a little rough (no offend Ryan). It works all well and even resulted having language text fields (adds inputfield for each language automaticly) and even possible to have alternate language fields (fieldname_de,fieldname_en) which is awesome. Creating language packs is hard work, but it's always possible to extend some things or create helpers int he future (did one recently created one here for Radek http://processwire.com/talk/topic/2540-czech-localization-textdomainhelpermodule/). Adding languages is easy but I still am not happy with the interface where the json files are stored. Hard to get an overview and deleting all is cumbersome (70+ files) manually. But the system is there and it's maybe only a matter of building a more advanced manager for the files, which shouldn't bee too difficult. Just takes some time. We are still not even a year into PW added translation and people are now slowly coming in and start to point out issues cause they're using it. So thanks for everyone sharing he's thought to show there's some need. I know Ryan doesn't use multilanguage feature and most western don't. We in Switzerland have the opposite, 90% of the sites have at least 3-4 languages. Mostly we do the front-end translation using yaml or php vars to have translatable strings at it doesn't have to be done with PW. Also, rarely we use modules that then would need translation for end users and most of the time the editors are one-languaged group of people. So haven't really come to using it that features much apart from the core admin. Some things may could be considered as mandatory for modules added to repository: All 3rdparty module should have it's text strings translateable. (some module were built before core translation, like Thumbnails) All 3rdparty module should have some folder for translation to be added. So other's translating it can add the json file.1 point