AndZyk
Members-
Posts
678 -
Joined
-
Days Won
10
Everything posted by AndZyk
-
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. ?
-
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. ?
-
Change Field value based on a checkbox in front-end
AndZyk replied to Val_0x42's topic in Getting Started
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 -
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
-
How to check if each page reference checkbox is checked?
AndZyk replied to SwimToWin's topic in General Support
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- 3 replies
-
- 1
-
- checkboxes
- page reference
-
(and 2 more)
Tagged with:
-
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
-
Cloned repeater(matrix) item after "original", not at bottom
AndZyk replied to 2hoch11's topic in Wishlist & Roadmap
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 -
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
-
How to setup a exsisting website to multilanguage
AndZyk replied to Angelino's topic in General Support
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. ? -
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. ?
-
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
-
How to 'touch' Body field (CKEdit) after CSV Import
AndZyk replied to strandoo's topic in General Support
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 -
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. ?
-
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. ?
-
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
-
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.
-
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.
-
Hello @kongondo, I am not a Padloper user, but I have noticed an increasing number of Padloper threads in the Dev Talk topic. Right now I am counting 6 threads for Padloper (1 pinned). Wouldn't it be better to have a dedicated place for Padloper? For example here: https://processwire.com/talk/forum/57-module-specific-support/ Since Padloper is a module and the Dev Talk section is "A place for general development and coding discussions." I think this would be a better solution for Padloper and non-Padloper users. ? Regards, Andreas
-
There was a poll in 2017: https://weekly.pw/polls/#which-site-profiles-should-be-bundled-with-processwire Personally I only use the blank site profile. But for beginners one starter site profile would be necessary. I don't think there is a need for multiple site profiles, but that is just my opinion. Other CMS offer two separate downloads (one blank and one starter download). This could also be an option.
-
Hello everyone, for anybody using Gravatar who didn't hear the news: Gravatar had a data leak exposing the name, username and email address of your public profile: https://monitor.firefox.com/breach-details/Gravatar For me reason enough to never use Gravatar again, but that is of course my personal decision. ? Regards, Andreas
-
Hello @SwimToWin, just out of curiosity: Is there a source for this statement? I don't quite believe that this makes any difference at all. Also you can already achieve this by using for example URL segments on your homepage: https://processwire.com/docs/front-end/how-to-use-url-segments/ You would just have to check the URL segment with the page somewhere else in the page tree. Regards, Andreas
-
Thank you for the update. I am always using the latest MAMP PRO and didn't notice this issue anymore. But I also defined as workaround a own config variable "useWebP", which I set to false for my development environment. ? <picture> <?php if ($config->useWebP): ?> <source srcset="path/to/image-webp" type="image/webp"> <?php endif; ?> <img src="path/to/image"> </picture>
-
I had this issue on my local MAMP server for a while, when the new master version came out. But now it never occured to me again. First I also suspected the language pack, but now I think it might was a chaching issue. Although I had cleared all chaches. ?
-
Thank you, for linking to the post I was refering to. In my opinion "lack of interest" and "lack of expertise" goes hand in hand, but yes he showed willingness to support this feature on the PHP side. ? I still hope, that the Repeater Matrix could be enhanced as layout builder, because many of us use it already and it has already the blocks feature. Also the layout builder feature was one of the most requested features of the community at the beginning of this year and was discussed a few weeks. But if it is too complex to enhance the Repeater Matrix, I can understand that. ?
-
Hello @Fokke, thank you for the teaser of your module. I am exited to see more of it. Since @ryan doesn't seem to be interested in developing a layout builder solution, it is nice that somebody else gives it a shoot. If your teaser video is ready, feel free to mention me. ? Regards, Andreas