Leaderboard
Popular Content
Showing content with the highest reputation on 09/09/2024 in all areas
-
This is a demo of how to use the new trash feature 😍 And this is a demo of how to create a quite complex custom recurring schedule: I think this should already be quite usable!4 points
-
Good day Wire-cli users! I am here to say thanks to @flydevfor his recent small but game-changing fix. This now allows to automate PW installation via script more easily. And you don't have to have Wire-cli installed globally. # clone the repo git clone https://github.com/wirecli/wire-cli.git # update vendors composer update -d wire-cli/ # check if the tool is working php wire-cli/wirecli -V # install PW php wire-cli/wirecli new --force [...other options here] @Jonathan Lahijani, I remember you were interested in this.2 points
-
I am moving the site from one web hosting service to another. I have full access via cPanel. The duplicator log indicates that everything was normal: 2024-09-08 18:18:31: - job finished in 372.169112sec 2024-09-08 18:18:31: - package saved in local folder: 2024-09-08_18-12-25-{........}.co.uk.package2.zip 2024-09-08 18:18:31: - package built successfully in 372.167747sec 2024-09-08 18:12:19: - Backup using standard mode 2024-09-08 18:12:19: Backup Database The built package was not openable in windows (including by 7zip) so it seems the fault is in the package not the installation. I tried that - just including wire. No package was built. That didn't fix my problem. Interestingly, the package was twice as big. I think that the problem may be due to the source installation being multi-site. There are two sites - site-ncog and site-music. I only want to duplicate and move site-ncog. There is no /site/ folder. The duplicator doesn't seem to cater explicitly for this (I thought it might duplicate both sites and then I would need to remove one). I see that Duplicator.module has const DUP_SITE_FOLDER = 'site'; I tried changing that to site-ncog, but no package was built. I have a dev site that just has the one site (in a folder called /site/). I haven't tested it fully, but the package was built and was readable in Windows. So one option might be to fully replicate the live site on my dev environment and then duplicate that. This would have some complications with file names, which might be resolvable by renaming /site/ to /site-ncog/ after the duplication.2 points
-
quite biased message Just my two cent's here. I tend to say - yes - just because I see third-party app/websites as a nice showcase on how pw can handle things and how versatile it is. I must admit that on my side I am using pw as second choice for a simple reason, I write websites in pascal (I can remember @LostKobrakai switching to Elixir). But, it's only depending on client needs and profile, and maintainablity. If a client absolutly require a setup based on php to be used with a standard web hosting, then pw come back as the first choice with no doubt. This piece of software is solid and deserve to power thoses tools made for processwire. I would have felt disappointed if weekly.pw was made as static website or worst, on wordpress, imagine. The real decison maker is I think, money. Domain names are more expensives then ever. About hosting, there is a lot of solid companies providing such web hosting, generaly you got 100MB free for ever on OVH or Alwaysdata (the second provide ssh access). For the domains fee's, the community could make some donations. It could be made using built-in page json feature with or without inertiajs and consumed from AstroJS, keeping ci github flow without any problem to let the community collaborte on it. You will won the right to add on the footer "powered by processwire" 🫡😄2 points
-
The RockFrontend site profile for ProcessWire offers a unique combination of benefits by integrating UIKit and TailwindCSS, making it an appealing choice for developers looking for both robust UI components and extensive customization capabilities. Here are some key advantages: Rich UI Components from UIKit UIKit is known for its comprehensive collection of high-quality, ready-to-use UI components. This integration in the RockFrontend site profile allows developers to quickly implement complex components like modals, accordions, and sliders that are visually appealing and functionally robust. Flexibility and Customization with TailwindCSS TailwindCSS is a utility-first CSS framework that provides high granularity in styling elements. It allows developers to build custom designs without stepping out of the framework’s constraints. This can significantly speed up the development process, as it eliminates the need to write custom CSS from scratch. Setup Setup is as simple as these 3 steps: Download the profile Install ProcessWire and choose this profile Follow the instructions on the welcome screen Github: https://github.com/baumrock/site-rockfrontend Modules Directory: https://processwire.com/modules/site-rock-frontend/1 point
-
Cool, thx 🙂 Thx a lot. Always appreciated! Actually it's the other way round. I think I can just remove the warning 😄1 point
-
This looks truly great and I can easily see myself using it in several client projects! Great work 🙂 One note on the last video (pretty sure you already thought of this but hey): if there is a need for a first save before being able to create copies, maybe hide the options?1 point
-
Great write up gebeer! Very nice looking pdfs. I would also be interested to see how the mega menu was created on that site.1 point
-
Just a small note, if wirecli is installed globally, then to update it to the latest version, just type: composer global update wirecli/wire-cli1 point
-
Mostly 5 stars on Softaculous, but spot the error in the overview: "ProcessWire is a free PHP5 content management system and framework (open source CMS/CMF) built to save you time and work the way you do." Probably that 'PHP5' doesn't encourage people. Plus it could do with a whole load more reviews - I only spotted @FireWire (the only review since 2019) and @applab (2018). I've submitted a review (and 5* rating) which I hope will be up soon. I don't know how the overview etc. gets fixed.1 point
-
You can use the WireDatabasePDO class 🙂 https://processwire.com/api/ref/wire-database-p-d-o/1 point
-
@flydev I've played with ZipArchive recently and had some issues when unzipping on Linux (but not on Windows with 7zip), because I forgot to exit() PHP script after outputting headers and zip file. So I know a zip file can be opened on some software and not on other if it contains a problem. For the @MarkE issue, I'm wondering if it could come from the 2 lines in Duplicator.module where you update the zip archive without providing a flag in $zip->open()? Line 566 : if ($zip->open($pwbackup['zipfile']) !== true) { Line 939 : if ($zip->open($zipfile) !== true) { I don't really believe this solution, but I've seen a lot of posts like that when searching for my own issue: https://stackoverflow.com/a/179750091 point
-
Exactly. That's one of the advantages of this concept 🙂 The UI is the tricky part... Yeah a draft is already there 🙂 But there is more to it to cover all options. That's the next part to tackle 🤞1 point
-
Good question, @wbmnfktr! When I came to PW from Joomla! that had an extension for everything including ecommerce and forums, I was kind of expecting PW to be the same. And I was waiting for a good shop and forum to be developed (by someone but me)) But time passes. I am not so idealistic now. I use ProcessWire for sites and some apps. I use other tools for online shops. I do not use nothing for forums as nobody I do stuff for really needs them. For a documentation site I would use VitePress, Docusaurus or MkDocs as they allow a more easy collaboration via github or such. Ryan doesn't use PW as a forum engine or to sell modules. But he does for the docs. But maybe he shouldn't so the community could participate @teppo uses PW for weekly.pw and wireframe site. I like the former and would argue about the latter for the same reasons. @kongondo uses PW for his site but VitePress for the docs. He is using PW and his own Padloper to sell stuff (he should!). @bernhard seem to do everything in PW with some of his numerous modules. Are forum and ecommerce coming?)) I would say that for the recipes the current collaborative approach is quite good. And it better be ready on Astro or you-name-it SSG than be in development in PW. But! I really love to see passionate people push the limits of possible with the tools of their choice. And would love to see recipes still in github to collaborate on, but wisely imported to PW. Especially if there is any additional value in that like more advanced filtering, interlinking or a form for less technical people to commit recipes. P.S. Frankly, I would go the easy way and stay on whatever tool is already in place. PW is great for some sort of things, but not for all.1 point
-
1 point
-
Page::__construct() takes a Template object as an argument: /** * Create a new page in memory. * * @param Template $tpl Template object this page should use. * */ public function __construct(Template $tpl = null) { if(!is_null($tpl)) { $tpl->wire($this); $this->template = $tpl; } $this->useFuel(false); // prevent fuel from being in local scope $this->parentPrevious = null; $this->templatePrevious = null; $this->statusPrevious = null; } So I think the constructor in your child class should be: public function __construct(Template $tpl = null) { parent::__construct($tpl); $this->header = 'some text'; }1 point
-
Hi @Tyssen. for($i = 0; $i < 5; $i++): $randomPage = $pages->find("your selector here")->findRandom(1); foreach($randomPage->repeater_field->getRandom(3) as $item) : Output endforeach; endfor; Hope this helps.1 point
-
Here are links for a few different approaches to the general question: https://github.com/LostKobrakai/Paginator https://gist.github.com/somatonic/5420536 https://processwire.com/talk/topic/5558-adding-pagination-after-merging-two-pagearrays/?do=findComment&comment=54122 And my own suggestion: // Find all the matches, but only find the IDs to reduce memory overhead $matchest = $pages->findIDs("title~=$q, template=BN-article|BN-infopage"); $matchest_str = implode('|', $matchest); $matchesb = $pages->findIDs("body~=$q, template=BN-article|BN-infopage, id!=$matchest_str"); $match_ids = array_merge($matchest, $matchesb); // Define some pagination settings $items_per_page = 10; $start = ($input->pageNum - 1) * $items_per_page; $total = count($match_ids); // Get the IDs for this page of the pagination $item_ids = array_slice($match_ids, $start, $items_per_page); // Get the pages using the IDs $items = $pages->getById($item_ids); // Apply the pagination settings to the pager $items->setTotal($total); $items->setLimit($items_per_page); $items->setStart($start); // Output the items as needed foreach($items as $item) { echo "{$item->title}<br>"; } // Output the pager echo $items->renderPager();1 point
-
In the module info for a Process module you can include settings that automatically create a page under Admin: // page that you want created to execute this module 'page' => array( 'name' => 'helloworld', 'parent' => 'setup', 'title' => 'Hello World' ), Is there an easy way to make this created page hidden so it doesn't appear in the admin menus? Or if I need a hidden page would I have to create/remove the page in the install()/uninstall() methods? Edit: should have guessed it would be so easy... // page that you want created to execute this module 'page' => array( 'name' => 'helloworld', 'parent' => 'setup', 'title' => 'Hello World', 'status' => 'hidden', ),1 point
-
I sometimes end up with orphaned files as a result of doing mass imports during development. My code won't be quite right the first time around and I'll end up with extra and/or duplicated files. At least that was the case this last week. It was on a pretty large scale, so not something I wanted to clean up manually. Here's how I cleaned them out. Place this in a file in your site root called clean-files.php and then load it in your browser. /clean-files.php <pre><?php ini_set('max_execution_time', 60*5); // 5 minutes, increase as needed include("./index.php"); $dir = new DirectoryIterator(wire('config')->paths->files); foreach($dir as $file) { if($file->isDot() || !$file->isDir()) continue; $id = $file->getFilename(); if(!ctype_digit("$id")) continue; $page = wire('pages')->get((int) $id); if(!$page->id) { echo "Orphaned directory: " . wire('config')->urls->files . "$id/" . $file->getBasename() . "\n"; continue; } // determine which files are valid for the page $valid = array(); foreach($page->template->fieldgroup as $field) { if($field->type instanceof FieldtypeFile) { foreach($page->get($field->name) as $file) { $valid[] = $file->basename; if($field->type instanceof FieldtypeImage) { foreach($file->getVariations() as $f) { $valid[] = $f->basename; } } } } } // now find all the files present on the page // identify those that are not part of our $valid array $d = new DirectoryIterator($page->filesManager->path); foreach($d as $f) { if($f->isDot() || !$f->isFile()) continue; if(!in_array($f->getFilename(), $valid)) { echo "Orphaned file: " . wire('config')->urls->files . "$id/" . $f->getBasename() . "\n"; // unlink($f->getPathname()); } } wire('pages')->uncache($page); // just in case we need the memory } When you can confirm that it has found the right files (and no false positives) uncomment the "unlink" line above to have it remove the files on the next run.1 point