-
Posts
121 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Sanyaissues
-
@nurkka try amazon lightsail with your favorite Linux flavor (they gave you 3 months free for you to play) and install Webmin for server administration. It is an easy and cheap way to live under amazon infrastructure. Or the same but with Heztner with a cpx31 or cpx41.
-
[Solved] How you work with pw on external server
Sanyaissues replied to olivetree's topic in Getting Started
@Ivan GretskyI used to do Cowboy Coding (just learn the term! Love it) all the time, using Cloud9, so I only needed my browser to code. Then I switched to VsCode and remote development, but extensions started eating up my small server instance's memory (The default @builtin TypeScript extension is a RAM monster! and I wasn't even using it!). I spend half my time monitoring server-side extensions... until I finally made the switch to DDEV. That's definitely in my next-to-try list @bernhard -
saving ..sometimes, and nothing in errors.txt
Sanyaissues replied to joe_g's topic in General Support
I have no idea but in that case I would start by: 1. Activating debug mode. 2. If you have TracyDebugger go to ProcessWire info Pannel > Clear Session, Cookies, & Modules Refresh. If you don't, install it 😉 3. Just for the sake of it Clear all your caches 4. Log what's happening when the page is saved: Put this in your ready.php $this->addHookBefore('Pages::save', function (HookEvent $event) { $page = $event->arguments(0); bd("Attempting to save: {$page->title}"); }); $this->addHookAfter('Pages::save', function (HookEvent $event) { $page = $event->arguments(0); bd("Saved: $page->title"); }); $this->addHookBefore('Pages::saved', function (HookEvent $event) { $page = $event->arguments(0); $changes = $event->arguments(1); bd($changes, "Changes on $page->title"); }); Check the Dumps: -
[Solved] How you work with pw on external server
Sanyaissues replied to olivetree's topic in Getting Started
PW running on DDEV local containers for deploying and then a shell script (or sometimes duplicator) to publish to a live server. -
RockForms - Simple, secure and versatile forms based on NetteForms
Sanyaissues replied to bernhard's topic in Modules/Plugins
@bernhard I was aware of RockForms' existence but just by name, but never took the time to read more about it. I just finished reading the docs, and man, that module is a beast! hats off! -
Set default description for input field file on load
Sanyaissues replied to TomPich's topic in General Support
When you’re feeling lost and already halfway to uncharted waters, there’s only one man to call: The Captain Hook. -
Congrats @DrewPH!! Now you will need to ask your clients to update the feedback comments so people can know you are one of the best wordpress ProcessWire developers in Malta.
-
Playing with the new toy! 🚀👕 Screen recording 2024-10-29 15.50.20.webm
-
Set default description for input field file on load
Sanyaissues replied to TomPich's topic in General Support
wire()->addHookBefore("InputfieldFile::renderItem", function(HookEvent $event) { $pagefile = $event->argumentsByName('pagefile'); if ($pagefile->field->name === 'yourFileField') { $pagefile->description = 'Communiqué de presse'; $pagefile->page->save($pagefile->field->name); } }); Try this @TomPich. -
I'm reading Head First Design Patterns, because a recommendation of @da² in this beautiful post.
-
I spent the last two days going back and forth between FieldtypeRepeater and FieldtypeCombo for some fields, but FieldsetPage was exactly what I was looking for! I wish I had discovered it earlier 🤦♂️ Thanks @bernhard!
-
$wire->addHookBefore('Inputfield::render', function (HookEvent $event) { $inputfield = $event->object; // Proceed only for 'yourField' if ($inputfield->name !== 'yourField') { return; } // Get the associated page if (!($page = $inputfield->hasPage)) { return; } // Check if the page is part of the yourPageArrayField on page with id 1 // (or whatever the ID of the page with your pageArraField is) $productPages = pages()->get(1)->yourPageArrayField; if ($productPages->has($page)) { $inputfield->attr(['checked' => 'checked', 'value' => 1]); } });
-
Thanks and nice to meet you both @gebeer and @bernhard! RockCommerce looks so promising, it really feels like the procceswire way to do e-commerce.
-
Image cropping doesn't work with custom center
Sanyaissues replied to Jozsef's topic in API & Templates
$image = $gallery_page->images->first()->size(540, 404, [ "cropping" => ['50%', '35%'], "quality" => 80, "focus" => false ])->webp->url; Maybe it is auto detecting a focus presset. Try disabling it. -
After probably 12 years with Processwire, I just discovered that pressing the 🌲 tree icon link, in the breadcrumbs, opens a modal with the page tree.
-
Problem with og:image and WhatsApp / Meta Share Debugger
Sanyaissues replied to Žarko Kuvalja's topic in General Support
Also, you can still trim some fat, that image can be easily under 100kb. You can do it manually with squoosh (try jpg, that image don't need to be a png) or tinypng, or dynamically -
TailwindCSS suggestions/autocomplete in LATTE files with PHPStorm
Sanyaissues replied to nurkka's topic in RockFrontend
@nurkkaa month ago my intellisense stop the autocomplete and I solved by rolling back the extension version. Again it was VScode, but maybe is this bug related to PHPStorm? https://github.com/tailwindlabs/tailwindcss-intellisense/issues/1033#issuecomment-2362876115 I discovered the issue by looking at the VScode Tailwind Css Intellisense Output, instead of a successfully build I was getting: [GLOBAL] No matching project for document -
TailwindCSS suggestions/autocomplete in LATTE files with PHPStorm
Sanyaissues replied to nurkka's topic in RockFrontend
I'm VScode user and this on the settings.json does the trick: "tailwindCSS.includeLanguages": { "latte": "php" }, Guessing here, try something like https://www.jetbrains.com/help/phpstorm/tailwind-css.html#ws_css_tailwind_complete_classes_custom_context //or maybe "latte": "php" "includeLanguages": { "latte": "html" }, -
I'm interested too!
-
RockFrontend now supports translations in LATTE files ?
Sanyaissues replied to bernhard's topic in RockFrontend
{\ProcessWire\__text('foo')} works (but it didn't solve my problem hahaha). But guess whose module did the trick -
RockFrontend now supports translations in LATTE files ?
Sanyaissues replied to bernhard's topic in RockFrontend
Thanks for the message @bernhard! By any chance, have you ever used Functional Fields + RF + Latte? I noticed that when I declare __text('foo') directly in home.latte, the functional field doesn't recognize it. However, when I add it to _rockfrontend.php, it works. -
@Edward Ver you can use the contains operator for that. 1. First, set your field to use Pipe as delimiter (edit field > input > tag delimeter). With that, if our Page1 has 3 tags: logo vector illustration, they will be stored like this: logo|vector|illustration The pipe separator will be very useful because of this https://processwire.com/docs/selectors/#or-selectors1 2. Now lets find pages containing any of the tags of the page: //This will find pages containing any of this tags logo|vector|illustration (including the current page) $p = $pages->find("tags*={$page->tags}"); echo $p->each('{title} <br>'); 3. Let's remove the current page from the results: // Option 1: find all the pages and remove the current page. $p = $pages->find("tags*={$page->tags}")->remove($page); echo $p->each('{title} <br>'); //Option 2: find pages where the page ID isn't the same as the current page $p = $pages->find("id!={$page->id}, tags*={$page->tags}"); echo $p->each('{title} <br>');
-
To get the things done you need to play around with the logic until you hit the pot (usually the logic we write and the logic we think we write are different). To find the issue, let's poke your logic a little: // Find all pages with the template work_details and where the field tags is exactly the same as this page tags field $items = $pages->find("template=work_details, tags=$page->tags"); When viewing Page1 that will be translated to: //Pages with template work_details and field tags equal to branding/identity $items = $pages->find("template=work_details, tags=branding/identity"); To discover why you aren't getting the results you are expecting, try something simple first: // You can copy and paste each of these examples into your code // First, let's verify if all the pages with a specific tag are being fetched. // Print the title of all pages with a tags field containing "branding/identity" $items = $pages->find("tags=branding/identity"); echo $items->each('{title}'); // Now, let's do the same dynamically and also print the value of the tags to understand what $page->tags contains. // Print the title of all pages with a tags field equal to this page's tags field and print the value of tags $items = $pages->find("tags=$page->tags"); echo $items->each('{title} <br>'); echo "Tags value: " . $page->tags; // Also, note we can search for tags fields that contain a string using %= instead of = // Print the title of all pages containing the string from the page's tags field $items = $pages->find("tags%=$page->tags"); echo $items->each('{title} <br>'); echo "Tags value: " . $page->tags; As as side note, debugging will be way easier if you install TracyDebugger.
-
$items = $pages->find("template=work_details, tags=$page->tags"); 'tags' is a textfield, but you're passing the entire page object (tags=$page"). You need to pass the tags textfield value instead. I'm assuming that your textfield contains only one tag, e.g: new and not multiple tags like: new, cool, favorites If you want to learn more about selectors, try this: https://processwire.com/docs/selectors/#api-variables-in-selectors Also, you are missing some things in the repeater foreach <?php $items = $pages->find("template=work_details, tags='{$page->tags}'"); ?> <ul> <?php foreach($items as $item): ?> <?php foreach($item->work_hero_repeater as $work_hero_repeaters): //here! ?> <li> <?= $work_hero_repeaters->work_hero_image->getCrop('hero')->url ?> <a href="<?= $work_hero_repeaters->pager_link->url ?>"></a> </li> <?php endforeach; //and here! ?> <?php endforeach; ?> </ul>
-
Getting data from a hidden/unpublished page
Sanyaissues replied to Manaus's topic in General Support
being 1033 the page with the children you want to get: //Given than child only returns a single page, you can use sort,to for example get the newest child of 1033. $pages->get(1033)->child("sort=-created, include=hidden");