Jump to content

fruid

Members
  • Posts

    680
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by fruid

  1. I did something like this: <div class="grid grid-cols-4 gap-4 border border-green-500"> <div class="col-span-3"> <img src="path/to/image.jpg"/> </div> <div class="col-span-1"> <p>Yada yada yada.</p> </div> </div> But the classes don't get applied. Might that have to do with where in which directories tailwind looks for tw classes? Here's my setup: /** @type {import('tailwindcss').Config} */ module.exports = { content: [ "../*.{html,php,js}", "../../classes/*.{html,php,js}", "./node_modules/tw-elements/dist/js/**/*.js", "../../assets/cache/HannaCode/*.{html,php,js}", "../../assets/*.{html,php,js}", "../../../*.{html,php,js}", "./node_modules/flowbite/**/*.js" ], That said, it does work for the hard-coded tw classes anyway, that's why I thought that might be the issue.
  2. I want the users to be able to subscribe to different lists depending on the page the subscribe form appears on. Is that doable? My guess is it should be, since it would be similar to the functionality of "following" a topic here in the ProcessWire forum – doesn't the forum use ProMailer for email updates? I read through the documentation and neither "custom fields" nor "users/pages list type" would accomplish what I want. Not the former as it would just save the page info (let's say that's I have a custom field for that) along with email address and whatnot in the user entry of the subscriber's list, and not the latter as it would just allow for a closed list of pre-defined users that no-one can subscribe to if they so wish. Thanks for help! I know ProMailer is a pro module but I cannot find (or access?) the ProMailer forum anymore.
  3. Thanks @ryan I didn't see that checkbox but I did see an input field Number of Seconds to Cache Exchange Rate Data It was set to 86400, so I set it to 0 and saved. Then I was able to see the table with all codes, names, symbols and rates. Now I also see the checkbox. Weird, I am still on version 3. Anyways, yes, HKD is listed. (Actually not one currency was working before). Now it seems to work again. I wonder, if I need to do this regularly i.e. lower the number of seconds when the cache is cleared?
  4. I'm having troubles using the methods ->getName() and ->getNames() $cc = wire('modules')->get('ServiceCurrencyConversion'); $currencyArray = $cc->getNames(); // array (0) $currency = 'HKD'; $cc->getName($currency); // null warnings: PHP Warning: Undefined array key "HKD" in .../ServiceCurrencyConversion/ServiceCurrencyConversion.module:341 PHP Warning: Trying to access array offset on value of type null in .../ServiceCurrencyConversion/ServiceCurrencyConversion.module:341 I logged into my openexchangerates.org account and there seems to be no outage. Any ideas what this could be?
  5. Any news on that front? I have an images field on a page with a CKEditor field. When I add to that text content a gif from the images field, the gif gets resized and is not animated. I understand this is a bug that is yet to be fixed but is there a workaround in the meantime? Since I'm not displaying the images programmatically I cannot use the API e.g. Pageimage::getOriginal()
  6. I thought extending the user class was not possible since it's a special case and I should use the module approach instead. Has that change in the meantime?
  7. Though this is very helpful, I am still not sure how this works. I can do stuff like this: i.e. access the custom public methods of the user object from outside the class. I have also of course no problem accessing private classes within the here discussed user extension class. However, how does the code change when I define and use a public method from inside and from outside the class. Do I need to pass it the $event?
  8. Hello dear processwirers, I hope you are doing well. I'm a bit stuck implementing this module. Since the "Edit Profile"-form renders when the GET-params are "profile=1" But that form also submits to the same page with the same GET-params "profile=1" I don't see how I can redirect the page upon form submission without ruling out the case that the user is just on the edit profile page. That also means that when the form was submitted and I refresh the page, the browser asks me if I want to resubmit. In more technical terms: how can I edit the form action URL? Thanks for help!
  9. I meant only return /de/ or /en/, is there no native method to do that?
  10. what's the best way to return the user's current language specific URL segment? I mean for example /en/ or /de/ depending on the user's active language?
  11. I want to create a web app where users can login/register via Google I've seen a handful of modules that promise similar things including Oauth2Login, SocialLogin and GoogleClientAPI What I need is the user to be able to login/register via their Google-account and upon that to be logged-in both in their PW-CMS account as well as in their respective Gmail-account in the browser and me to have access to specific data via Google API. My guess is I would need to combine two modules? Maybe GoogleClientAPI with LoginRegister? Or GoogleClientAPI with LoginRegisterPro? Or can GoogleClientAPI do both? Thanks for suggestions!
  12. I'm trying to create a hook that would populate my SEO-Markup fields automatically with some field values of the page upon saving. For some reason I cannot access the MediaManager image field's ->media property and its properties, it returns null. I do see this in the tracy console though… //ready.php $wire->addHookBefore('Pages::saveReady', function($event) use($sanitizer) { $page = $event->arguments[0]; if (!$page->id) return; if ($page->isChanged('seo_title') || $page->isChanged('seo_image') || $page->isChanged('seo_description')) return; // SEO image :D if ($page->seo_image == '') { $filled = false; bd($page->mema_images); // see screenshot bd($page->mema_images->count); // 3 if ($page->mema_images->count > 0) { $imageURL = $page->mema_images->first->media->url; bd($imageURL); // null :( $filled = true; } if ($filled == true) { $imageURL = strval($imageURL); $page->seo_image = $imageURL; $page->message('SEO image was filled because it was empty :D'); $filled = false; } } // SEO description :D - this works fine if ($page->seo_description == '') { $filled = false; $description = ''; if ($page->preview != '') { $filled = true; $description = $page->preview; } if ($filled == true) { $description = SEOcleanUp($description, $sanitizer); $page->seo_description = $description; $page->message('SEO description was filled because it was empty :D'); $filled = false; } } $event->arguments(0, $page); });
  13. The module still needs quite some improvement. One issue that needs attendance is the following. I build a selector and select a page array from the database. $selector = $this->createSelector($this->q, $category); bd($selector); $unfilteredMatches = $this->pages("$selector, start=0, limit=99999"); As discussed in this thread it's (so far) impossible to select pages based on language specific field values. So the query looks through the field values in all languages for the search term. Since this is not what I want, instead I want the query to only match the fields values of the current user language, I do another loop and within that loop, with the method buildSnippets() I create the snippets for the markup. If this returns null (this is now language specific) I sort out the page entirely. $strippedFieldValue = strip_tags($fieldValue); // Find the position of the search term in the field value $position = stripos($strippedFieldValue, $searchTerm); // If the search term is not found, return an empty string if ($position === false) { return false; } So basically I'm selecting once via selector and then narrow it down with a loop. That works for a one-term search query or an exact phrase, but it makes sense that It won't and doesn't work when the search operand is on the fancier side as listed here: https://processwire.com/docs/selectors/operators/#contains What would you suggest? Is my approach so far sensible? Should I hard-code a different loop condition for each of the fancy search operands? I want to give the module-user (not enduser but admin user) the option to adjust the search operand in the module's settings. Thanks for help!
  14. OK I found the culprit. I was initiating the module on a custom page class just to make use of one method., not a good idea.. Now that I found a work-around it works fine and I can uninstall with no issues.
  15. I actually found this in the modules.txt log file: 2023-12-21 11:36:09 admin https://mysite.ddev.site/admin/module/edit?name=SimpleSearch&collapse_info=1 Uninstalled module 'SimpleSearch' 2023-12-21 11:36:10 admin https://mysite.ddev.site/favicon.ico Installed module 'SimpleSearch' Super strange! I removed the favicon.ico links in the head tag, removed the favicon icons, cleared cache, refreshed modules, cleared compiled files, issue remains Will try this now: EDIT: I just tried this and Tracy doesn't bd-log anything from inside the install() method nor the uninstall() method, I mean not even this gets logged: bd('install'); So strange!
  16. OK then I think the right question to ask would be: why am I seeing this?
  17. I don't know if this is related but I'm seeing a lot modules under the "Missing" tab which are actually not missing. I did of course refresh and check for new modules and also clear compiled files. The modules do appear under "Missing" and under the regular modules tab as if they were just fine. At least one of them, "System Notifications" is even a core-module and I think TineMCE as well, see screenshot.
  18. not sure what parent means in this context…
  19. I tried refresh and clear compiled files, doesn't help. Now thinking maybe this problem is related? I posted here yesterday… https://processwire.com/talk/topic/21128-solved-invalid-module-name/?do=findComment&comment=237939 But AFAIK I followed the naming convention alright, that's why I'm kinda stuck.
  20. yes I'm in debug and have tracy. When I uninstall, I can confirm that what ever I log from inside the __uninstall() method doesn't get logged. That is strange. Also, in the module I defined some hooks that get triggered when saving a template. Might that be the culprit? It still makes no sense to me since when I'm uninstalling the module, I'm not on and am not editing a template. public function ready() { $this->addHookAfter("ProcessTemplate::buildEditForm", $this, 'addSimpleSearchCategoryField'); $this->addHookBefore("ProcessTemplate::executeSave", $this, 'saveSimpleSearchCategoryFieldValue'); }
  21. highly unlikely, it was on my local machine.
  22. I wrote this search module: https://github.com/dtjngl/simpleSearch It works OK so far, however I don't know why I cannot uninstall it. When I uninstall it, it keeps reinstalling. Is that issue to be found in the module? Cause I do have locations in my website template files where I initiate this module but that shouldn't matter because it reinstalls (or doesn't uninstall) while still on the modules overview page in admin. Also no mentions of it on ready.php etc. Thanks for help!
  23. I tried that, didn't help. However, once I upgraded my /wire/ folder, no conflicts anymore and I was able to uninstall. So ProcessPageViewStat was never the problem apparently. I could reinstall it actually. Thanks!
×
×
  • Create New...