Jump to content

AndZyk

Members
  • Posts

    713
  • Joined

  • Days Won

    10

Everything posted by AndZyk

  1. Hello @joe_g, I would use a $session variable for storing the user language. $session->set("userLanguage", $user->language); You could then perform a session redirect: if ($session->get("userLanguage") && $user->language->name === "default") { $session->redirect($page->localUrl($session->get("userLanguage"))); } I have not tested this but think it should work. ? Regards, Andreas
  2. ProcessWire also offers build in export and import functions for templates, fields and pages. ?
  3. I was thinking about this argument and this is something I also wish that could be improved. There doesn't seem to be a roadmap anymore. The current roadmap is from 2019: https://processwire.com/about/roadmap/ I think it would be nice to revive the roadmap or at least make a poll for what the community is wishing for the most. The last poll was at the beginning of 2021. The current approach that a feature will be added if @ryan has the need for it on a project is not bad, but that leads to many developer centric and less client centric features, which I personally often don't use, because there are already so many developer centric features. ?
  4. I had to comment there as well, because I couldn't leave this unfair comment alone. But in my experience this is normal for the heise community and a reason why I don't like to read articles there. ?
  5. I have read his comment but cannot understand his issue, because I don‘t care how many tables the database has. ? But the heise-community is sometimes toxic in my experience. Not as friendly like here. ?
  6. WordPress-Alternative: Websites flexibel gestalten und verwalten mit ProcessWire: https://www.heise.de/amp/ratgeber/WordPress-Alternative-Websites-flexibel-gestalten-und-verwalten-mit-ProcessWire-6663030.html heise+
  7. Just wanted to add, that I have given Twig a serious try a few years ago and came to my conclusion that it took me more time to learn first how to do things in PHP and then translate it to Twig than just to do it in PHP. But if you are happy to learn two languages at the same time or are already experienced in PHP then I imagine Twig can be a time saver. ? I prefer a CMS that doesn't force me to learn a new template language.
  8. Good comparison and and I can agree to almost all of your statements, except: Personally I would count that as disadvantage because Craft is forcing you to use one special template engine. I know you don't want to start a discussion about Twig vs. PHP, so I just want to say that I think it is better to be able to switch template engines like in ProcessWire instead of being forced to use one template engine. ? That and the expensive pricing were the reason why I never used Craft for a project yet. But I can understand why you like it so much.
  9. Thank you for your explanation. In this case I would just use an additional if-condition. if ($child->hasChildren() && $child->template->name !== "blog-post") { // Subnav } Maybe not elegant but simple. ?
  10. Maybe I am missing something, but wouldn't it be enough just to check for $page->hasChildren()? What is the benefit of the extra check of the template settings? I always just use $page->hasChildren() for building navigations, because if I have set in the template that a page cannot have children, it will not have children. ?
  11. Hello @Val_0x42, You could make an AJAX call on your page at the change of a checkbox and save the user data then instead of the form submission. I would also use regular ProcessWire users to get the benefits of access control. Regards, Andreas
  12. Hello @prestoav, I don't have a solution, but I can confirm that I recently had the same issue. I tried to change a page name but every time I saved it was the old name. I noticed that this only happened on my local development environment (ProcessWire 3.0.19x & MAMP PRO) and on a staging server it was possible to change the name. Maybe somebody else had this issue too or a theory. Regards, Andreas
  13. Hello @SwimToWin, if you use has(), you have to use a selector instead of an integer: $page->config->has("id=1898"); // returns true If you use find(), you get an PageArray as return: $page->config->find(1898); // returns PageArray count($page->config->find(1898)); // returns 1 Regards, Andreas
  14. Hello @rushy, I have made something similar for a project: Users can select some media files from a media-center and share their collection via a link. For this I have a page where I first store their collection in the LocalStorage or in a cookie and the users then can share their link with a form that creates a new hidden page storing this selection in a Page Reference field. This page will be automatically deleted after a month. You can have a look here at this function here (you can add files with the cart symbol). If you want to I can share some of my code. If you want to share only one page then maybe you should store the shared links in a repeater and automatically delete the repeater items after some time. Regards, Andreas
  15. Hello @gerritvanaaken, there are new buttons in Repeater items for cloning before or after an item: https://processwire.com/blog/posts/new-repeater-and-repeater-matrix-features/ Also: Regards, Andreas
  16. Hello @fruid, the $sanitizer->text() method has a stripQuotes option: stripQuotes (bool): strip out any "quote" or 'quote' characters? Specify true, or character to replace with. (default=false) I think this should work: $sanitizer->text($yourText, ["stripQuotes" => true]); Regards, Andreas
  17. Here is the documentation for how to use multi-language with ProcessWire: https://processwire.com/docs/multi-language-support/ What you are looking for are probably multi-language fields, like mentioned before. Sadly the video explaining this topic is private nowadays. ?
  18. Yeah it is a strange error. Clearing the browser cache also didn't work for me. On our webhoster I had no error but on my local MAMP server. Either the error was gone after a MAMP upgrade or it was a server cache issue. But I think eventually the error will go away. ?
  19. Hello @aagd, me and some others had this issue as well: I thought that it would have something to do with the language pack, but I think it was a caching issue because nowadays this error didn't occur to me anymore. Regards, Andreas
  20. Hi @strandoo, I think this could work: $biographyPages = $pages->find("biography!="); foreach ($biographyPages as $biographyPage) { $biographyPage->save("biography"); } https://processwire.com/api/ref/page/save/ Regards, Andreas
  21. Thank you @lokomotivan and @wbmnfktr for your insights. ? I can see that a headless CMS + SSG can bring advantages in performance and flexibility. I am not sure if this way of developing websites is something for me, but maybe I will try it out. Especially the performance improvement with SSGs is something that interests me. ?
  22. Maybe this question is too general and I don't want to hijack this topic, but: What are your reasons/advantages for using a headless CMS? Is it performance, targeting different channels than browsers or is it more fun to structure your content? I am curious, because I am still building websites the traditional way. ?
  23. Hello @fruid, is your selector finding any pages? I think you have to add "include=hidden" to your selector: https://processwire.com/docs/selectors/#access_control Edit: Reading further, I think your selector should work. I have never used a selector with "status", so sorry I don't have a clue. ? Regards, Andreas
  24. Just to give my two cents: As a solo developer I think it would be nice to have an automated generation of config files to version control template and fields in Git, but I can absolutely understand Ryan if he doesn't find it necessary as solo developer for his workflow. Especially with his tools for Export/Import fields, templates and pages. For teams working on a project a good version control would be really helpful in the coordination, but as a solo developer I enjoy the way of creating and configuring templates and fields in the backend of ProcessWire. The last thing I want to is to have to write blueprints and migrations for simple configurations. For example the CMS Kirby uses blueprints in YAML for its templates and fields and this is of course great for version control, but I find it slows down the development process, because you have to study the reference documentation instead of just creating a template or field in the back-end. In Kirby it is part of the core concept, but in ProcessWire it is not and I hope it stays this way. If these config files for templates and fields would be automatically generated in YAML or JSON somewhere in the sites-folder, where I could version control them, this would be nice. But personally as solo developer I don't want to waste my time with writing configurations files or migrations and composer dependencies.
  25. TBH I totally forgot about the Export/Import feature of templates and fields until I have read about it here again. My workflow was to have two windows open (developement and staging/production) and manually rebuild fields I have created in my development environment. But export/import is way easier. Thank you for reminding me. Maybe this feature should be more prominent with additional buttons at the beginning of the overview for people like me who don't look at the end of the page. ? As for the other discussed solutions: A JSON/YAML solution would also be great for version control, but for me it would not be necessary, because in my experience the gap between development and staging/production is not that large. But for large websites this could be handy.
×
×
  • Create New...