-
Posts
1,444 -
Joined
-
Last visited
-
Days Won
41
Everything posted by gebeer
-
So here I am, fighting with UIKit (again). Offcanvas feature is great and works a charm out of the box. Only thing, those offcanvas bars are dark background by default. You could change that through variable overrides, sure. But what if you have 2 bars, one for nav (mobile) and one for an AJAX search thingy and you want the former to have dark and the latter to have light background? Easy right? Just add sth like uk-background-default and uk-dark to the uk-offcanvas-bar container. Done. Right? No. Shoot. what is happening here? White text, White icon, white input with white placeholder text. So not much to see here. Bonkers. 7 mins traveling through perplexity search later reveals an old closed (but seemingly not solved) GH issue. It suggests that back in 2021 offcanvas did not support the inverse component. Too bad, especially since it still does not seem to support it. Why the heck would it be such a hassle for a seemingly easy task? Is this such an exotic use case? Enough of the rambling. On to the obvious question: how do people solve this (other than suggested solution involving writing tons of CSS)? Is there a generic way of doing this with uk-classes in 2024? Your input would be much appreciated so I can move on to more exciting tasks ?
-
Go for it! The distro you choose doesn't really matter imo. Just use the one you feel most comfortable with. I'm full time on Linux since 2003 and haven't thought about switching back to Win or Mac ever since. Maybe Linux on Mac hardware ? Back in the days Ubuntu was released as free DVD via mailorder ? My journey went from Ubuntu to Debian Based Mint (LMDE) with Mate, then Cinnamon desktop. I finally settled on Arch (btw) for the last 8 years or so. Now I'm in the process of switching to NixOS for its deterministic setup approach and reproducability of exactly the same system on multiple machines. Lot's of fun if you're coming from a programming background. Anyways, as for graphics apps, I've been using a pirated CS6 in VMs for many years. Then switched to Photopea. Not doing a lot of graphics. But sometimes really am missing Illustrator, mainly for its text on path features. You can do it with Inkscape but it is fiddly as hell. Photopea is even better with that. File manager color labels: Nautilus on Gnome needs an extension for that from a custom PPA. If you feel comfortable using gnome extensions and packages from random PPAs out there, you could go that route. Gnome is great in itself. But, you already said it, might break easily when using extensions. Kinda like the Wordpress Plugin Hell. KDE does not have that out of the box as far as I'm aware. Found a 6 years old extension... Maybe you missed out on terminal file managers. There's a ton out there. I love yazi with vim style key binds (configurable through toml file). It has file colors/icons out of the box if you use Nerd Fonts in the terminal and feels really nice for a terminal application: You can disable snaps and replace them with flatpak which is a way better ecosystem given you have ample disk space. This depends very much on the hardware and distro used. You really should have had a better exoperience given that you bought a Linux optimized laptop. I have one, too (Tuxedo with AMD) and it seems I got lucky or they did a better job than your vendor. Never hear even the faintest fan noise. Then I have a 10 year old Asus ZenBook. Still running like a champ with very moderate noise under high loads. Linux is so awesome because of all the choices it gives you. Can be a bit overwhelming at the start, though. Man, I could talk hours on end about this topic. What a great way to procrastinate ?
-
Module RockFrontendTailwind - A Tailwind Starter Profile for RockFrontend
gebeer replied to gebeer's topic in Modules/Plugins
Yeah, that one is actually pretty cool, because you can mix UIKit styles (or any Framework for that matter) with Tailwind. It has no fully featured webpack setup like my module, though. -
Module RockFrontendTailwind - A Tailwind Starter Profile for RockFrontend
gebeer replied to gebeer's topic in Modules/Plugins
@HMCB thanks for the Like on my post. In case you want to use my module, you need to update npm package versions to the latest ones. Haven't done that in a while... -
You could do a check for existance of window.htmx and then conditionally include it from CDN. Sth along these lines if (typeof window.htmx === 'undefined') { var script = document.createElement('script'); script.src = "https://unpkg.com/htmx.org@latest"; script.integrity = "sha384-ujb1lZYygJmzgSwoxRggbCHcjc0rB2XoQrxeTUQyRjrOnlCoYta87iKBWq3EsdM2"; // Not sure if this works reliably with @latest script.crossOrigin = "anonymous"; document.head.appendChild(script); script.onload = function() { console.log("htmx loaded successfully!"); }; script.onerror = function() { console.error("Failed to load htmx!"); }; } else { console.log("htmx is already loaded."); }
- 26 replies
-
- 1
-
- formbuilder
- ajax
-
(and 1 more)
Tagged with:
-
Thanks for the module! htmx is awesome and absolutely the right tool for such things.
- 26 replies
-
- 3
-
- formbuilder
- ajax
-
(and 1 more)
Tagged with:
-
I think we have all been there - don't worry ? I tend to put myself under pressure quite often. Only to realize afterwards that it was totally unnecessary. Maybe related to my zodiac sign? It sometimes would be a healthier decision to just take the time I needed and also communicate that.
-
I totally support this. Since the tweaks part of RM can be expected to grow, I also think it would be better to have this in a separate module. RM really should be what it states: the ultimate automation and deployment tool. This is where it shines. I'd be sad to see it become bloated with functionality not related to that. Just my honest opinion.
-
What @dotneticsaid. And when trying out things. Snapshot - add fields/templates/dummy pages etc. Like it -> keep it. Don't like it -> rollback to last snapshot.
-
Add general information to specific template pages in admin
gebeer replied to TomPich's topic in General Support
Here you go: https://www.baumrock.com/en/processwire/modules/rockmigrations/docs/magicpages/ -
Yeah, I also love it and wouldn't want to miss it. Especially handy is the ddev snapshot feature. Has saved me a ton of time already.
-
Link page with multiple pages by field value in backend
gebeer replied to Pavel Radvan's topic in General Support
Before you try, I changed a line in the code above. Use the new version. -
Link page with multiple pages by field value in backend
gebeer replied to Pavel Radvan's topic in General Support
Thank you for providing the screens. That helps. If you want to have linked products on the contract pages, you need to add a page reference field for products, like I described above. After you have added that field, you can use this script to loop through all contract pages and assign linked products by id: foreach($pages->find("template=contract") as $cp) { // assuming you have a field $cp->uid with the id // get products with same id $products = $pages->find("template=product, uid={$cp->uid}, status<" . Page::statusTrash); // add products with same id to products field $cp->products->add($products); // changed this line // save the changes $cp->setAndSave('products'); } EDIT: changed a line in the code You need to change the template and field names to fit your installation. After running the script, every contract page should have linked products assigned. The process for linking customers to products should be similar. Let me know how it goes. -
Link page with multiple pages by field value in backend
gebeer replied to Pavel Radvan's topic in General Support
Thank you for the explanation. I still do not fully understand how you contract head ID is saved to the product and contract pages. I assume that on the product template you do not have page reference field which links to contract(s). But on the contract template you already have a page reference field for products which contains products for that contract. Please specify the field name Now you want to "link back" the contracts to a product using the products available in the contracts' page reference field for products. Is this correct? Could you please share screenshots of the templates for contract and product? And also screenshot of the current edit page for contract and product with the relevent fields? That would help to clarify. Sorry, but you lost me there ? When you create a new contract, how does the contract know, which products are connected to it? When creating a new contract, do you assign an existing contract head ID that already is linked to products? -
Link page with multiple pages by field value in backend
gebeer replied to Pavel Radvan's topic in General Support
Did you save the product IDs for the linked products to your contract pages when importing the data? If you don't have the product IDs for each contract page, there is no way of linking products to contracts by a script. -
Link page with multiple pages by field value in backend
gebeer replied to Pavel Radvan's topic in General Support
First you need to add a page reference field to the contract template. I assume you name it 'products' Set it to accept multiple pages Choose type ASM select and product template for allowed templates Now that you have your products field in place, you can write a script to assign the product pages to the contract pages. foreach($pages->find("template=contract") as $cp) { // assuming you have a field $cp->uid with the ids of the products // if you have a comma separated list of ids or the like, convert it to array $uids = explode(',', $cp->uid); // add products for each $id to products field foreach($uids as $id) { $cp->products->add($pages->find("template=product, uid=$id")); } // save the changes $cp->setAndSave('products'); } I would recommend using TracyDebugger Console to run the script. Or you can run it from site/templates/home.php This should assign the correct products to the contract pages and make them editable from the contract pages edit screen. -
Link page with multiple pages by field value in backend
gebeer replied to Pavel Radvan's topic in General Support
If I understand correctly, you want to make the connection between contract and product pages after data import. In the imported data you have a numeric ID that connects contracts to products. Can you please clarify if that numeric ID has been saved to a field on both contract (multiple IDs) and product page (single ID)? Once we know that, it would be quite easy using a small script to make the connection through a page reference field on the contract page that references one or more products. -
Yes, that is why we went with the page tree option. Less headache for developing. Definitely more work, but also more flexibility for the editors.
-
I proposed to either 404 or redirect. So if you redirect to the main admin page and add a message before you redirect, the user doesn't even need to click anywhere and gets there automatically. Better UX IMO. Which items would that be? You can setup your roles/permissions in a way that users only see the menu items for pages/processes they have access to. If your users get access to the page tree, you can use hooks that utilize Page::viewable to remove those pages from the tree that they should not see. You'd have to activate language support (if you haven't already) and then in the settings for each language search through the core translation files to find those strings and then overwrite them.
-
Yes, this is what I would go for. Sth like domain.com/fr/market1/, domain.com/fr/market2/ etc. so you have segments /language/market/ You can either 1. reflect this in your page tree -home --market1 ---page --market2 ---page 2. use URL segments. This would make the routing more complex. 3. You could also use URL hooks with named arguments and do your routing from there. For 2 and 3 you need to make sure that the URLs with market segments resolve to a 404 without segments/hooks in place. I've done something like this at https://www.ziehm.com/en/products/ and https://www.ziehm.com/en/us/product-portfolio/ where /us/ is the market segment. In this case we solved it through the page tree structure. Drawback is that similar pages under default market (no market segment) and us market need to be maintained seperately. EDIT: to avoid maintaining duplicate pages for different markets, you can have a markets parent with markets as children with templates markets and market respectively: Market pages: -markets --europe --asia --africa Then have a page reference field that allows selection of 1 or more markets. Now you use this field in combination with prices or other things. In the rendering logic you can get the price for market by URL segment. You'd need to have the market chooser direct to the respective market segments of the page. In said project we have a market selector page for each market with the languages to choose from https://www.ziehm.com/en/us/market-selector/ If you have those market pages in the tree, you can also link markets to available languages for that market. It was fun and challenging to work that out for said project.
-
I was reading through the thread and had the intution that Login History might have sth to do with your problem. Then I read that. To manually disable the module, you can rename the module folder to .ProcessLoginHistory . Then you can do a modules refresh and you should see the ProcessLoginHistory listed under "Missing" and can remove it from there from the DB. Maybe this will help. Still I think you are having permission issues on the new server since you can't delte old folders. Do you have ssh access to the server? If not, the server admin should be able to help with those issues. The 502 Proxy error signifies a communication breakdown between servers, often caused by issues like server overload, network problems, or configuration errors. Again, hard to debug that from the outside and the server admin should see what is happening exactly. But I guess it is some kind of overload problem caused by too many DB requests or the like since you get that server error too many SQL connections. When you login as Teacher and the page tree doesn't load, you can open the browser dev tools and check for the Responsetab of the XHR request that is happening to fetch the page tree data. In Firefox this should look something like this (where yours likely has a 500 error):
-
module SnipWire - Snipcart integration for ProcessWire
gebeer replied to Gadgetto's topic in Modules/Plugins
@Gadgetto I am struggling with webhooks :-) In the docs it says: * All hookable event handler methods will return an array containing payload Snipcart sent to your endpoint. * In addition, the following class properties will be set: * * $this->payload (The payload Snipcart sent to your endpoint) * $this->responseStatus (The response status your endpoint sent to Snipcart) * $this->responseBody (The response body your endpoint sent to Snipcart) * * (Use the appropriate getter methods to receive these values!) * * How to use the hookable event handler methods (sample): * ~~~~~ * $webhooks->addHookAfter('handleOrderCompleted', function($event) { * $payload = $event->return; * //... your code here ... * }); * ~~~~~ * * PLEASE NOTE: those hooks will currently only work when placed in init.php or init() or ready() module methods! * I have setup a hook for order.completed in the init method of a custom autoload module public function init() { ... // SnipWire Webhooks $this->wire->webhooks->addHookAfter('handleOrderCompleted', $this, 'handleOrderCompleted'); } Issueing post requests to the endpoint returns an empty response body While in the docs it says: when I var_dump($event->object->getResponseBody()) in my handler method, it gives an empty string which explains why the response body is empty. How can I set responseBody from within my hook handler method? There is no setter for that and Webhooks::responseBody is private, so I have no way to set it in my handler. To solve this, I introduced a setter method to the Webhooks class /** * Setter for responseBody. * * @param string $responseBody * @return void * */ public function setResponseBody(string $responseBody) { $this->responseBody = $responseBody; } Now in my handler method I can do $event->object->setResponseBody('{"test": "test"}'); Which results in While I was at it, I also added a setter for responseStatus. Not sure if you still maintain this module, so I will add this to my fork just in case anyone still needs it.- 231 replies
-
- shopping cart
- snipcart
-
(and 2 more)
Tagged with: