Jump to content

d'Hinnisdaël

Members
  • Posts

    248
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by d'Hinnisdaël

  1. @zoeck Ok, thanks, in that case I'll need to test the module in multi-language environments. The modal editing of collection links is work in progress, but it's not as straight-forward as I hoped it would be ⚙️
  2. @zoeck That error means one of the panel modules is loaded before the base class. This shouldn't be an issue anymore since I raised the main module's autoload priority. I made a note try out the web installer soon. The empty dashboard message looks fine here, rendered as a link. Does the dashboard itself render correctly once you configure the panels? The template file doesn't escape any of the output values, so I'm a bit confused as to why this could be. Do you have any modules installed that might overwrite or change the _() function of ProcessWire in any way?
  3. @dragan I want to detect whenever $user->language is changed during runtime, i.e. any changes after startup, including all related API calls like $languages->setLanguage(). I need to change the locale setting of the library I'm using for displaying dates in the frontend and would like to cover the scenario of dynamically setting the language for output purposes.
  4. I need to run code each time the user's language is changed. What's the best way to go about that? Reading the source code, I found documentation on a hook called Languages::languageChanged, but it doesn't exist and is never called. Maybe @ryan knows if the hook does indeed exist and I'm just doing it wrong? Ideally, this would work: wire()->addHookAfter('Languages::languageChanged', function (HookEvent $event) { $newLanguage = $event->arguments(1); Carbon::setLocale($newLanguage->locale) }); Maybe there's a better way of doing that?
  5. You're right about the actions column — I pushed a release that hides the table sort arrows. Also, I added a readme section on how to set custom icons per shortcut: 'shortcuts' => [ 'Updates' => 1020, // Override title 'Updates' => [1020, 'gear'], // Override title + icon ], Support for IE is definitely not planned. I'm happy to take pull requests, though, if you find a way to pull it off ?
  6. @matjazp I think I found a fix for the issue you're describing. Please check out the latest release from GitHub and let me know if the problem persist. I also added version constraints (PHP 7 and the previous stable ProcessWire release 3.0.123).
  7. @matjazp I added a release that adds the margins back in for the default admin theme. Concerning the user name display: I can't reproduce that on the current master version (3.0.148) with AdminThemeDefault. However, the latest release only displays 'Welcome' without a comma if the user name comes out empty. Why it would be empty, I don't know, since it's working fine here.
  8. This is fantastic. ? I also need currency that doesn't creep me out.
  9. @Macrura ? Looks great! I do have a FormBuilder module on the longer wishlist, but can't see myself implementing that too soon. If you ever feel like creating one, I'd be more than happy to merge it into the main module.
  10. @Macrura Yeah ? I added another release, check out 0.4.4.
  11. @Macrura I released a version that should fix the auto-loading of asset modules into the config array.
  12. @Macrura Shortcut URLs I have pushed a release that treats strings as URLs so that any of the following options should work: [ 'shortcuts' => [ // Page $this->pages->get(1132), // Page ID 1020, // Overwrite page title 'New things' => 1020, // Set custom URL 'Backups' => "{$config->urls->admin}setup/db-backups/backup/", ], ] Profile page icon Check out the PageIcon module which lets you set custom icons for every page. Hooks in admin.php That's strange. Do you have any other hooks in admin.php that work? I have tons of hooks there and never had a problem. $config->styles True, I don't use the styles array myself so I haven't run into this. Will research a fix.
  13. ProcessWire Dashboard Download You can find the latest release on Github. Documentation Check out the documentation to get started. This is where you'll find information about included panel types and configuration options. Custom Panels The goal was to make it simple to create custom panels. The easiest way to do that is to use the panel type template and have it render a file in your templates folder. This might be enough for 80% of all use cases. For anything more complex (FormBuilder submissions? Comments? Live chat?), you can add new panel types by creating modules that extend the DashboardPanel base class. Check out the documentation on custom panels or take a look at the HelloWorld panel to get started. I'm happy to merge any user-created modules into the main repo if they might be useful to more than a few people. Roadmap Panel types Google Analytics Draft At a glance / Page counter 404s Layout options Render multiple tabs per panel Chart panel load chart data from JS file (currently passed as PHP array)
  14. Completely agree. The module will only profit from you enjoying working on it, so go easy on yourself and make use of available core features where necessary. Besides, ProcessWire is ridiculously easy to keep updated, so I don't feel like you're leaving anybody behind.
  15. I'd use the module uploaded by LostKobrakai at some point and add margins and paddings to position them at north/east/south/etc:
  16. Yes, working as intended!
  17. Just gave it a try — works like a charm! Thanks for merging so quickly. A thought on the hook name: would it make more sense to call it getAdditionalPageUrls (including "urls") to clarify it's returning additional URLs for a specific page? One might need a hook at some point to get additional pages independent of any other page (who knows why), which would then appropriately be called getAdditionalPages.
  18. @Mike Rockett @teppo I created a merge request on GitLab. Happy to get some input on that. It includes an example implementation and an updated readme section on dynamic URL segments. One thing that I couldn't figure out is creating alternate-language URLs inside the hook. The LanguagePageNames module doesn't create the hooks for Page->localHttpUrl() if the requested page results in a 404 error (which it always does when generating the Sitemap since that's what triggers it). That's why the Sitemap module manually adds those hooks when initializing. However, even when the module has been initialized and the hooks should have been added by that point, localHttpUrl() is not available on any Page object inside the hook. I worked around that in my previous project by doing the same as the Sitemap module and adding the localUrl methods manually. It's however far from an ideal solution to have to add all that boilerplate. Any ideas? wire()->addHookAfter('MarkupSitemap::getAdditionalPageUrls', function ($event) { /* get arguments */ static $hooksAdded = false; if (!$hooksAdded) { foreach (['localUrl', 'localHttpUrl', 'localName'] as $pageHook) { $pageHookFunction = 'hookPage' . ucfirst($pageHook); wire()->addHook("Page::{$pageHook}", null, function ($event) use ($pageHookFunction) { wire('modules')->LanguageSupportPageNames->{$pageHookFunction}($event); }); } } $hooksAdded = true; /* add URLs */ }); I started working on the video element feature, but that's not as straightforward as I thought.
  19. @Mike Rockett @teppo I just stumbled upon a local fork to the module I made some time ago that adds that functionality (additional URLs per page, added via a hook). I'll whip it into shape and create a merge request in case that provides useful or as a starting point. It's working quite well locally, just have to fork from the current state and add some docblocks.
  20. Another related feature that I've thought about often is a hook for adding custom resources. The main use case would probably be videos tied to specific pages. As there is no agreed-upon way of uploading videos in ProcessWire, the module can't know what is a video and what isn't. Hooks would be perfect here.
  21. Very much in favor of adding hooks to add custom URLs!
  22. I can highly recommend @kixe's PageIcon module. It adds page_icon as a global field with a FontIconPicker input field. Works great for one-off changes, e.g. specific listers or module pages in the setup dropdown. For dynamic icons (warnings, etc.), the hook is the best solution.
  23. Is the default language tab still initially active after you increase its sort value? Or does PW always focus/activate the first visible tab?
  24. @ryan Do the custom file fields currently support FieldtypeOptions? I created it in my ›field-image‹ template, but it isn't shown in the image editor UI (no markup created). Checkboxes, text fields, page selects all seem to work fine. Your screenshot in the introduction blog post looks like it's using FieldtypeOptions fieldtype with radio buttons. Or is that a Page field?
  25. Looks like they went back to their previous pricing model without a premium plan. This will make it a lot easier to suggest Snipcart in the future — paying 70$ a month for custom email templates was really limiting the number of customers that were a good fit for it.
×
×
  • Create New...