Leaderboard
Popular Content
Showing content with the highest reputation on 12/31/2021 in all areas
-
Happy New Year! Hope that you all have a great end to 2021 and start of 2022. No major core updates to report this week, just a few minor issue fixing commits, so no version bump today. The dev branch is getting close to 100 commits (and at 7 versions) above the master branch, and with even more improvements/fixes/optimizations than that. So we may try to get a new master/main version out in early 2022, as I'd really like to get more master versions out in 2022 than we did in 2021. Some portion of our audience does not use the dev branch where most of the activity happens, and so it might be nice to share more of that activity on the master/main branch. That's one of many things I'm thinking about as the New Year approaches and am certain 2022 is going to be a great year for ProcessWire and the community. Hope that you have a great weekend and Happy New Year!10 points
-
8 points
-
Demo site (frontend) is here. I'll do a write-up about it soon. The cart is htmx, Tailwind and alpine.js powered. Borrowed bits of templates here and there, threw in some Tailwind CSS components and this is what we get. Oh, yes, all the blemishes are mine. Site is not optimised but it is fast enough. It should give better feedback after item is added to cart. Will work on it later. Full checkout works. The PayPal widget will not charge you though. It will just crash (with a lot of grumbling in the console). Over the weekend I'll set up a GitHub repo with this demo as a starter site for our testers (especially). I also plan to wrap up the docs and prepare access for testers ready to download by Monday. I'll send you (testers) an email in this respect. After (or even before) that I'll write up a bit about what to expect in this first release and what not to expect. Happy new year.2 points
-
I wish everyone a good start into the new Year. To round up this year I released v0.10.0. The library is runnable as intended in a ProcessWire Environment and fully testable in Standalone mode for developing. Symprowire Release v0.10.0 - Backpain I will publish a demo implementation next year. Hope it will be of use for some of you guys.2 points
-
@Richard Jedlička @wbmnfktr You can set a response code in your hook like this: http_response_code(400); So you can set 400, 307, or whatever you need. https://www.php.net/manual/en/function.http-response-code.php2 points
-
Over the years, I've experimented with using RepeaterMatrix as the basis of a rich page builder. I've gone through at least a dozen concepts, most of which hit the chopping block due to either being too complex, not well thought out, too clever or too limiting. To my knowledge, the only other CMS that takes the "Builder" approach that I've demonstrated is DjangoCMS (meaning, it has a matrix-like field with depth support). While the "Builder" approach works well, it could be too advanced for some people. Therefore the other approach is the "Classic" approach where you don't deal with containers/rows/columns (which instead is handled by template code), and simply enter the content in the respective field. This is easy to understand, but has drawbacks in terms of flexibility. If it were made to be too flexible, it would become a "God" block which is bad. Then I finally thought of a third approach which is a mix between the Builder and Classic approach. It uses the basic builder blocks, combined with the layout from the matrix item template file. By using the basic builder blocks, you get the plethora of options. It requires an extra page to be created behind the scenes however, but live preview still works. I made a video comparing all the above (10m duration). I want to hear your feedback on this as I am ~75% done with my super module (doing a lot of code and concept cleaning at this point) and want to finish off this portion of it. (note: I'm posting this in the Dev Talk forum since this is a discussion / not support request)1 point
-
Hey @modifiedcontent. I’m not the best person to answer this because I’ve never used FieldtypeComments, but since there are no other takers, let’s see… First and foremost, do you really need to call that method? It seems to me that it’s mostly intended for internal use by the usual save functionality. You should be able to delete a comment by just removing it from the WireArray and saving the Page or the Field. What you want to do should work like this, I believe: /* Get the field by whatever name you called it. * This will be of type CommentField. */ $field = $page->getField('mycommentsfield'); /* Get the Comment object you want to delete by * its ID. Note how we call getFieldtype() to * get to the Fieldtype itself. That will be * FieldtypeComments. * If you have already loaded the comments (and * the right pagination page) it may be better * to get it from there, as this will go all the * way to the database: */ $deleteMe = $field->getFieldtype()->getCommentById($page, $field, $id); /* Now since you already have your CommentField * you can call deleteComment on that. It’s the * same thing as calling the method of the same * name on FieldtypeComments and putting $field * in the $field argument. */ $field->deleteComment($page, $deleteMe); //don’t need the notes /* Get the field by whatever name you called it. * This will be of type CommentField. */ $field = $page->getField('mycommentsfield'); /* Get the Comment object you want to delete by * its ID. Note how we call getFieldtype() to * get to the Fieldtype itself. That will be * FieldtypeComments. * If you have already loaded the comments (and * the right pagination page) it may be better * to get it from there, as this will go all the * way to the database: */ $deleteMe = $field->getFieldtype()->getCommentById($id); /* Now since you already have your CommentField * you can call deleteComment on that. It’s the * same thing as calling the method of the same * name on FieldtypeComments and putting $field * in the $field argument. */ $field->deleteComment($page, $deleteMe); //don’t need the notes Now if you already had the Comment object, you could get all the information from there. Let’s assume it’s called $deleteMe again: $deleteMe->field->deleteComment($deleteMe->page, $deleteMe); //note how the comment itself contains references to its CommentField and its Page As to why the return type is mixed, if you check out the method’s code you’ll notice that it returns a variable called $result which may either be False, in case an exception happens when talking to the database, or if everything goes well it may be whatever $query->execute() returns. By default, DatabaseQuery->execute() returns an object of type PDOStatement, so it’s impossible to know the return type of deleteComment ahead of time. It might end up being a Boolean or it might end up being a PDOStatement, so it’s mixed. Like I said, I haven’t tested any of this myself, so I may have missed something and the above code may be faulty.1 point
-
1 point
-
1 point
-
Thank you! All the same to you and to all of us! It will be nice to take a closer look for sure, thank you in advance.1 point
-
Hey, @Mats! Please create a separate topic as Wireframe now has a dedicated subforum. This way we can easier track issues. @teppo, do you think locking this topic would be the right thing to do? Adrian did lock the old monolithic Tracy thread. Sorry for being meta and not on topic)1 point
-
Hey everyone- We recently had a need come up for a website. After launching our website the company hired an SEO specialist who is doing some significant work revising and optimizing content. To help enhance this process I wrote a very simple module that automatically submits the website's sitemap.xml file to Bing and Google when a page is published, or when a page is saved that was already published. As for our reasoning- there's a lot of information available as to why submitting your sitemap regularly can be beneficial. In classic Google style their official documentation says that there "is no guarantee" that submitting a sitemap alone will trigger a re-indexing by Google's bots. That said, devs have done tests where there is a strong correlation between a sitemap submission and activity by Google bots on that website. Google has stated that there is no limit or cap on the number of times you can submit a sitemap so there is no penalty for triggering this for every change. For more details and the hard science visit this excellent article https://trevorfox.com/2018/09/ping-sitemaps-search-engines/ 2021 Update! This module has been rebuilt almost entirely to perform even better and cover more events that can affect sitemap.xml data which makes it more effective for your SEO performance. Previously the module submitted the sitemap.xml URL when a page was saved but has now been expanded to encompass any event that potentially modifies your sitemap and does it more intelligently. These events include: New page is published - New URL created Existing page is unpublished - URL no longer available Existing page is saved - Content on page may have changed Existing page is moved - URL has changed Existing page is deleted - URL no longer exists Existing page is restored - URL is now available ProcessSitemapSubmit also: Checks if sitemap.xml exists/is available Logs submissions and results to sitemap-submit log Allows for the sitemap URL can be specified, defaults to yoursite.com/sitemap.xml Templates can be excluded for pages created/saved that should not be submitted to search engines Hidden pages do not trigger a submission. Supports Bing and Google As always, I'd never share a module with the community that I haven't used in production but I still ask that you test and ensure that it works for you. The repo for this module has a notice that it is still in development but I am going to bring it to a release and add it to the Modules directory soon (i.e. when I have a spare minute). This module should have little to no risk and the best way to test is to check the sitemap-submit logs for successful submissions. I am a big fan of the Sitemap module by @Mike Rockett and use it on all of my sites. The Sitemap module uses caching to deliver your sitemap.xml file efficiently. I've worked with Mike to update his module so that it allows ProcessSitemapSubmit to clear it's cache and deliver the latest changes to search engines. This module is aware of Sitemap and works with zero configuration out of the box. To get this functionality in tandem with ProcessSitemapSubmit, please update the Sitemap module on your site. The Sitemap module is not a requirement for this module to work as long as your website has an available sitemap.xml to submit. Check it out. https://github.com/SkyLundy/ProcessSitemapSubmit Feedback and bug reports welcome!1 point
-
1 point
-
Hi @Didjee, unfortunately you are right. My old code no longer works. ? I have dived into the issue and filed a github issue with a possible fix. So hopefully Ryan soon will find time to look at it. ? If you like, as a workaround you can place my new suggestion into the file wire/core/Pageimage.php instead of using the current webp() function there. /** * Get WebP "extra" version of this Pageimage * * @return PagefileExtra * @since 3.0.132 * */ public function webp() { $webp = $this->extras('webp'); if(!$webp) { $webp = new PagefileExtra($this, 'webp'); $webp->setArray($this->wire('config')->webpOptions); $this->extras('webp', $webp); $webp->addHookAfter('create', $this, 'hookWebpCreate'); } // recognize changes of JPEG / PNG variation via timestamp comparison if($webp && is_readable($webp->filename()) && filemtime($webp->filename()) < filemtime($this->filename) ) { $webp->create(); } return $webp; }1 point
-
I'm using the on-demand feature a lot. That's why it is part of RockMigrations using one single config setting: $config->filesOnDemand = 'https://example.com'; See https://github.com/BernhardBaumrock/RockMigrations/blob/b09bf8236d376913a63b6fce63f91e05a0da1f2a/RockMigrations.module.php#L413-L453 That works great with one exception: When I delete an image the hooks still try to download the image from remote and this makes two problems: If the file exists on remote, the file will be downloaded to the local filesystem and will never be deleted because the image does not exist in the DB any more so PW will not know about it If the file does not exist on remote I will always get an error that it tried to download an image which does not exist: Any ideas how I can fix this?1 point
-
Yes, I built a project with CraftCMS 2 years ago. It made me love ProcessWire even more. ? I follow WordPress very closely and CraftCMS somewhat closely. AFAIK, their Matrix field works similarly to ProcessWire's, but the fields that go inside each matrix-block are 1-off (not re-used). Pros and Cons to that. Also, it doesn't support depth, so really it's more of the 'classic' approach (like WP ACF Flexible Content).1 point
-
I am noticing that some editors are forgetting, or not seeing that they have to publish the items/pages in a PageTable fields. I think in many/most cases you would want all published automatically. Or perhaps it could be an option for the field - the dev can decide whether editors can choose to save unpublished if they want. Alternatively I think it would at least be helpful if there were publish and hide toggles (like the new main page tree action buttons) so it is easy to quickly publish all subpages rather than opening each one up. I would prefer the first option though. Anyone else think this would be useful?1 point