Jump to content

AndZyk

Members
  • Posts

    600
  • Joined

  • Last visited

  • Days Won

    7

Everything posted by AndZyk

  1. The fieldtype repeater module is a core module and located under https://github.com/processwire/processwire/tree/master/wire/modules/Fieldtype/FieldtypeRepeater It should not be in the site/modules folder, you can just install it under Modules => Core.
  2. ProcessWire uses still a limited subset of Font Awesome 4 for the back-end. One solution could be to upgrade to Font Awesome 6 with 2000 icons in the free version: https://fontawesome.com/search?o=r&m=free Of course the Feather and Material icons are also beautiful.
  3. I can recommend the VSCode extension "Project Manager": https://marketplace.visualstudio.com/items?itemName=alefragnani.project-manager I have every project as own workspace with all root folders (site and wire) included and can easily switch with the project manager. The wire folder is excluded for opening files via the command palette. This way Intelephense knows everything, but I don't get suggested files in the wire folder. ๐Ÿ˜‰
  4. Hey @bernhard, I have not tested @Jan Romero solution, but it seems like a nice solution for this feature. ๐Ÿ‘ The only thing that could be changed is to use an own CSS class name for the download icon, so it would be cleaner. Also I am still unsure, wether this feature is so important for everyone, that it has to be next to the trash icon. But that is something @ryan has to decide. Regards, Andreas
  5. The code before was just a wild guess. But I have now tried it and it could work like this: // Add the download label to $this->labels // Somewhere at the beginning of ___renderButtons() $downloadUrl = $pagefile->url; // In ___renderButtons() for example after variations // Download $buttonText = "<i class='fa fa-download'></i> $labels[download]"; $buttonText = str_replace('{out}', $buttonText, $this->themeSettings['buttonText']); $out .= "<a class='$buttonClass' href='$downloadUrl' download>$buttonText</a>"; Here is a screenshot: If you make it to a link styled like a button and add the download attribute, there is no need to open a modal and it would download the file with just one click.
  6. Just my proposition, but maybe this option would be better located under the image edit buttons: https://github.com/processwire/processwire/blob/3acd7709c1cfc1817579db00c2f608235bdfb1e7/wire/modules/Inputfield/InputfieldImage/InputfieldImage.module#L767 Because it is not a common option for everyone and the risk would be, that you download the file by accident if it is a button inside the image. Also you wouldn't have to change the SCSS file. It would be just something like: // Download $buttonText = "<i class='fa fa-download'></i> $labels[download]"; $buttonText = str_replace('{out}', $buttonText, $this->themeSettings['buttonText']); $out .= "<button type='button' data-href='$downloadUrl' data-buttons='button'>$buttonText</button>";
  7. I know that this is not the answer you are looking for, but at least on macOS I always open the image with the lightbox and then drag&drop the image on my desktop. That is not as convenient as a download icon, but three clicks less than Right click => Save image as.. => Select folder => Save ๐Ÿ˜‰
  8. Awesome site, great job. ๐Ÿ‘
  9. Hello @Roel, here is a tutorial how to upgrade ProcessWire: https://processwire.com/docs/start/install/upgrade/ For upgrading ProcessWire and modules I would recommend the module ProcessWire Upgrade: https://processwire.com/modules/process-wire-upgrade/ Regards, Andreas
  10. I am not sure, if this module works for exporting users as CSV. You could write your own CSV export script, like also mentioned in the thread posted above: Just write the code at the beginning of your template: <?php header('Content-Type: text/csv'); header('Content-Disposition: attachment; filename="blog-posts.csv"'); $items = $pages->find("template=blog-post"); echo "title,url" . PHP_EOL; // Add more fields here foreach($items as $item) { echo "\"$item->title\",\"$item->url\"" . PHP_EOL; // Add more fields here } return $this->halt(); For users this script could look like this: <?php header('Content-Type: text/csv'); header('Content-Disposition: attachment; filename="users.csv"'); $items = $pages->find("template=user, include=all"); echo "name,url,email,password" . PHP_EOL; foreach($items as $item) { echo "\"$item->name\",\"$item->url\",\"$item->email\",\"$item->pass\"" . PHP_EOL; } return $this->halt(); But the user password is stored encrypted, so I don't think that this would help you much. Or don't switch to WordPress. ? Regards, Andreas
  11. Hello @nicolant, maybe you could try this module mentioned here: But I would always store HTML, CSS and JS files in the templates directory. ? Regards, Andreas
  12. @sladedesign You mean the module BatchChildEditor? I don't have much experience with this module but you can enable the Export CSV mode under Mode Settings in the module configuration. There you can also configure the CSV export settings. Then you have to set where the editing tools are available and you can see them under the children tab of those pages. There you can export the children of the page as CSV. Do you want to export your blog posts from ProcessWire as CSV to import them into a WordPress website? Or what is it you want to achieve?
  13. Thank you for your explanation. In this case maybe a multi-instance or multi-site would be better: https://processwire.com/docs/more/multi-site-support/ I don't think it is possible to have two different home pages with one installation that easy. ?
  14. Hello @Manaus, it should be possible to create new pages without a template file. Does this template or the parent template some special restrictions under the Family settings? Regards, Andreas
  15. Thank you for explanation. This is working for me: <?php if ($input->urlSegment1) { $userID = $sanitizer->int($input->urlSegment1()); $u = $users->get($userID); if ($u->id) { if ($u->hasRole("login-register")) { echo $u->name; echo $u->email; } else { wire404(); } } else { wire404(); } } If you always get a 404 error, then maybe your ctype_digit check fails. Regards, Andreas
  16. Hello @Liam88, do you mean the free Login Register module or the commercial Login Register Pro module? I have no experience with the commercial module but I think neither require URL segments. You either just let the module do its default behavior: <?= $modules->get('LoginRegister')->execute() ?> Or you customize it: <?php if($user->isLoggedin() && !$input->get('profile') && !$input->get('logout')) { // you take over and render your own output or redirect elsewhere $session->redirect('/some/other/page/'); } else { // let the LoginRegister module have control echo $modules->get('LoginRegister')->execute(); } Source Regards, Andreas
  17. Hello @ZAP, this may not be the answer you are looking for, but I would really consider your approach in making a website available for multiple domains. For search engines that could be considered duplicate content and for users it could be annoying, because f.e. they would have to approve the cookie consent again. I would recommend you to figure out what the default language and domain of your website should be (English or Portuguese) and then redirect the other domain to the language of the default domain (portuguese.org to english.org/pt/). The default language (in this case english.org) doesn't require a language URL (/en/). If you look at major companies like f.e. Apple, Adobe, Microsoft or Amazon that is how they handle it. If you really want to do this, you could look at this solution: Regards, Andreas
  18. If you just want to delete all WebP files you also could do this via the command line in your site/assets/files: find . -name "*.webp" -type f -delete Source But only if you don't have WebP files manually uploaded in your file fields, so be careful. The module posted above is more safe I think. ? There was also a receipe by Ryan a while ago, but I cannot find it.
  19. In ProcessWire everything is a page. There is no separation between pages and posts like in WordPress. So yes, the solutions in this thread should work too. ?
  20. Hello @slatedesign, for CSV have a look at this topic: As for XML I don't know why you would need this. Regards, Andreas
  21. Hello @Martinus, maybe findRaw() could simplify your solution: $a = $pages->findRaw("parent=/products/, seller=amazon, rating>0", "rating"); print_r ($a); // check array echo array_sum($a); // sum of all values in array Regards, Andreas
  22. I was referring to the selector string options of a page field under the input tab. If your case is more complicated than that, sorry I don't think I can help you. ?
  23. Hello @MarkE, I think you need to add "include=all" or "check_access=0" to the selector of your select options field for other user roles: https://processwire.com/docs/selectors/#access_control $pages->find("template=repeater_field, include=all"); Because as you already mentioned repeater pages are children of the Admin tree which other user roles cannot find. Regards, Andreas
  24. I couldn't find anything in the documentation, but in the core file it seems that comments starting with <!--# don't get stripped out: https://github.com/processwire/processwire/blob/3acd7709c1cfc1817579db00c2f608235bdfb1e7/wire/core/WireMarkupRegions.php#L844 <!--# Comment --> I tried it and it seems to work. Regards, Andreas
  25. Hello @kaz, the errors.txt should be recreated on the next fatal error. As for restoring the previous errors.txt you should look if your webhoster or local machine has a backup for this file. I hope that helps you. Regards, Andreas
ร—
ร—
  • Create New...