AndZyk
Members-
Posts
678 -
Joined
-
Days Won
10
Everything posted by AndZyk
-
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
-
@Roych You can clear the copy/paste memory in the select options, but yeah I think the memory could clear itself after for example loggin out. I think no one needs something forever in the memory. ?
-
Hello @Clarity, maybe $this is a reserved variable that ProcessWire uses internal: https://processwire.com/docs/start/api-access/ That is maybe the reason why your $this->var is overridden. I would avoid using $this or other reserved variables: https://processwire.com/docs/start/variables/ But maybe somebody else knows more for what $this is used. Regards, Andreas
-
Very cool indeed. ? The whole website is nice and clean. You should add a link to the website in your description. ?
-
Yeah, although the short tag <? seems nice, I have read that you should avoid it, because it has to be enabled on the server and XML also uses <?. Every field that you didn't make a required field I would add an if condition, because it could be potentially empty. ?
-
Hello @Liam88, you probably see these errors now, because you have enabled the debug mode of ProcessWire on your local copy or XAMPP has display PHP errors enabled. I think on your live server display PHP errors is disabled and you should have not enabled the debug mode of ProcessWire. The error you get now is, when you try to output a property of something that is not set. You should first check if something exists, before you try to access the properties: <?php if ($page->header_image) { // Do something } If there is no image, then you cannot access the properties "url" or "description" and get the errors. Regards, Andreas
-
Wordpress like option to create free content structure
AndZyk replied to toni's topic in General Support
Hello @toni, yes this is possible with the Repeater Matrix fields. They are part of the commercial ProFields, but I think they are worth their money. I use the Repeater Matrix for almost every project nowadays. ? Regards, Andreas -
Thank you for the correction. ? This is not related to ProcessWire, but depending on wich slider-plugin or own slider-solution you want to use, the CSS classes or even the HTML markup would be different. For example: Slick: https://kenwheeler.github.io/slick/#getting-started Swiper: https://swiperjs.com/get-started#add-swiper-html-layout Flickity: https://flickity.metafizzy.co/#getting-started Regards, Andreas
-
Hello @cpx3, do you have added a field of the type "ProField: Functional Field" added to any of your templates? If you don't have a field of this type added to your templates and try to use the functional fields methods in your template file ( with f.e. __richtext() ), you will get an error. I don't think it matters which template has this field, but a least one template needs it. Regards, Andreas
-
Hi @Gary, you could: Install the core module Repeater Create a repeater field "slider" Create a textarea field "textarea" Add the textarea field to your repeater field "slider" Add the repeater field to your template Add content to the repeater in your page Then you could output your repeater in your template file like this: <?php if (count($page->slider)): ?> <ul class="slider"> <?php foreach ($page->slider as $slide): ?> <?php if ($slide->textarea): ?> <li class="slide"> <?=$slide->textarea?> </li> <?php endif; ?> <?php endforeach; ?> </ul> <?php endif; ?> The HTML markup depends on what slider plugin for the fron-end you want to use. Regards, Andreas
-
I am not sure if this is possible, because non-superuser can only delete their own pages. So this button would make no sense in this case, because they would never have the option to empty the whole trash, just their own. Maybe it is worth checking out this module, if you want a clean trash: https://processwire.com/modules/cronjob-empty-trash/ In my experience clients usually don't care about the trash. ?
-
Source: https://processwire.com/blog/posts/processwire-3.0.107-core-updates/#trash-for-all
-
Bootstrapping Processwire: Date field outputs timestamp only
AndZyk replied to Stefanowitsch's topic in General Support
Hello @Stefanowitsch, you get the unformatted value of the datetime field probably because output formatting is turned off when bootstraping ProcessWire. You could try to temporarily turn it on and then turn it off again: $page->of(true); // Turn output formatting on echo $page->date; // Should be formatted $page->of(false); // Turn output formatting off again But I would rather just format the date. ? Regards, Andreas -
IONOS hosting and population of $config->httpHost
AndZyk replied to chrizz's topic in General Support
Hello @chrizz, just wondering why would like to add "www" to the staging url? Thats seems very unnecessary. Instead of adding the $config->httpHost you could try to use $page->httpUrl: $form->action = $page->httpUrl; But including the full url for the form action is also unnecessary in my opinion. It should work with just using $page->url. I think it would be better to decide for just one host. As far as I know $config->httpHost chooses the closest matching host. So in your case staging.website.de seems to be a closer match on your server than www.staging.website.de. I would just not use "www" for the staging url and use a relative url for the form action. ? Regards, Andreas -
You are right. The sort order doesn't seem to matter. What seems to matter is the closest match: Strange that it is only possible to set one host in the config-dev.php. Could this be a bug? But yes in this case some sort of if condition could be the way. Either with an own config variable or the PHP server variable. If you have a $config->httpHost (without s) defined, it always seems to come first: if ($config->webpackHost) { $config->httpHost = "localhost:8080"; } Ah, then this seems to be something webpack specific. I have no experience with webpack, i am still using good old CodeKit on Mac for compiling. But I am wondering why with webpack your assets don't work on both hosts. With CodeKit I got my live reload host (my-mac.local:5757) and my normal host (example.dev) and both show the same assets.
-
Hello @bernhard, you can add multiple httpHosts in your config file as array: $config->httpHosts = array( 'example.dev', 'localhost:8080' ); Source: https://processwire.com/docs/start/variables/config/ Also you could have a separate config file "config-dev.php" for your development environment: For the HTTPS issue, you could try to this: $config->noHTTPS = 'localhost:8080'; Source: https://processwire.com/blog/posts/pw-3.0.99/ I have never tried the noHTTPS option, but maybe it could work. Regards, Andreas
-
Here is the blog post about it: https://processwire.com/blog/posts/processwire-2.6.8-brings-new-version-of-reno-admin-theme-and-more/#new-this-gt-halt-method-for-use-in-template-files
-
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
-
ProcessWire also offers build in export and import functions for templates, fields and pages. ?
-
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. ?
-
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. ?
-
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. ?
-
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+
-
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.
-
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.