Jump to content

kongondo

PW-Moderators
  • Posts

    7,417
  • Joined

  • Last visited

  • Days Won

    141

Everything posted by kongondo

  1. Thanks! Definitely. The current plan is for a wishlist in this forum. Whilst a roadmap and a wishlist are not always congruent, the latter, in some cases, will feed into the former.
  2. Updated FAQ in first post. The PHP extension bcmath is required in Padloper 2.
  3. This thing is heading to 1M views soon by the likes of it! @ryan, this ? one is for you ?:
  4. Hi all, I am working on demo videos for Padloper 2. In the first instance, these will be short tutorial videos to get you up and running quickly. You'll be able to use these in lieu of or in addition to the docs. I'll let you know when these are up. Thanks.
  5. GistPad Manage your code snippets and developer notes using GitHub Gists and repositories. https://marketplace.visualstudio.com/items?itemName=vsls-contrib.gistfs Stumbled upon this today. I have watched the demo below by the creator. This is a really awesome tool! Other features include creating code documentation/notes, create code playgrounds right within VSC, interoperates with codepen, etc. Watch the video below, right to the end. Quality is not the best (it was a live stream) but it is worth it.
  6. It does work with backend modules ?. The distinction in this case is not about backend or frontend. It is about autoload. Since Process modules are backend applications that you use on demand, there is no compelling reason to have them autoload. Hence, in your case the suggestion to create a module that autoloads and is dedicated to handling the URL hooks. Not really. There are different types of so-called backend modules, including Process, AdminTheme, Inputfield, etc. All modules have to implement the Module interface. In some cases they may not do it directly but do so via the parent class they are inheriting. For instance, you will find InputfieldFile extends Inputfield. Inputfield in turn extends WireData and implements Module. Technically, there are no 'satellite' modules. This term was just used in reference to having something on the side that is not part of the main thing (hope this makes sense). So, your 'satellite' module, given that it autoloads without restrictions, is both a backend and a frontend module. You can make it autoload based on some conditions if you wish, e.g. in the backend only, or frontend only, or for some templates only, etc. The following documentation will give you a better understanding of modules. https://processwire.com/docs/modules/ https://processwire.com/api/ref/module/
  7. @Peter Oehman, Welcome to the forums and to ProcessWire ?. This will return an array of the names of all tables in your database. This is confusing. Do you want the name of the database or the name of some table in the database? In addition to what @BillHstated above and given that you are new to ProcessWire, the first question I'd ask is why? Why do you need to write custom SQL queries? Please let us know. There may be other ways to achieve what you are after. However, if you do need to use SQL queries, that's fine. ProcessWire also supports that. In which case, prepared statements using the ProcessWire $database API are the way to go.
  8. @toni, What @Zeka said. You'd need an autoload module for this otherwise your hook would only run when your module is loaded which will be too late. Although this is not explicit in the blog post I linked to, it does mention autoload module.
  9. You cannot reach a backend page -> Process, Setup, etc from the frontend like that. There are various alternatives. A recent one is URL hooks.
  10. Maybe give Padloper 2 a try. It is a dedicated e-commerce software ? ?. Then again, maybe I am too close to it.
  11. Top of the evening, sorry for late reply @alexm ?. Yes I have. Plan was to release Padloper first then go through the list of planned and requested features. I have been thinking about it though. There's two things here. Lazy loading and pagination. The former is more important as without that, for a variant-heavy page, the product won't load at all, even though one might have to scroll a lot (if no pagination). But this is definitely on my list. Thanks.
  12. I am receiving questions with respect to the release of Padloper 2. I have added an FAQ section to the first post here. Please have a look. Thanks.
  13. I reckoned as much ?. That version does not have the bug fixed, sorry. Please use the latest version. The same link I sent you should work. It is valid for one year effective 30 Match 2022. No way! That'd be very unfair ?. Now that Padloper has been released (no longer in beta), although the beta testing programme is finished, your licence does not expire with the end of the testing. In fact, your subscription and access to VIP support 1-year countdown starts from the release date, i.e. 30 March 2022. I hope this answers your question. This would be awesome. Thanks.
  14. Hi @alexm, Are you using the release version? I.e. when did you get your Padloper copy?
  15. Thanks for the detailed explanation. @3fingers, I have come up with an alternative solution to your original question. It does not use SSE but uses htmx and Local Storage. It is detailed and demonstrated in the topic below:
  16. The problem: how to refresh a page's frontend content in real time without a page refresh when the page has been edited in the backend. This is an alternative approach to the one discussed in the topic below. The above topic attempts to solve the problem using SSE. The solution in this topic instead relies on Local Storage and htmx. There is no ajax polling. Please note that auto-refresh here refers to a page refresh during the same session and in the same domain. It is not cross-site. The solution can be summarised as follows: Use a hook in ready.php to inject custom JavaScript to the ProcessWire backend admin, specifically in ProcessPageEdit. This can be a JavaScript file or inline script. The purpose of this file is to update a given Local Storage key after a page has been edited. Instead of listening to the Save Button click, the script just checks on load if a certain hidden input whose value matches the page currently being edited is present. This hidden input is placed inside ProcessPageEdit form using a hook as detailed below. The hook in this step #1 can be: $this->addHookAfter('AdminTheme::getExtraMarkup', null, 'hookAddCustomScriptsToAdmin'); In ready.php, add a hook to listen to saveReady(), e.g. $this->addHookAfter('Pages::saveReady', null, 'hookNotifyFrontendOfBackendPageSave');. When the page is saved, the handler method hookNotifyFrontendOfBackendPageSave will check if there are changed fields. It will then write to a temporary session variable for the current page with the names of the fields that have changed. On page load/reload, there is a hook in ready.php that monitors ProcessPageEdit, i.e. $this->addHookAfter('ProcessPageEdit::execute', null, 'hookAddMarkupToNotifyFrontendOfBackendPageSave'); The handler hookAddMarkupToNotifyFrontendOfBackendPageSave will check if there is a session variable set in #2 indicating that the page has had recent changes in the fields names set to that session variable. If this is true (that there have been changes), this hook will simply append the hidden input in #1 to the ProcessPageEdit form. The JavaScript in #1 will detect the presence of the hidden input. It will then amend the Local Storage value in #1. It cannot simply set the value to the ID of the page being edited as that will not be construed as a change. It will instead append a timestamp to the id of the page as well and set that as the value. This will enable a listener in the frontend, described in the following steps, to detect that change. In the frontend, we have a simple JavaScript file that listens to changes to the Local Storage storage Event. The frontend also has a simple hidden input in the template file whose pages we want to refresh. This hidden input has htmx attributes. Its trigger is a custom event 'autorefreshpage'. It will listen for this event before firing a message to the server. This hidden input also has hx-swap=none as nothing will be swapped to it. Instead, the server will send back results of changed fields in various markup with hx-swap-oob=true. That will enable swapping markup in any parts of the frontend html in one go. When the Script at #4 detects that a given Local Storage value has changed, it first checks if the page ID for that Local Storage value matches the page ID of the page currently being viewed in the frontend. If the answer is yes, it will fire the custom event autorefreshpage. This will make htmx fire a message to the server whose only value is the page ID it has been passed. On the server, in home.php, we have code that is listening to ajax requests. If it detects an ajax request, it checks if the page ID that htmx sent matches an available session that was recently updated. This would be the temporary session detailed in #2 above. If a match is found, it calls a function in _func.php that will set variables for fields for that page. These use partial templates (optional). These partial templates are for different outputs of the page, e.g. images, headline, etc and all their markup have hx-swap-oob='true' in appropriate places. All these content is sent back as one output back to htmx. It will read the hx-swap-oob and find the markup to replace in the DOM using the html IDs of the markup with the hx-swap-oob. This approach allows the developer to have maximum control over what to send back to htmx and over the markup. In this step, we also delete the temporary session, ready for the next updates. The result is as demonstrated below. A simple and effective DOM swap that places very little strain on the server. I'll clean up the code for this and upload to GitHub. This approach will not work with Save + Exit and similar :-).
  17. I can organise guest access to a backend if anyone wants to have a look. Please PM me if this is of interest. I will be making videos in due course but actually testing it for yourself is still good.
  18. Sorry this works, of course it does! Thanks @bernhard. Nothing strange about $sanitizer that I mentioned above...just me. Sorry for wasting your time ?‍♂️.
  19. Good point. I wasn't clear. I also had a typo in there. What I need is this: "blick-docker" to match what is generated in page name field. As you point out & in the URL is not desirable. However, I am facing the inconsistency that @snobjorn mentioned. Here it is again + a strange inconsistency I have seen. User creates a product called "Blick & Docker" <- I have no control over this naming. ProcessWire access that product's title and gives it the name "blick-docker". In the frontend, there is a list of products. Their links to their single product pages are generated dynamically from their titles. However, in the frontend, ProcessWire $sanitizes the title of this specific product as "blick-amp-docker". (see code below). Finding that page using its URL segment fails since #3 does not match #2. <?php namespace ProcessWire; $productName = $sanitizer->pageName($product->title, $beautify = true);// "blick-amp-docker" What'd I'd like is a $sanitizer that gives me "blick-docker", i.e. matches the sanitizer used in a page name field. Maybe it is done at the JavaScript level, hence doesn't exist in $sanitizer? I have tried all the things suggested here (except changing the page name settings as I would like as little effort as possible from the user). What is strange is that pageNameTranslate also adds 'amp' if used in a template file in the frontend. If used in Tracy, there is no 'amp'! EDIT: Please ignore this . Output formatting on/off, duh! I hope this is clearer. Thanks ?.
  20. Those with the beta version, please note that there have been some changes to the order template. Some fields have been removed and a few things re-arranged. If you cannot do a fresh install, please let me know and I'll guide you through the changes. Thanks.
  21. Been experiencing the same issue and the solutions are not working for me. Let's say I have a product titled "Blick & Docker". In my template file, I'd like to $sanitize that title and use it as a URL segment that will end up as /products/blick-docker/. This would match the page name for this product since I can find that product page from the URL segment. Currently, I am ending up with /blick-amp-docker/ which leads to a 404 as it doesn't match my product page at that URL segment. I know I can use regex to replace 'amp' but that won't work for products that genuinely have 'amp' in them. Any ideas please? Thanks.
  22. Padloper 2 has been released I will write a better post later. Need to know for now: Get it from here. We will be transitioning to a new website and/or shop in due course. For now, please get it from that old site. For now, and to allow it to bow out gracefully, initial purchases will be powered by Padloper 1. All hail Padloper 1 :-). Due to #2, and #3 and due to non-SCA compliance on that particular site, there might be Stripe issues. Apologies. Please contact me for help. Support for Padloper 1 has ceased. Security fixes will continue. Things I have promised to look at will be looked at :-). Support subscription period for beta testers' purchases commences today - 30 March 2022. It is a special day...in more than one way... Update 3 April 2022 Frequently Asked Questions A few questions are coming up with respect to this release. For now, I'll answer them here but might start a new threaded dedicated to FAQs. Q: Will beta testers have to purchase a new licence for this release? A: No. Your licence and download link are still valid. The only difference is the countdown of your VIP support commences on 30 March 2022. Subscriptions and updates are valid for one year. This download link was emailed to you when you purchased Padloper 2. Please contact me if you do not have a download link. Q: I have shops built in Padloper 1 that I'd like to migrate to Padloper 2. I don't have the expertise and/or time to do the migration myself. Is there paid support for this? A: Yes, paid support is available. We can migrate your Padloper 1 shop to Padloper 2 per your specifications. This includes both backend and frontend migration. You can purchase either or both backend and frontend migration. Please contact me to discuss. We will soon add this custom work information to our website. Q: Is there a backend/admin demo of Padloper 2 that I can test pre-purchase? A: Yes. We are currently putting final touches to it. An announcement will be made here once this is ready. Q: Which is now the official Padloper support forum? A: This forum will eventually become the official Padloper support forum Although it is a public forum, we will still be able to offer VIP support. The only difference is downloads will be not be available in the forums, since it is open. Support via email will still be available as well. Q: I am getting a called to undefined function bcmul() after install. What does this mean? A: Please see the minimum requirements for Padloper 2. You will need to install the PHP extension bcmath on your server. This is in order to get accurate rounding off of currencies.
  23. This was a bug. Just fixed it now. Thanks.
  24. I see, thanks. Yes, you need at least PHP 7.4 with BC Math extension https://docs.kongondo.com/start/requirements.html
  25. Hi @alexm, Thanks for reporting. I saw the line #2132 the other day and couldn't figure out where it had come from. Must have been some botched find and replace. I have checked all files now and removed the ones in InputfieldPadloperProductStock.php. Does removing them allow you to install? What PHP version are you using. I am wondering why mine did not throw any errors. ps: Please check your email, thanks.
×
×
  • Create New...