Jump to content

d'Hinnisdaël

Members
  • Posts

    215
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by d'Hinnisdaël

  1. Very nice! Love the idea. I'd like to try this out, but I think this will only make sense for production environments if the static copy is completely self-contained, i.e. including paginated pages, assets, etc. You could probably easily do that using wget and some command line magic. Your module would then make the whole process configurable and user-friendly, e.g. to run it via cron, via hook after page save, etc. Example gist: Download an entire website with wget, along with assets
  2. Seems like the _() function encodes entities only on multi-language installs. I have a working fix for this, but it's not yet on GitHub. I'll throw it in with the next release ?
  3. I'm using the standard AdminThemeFramework::getUserNavArray hook. Looks like that's a newer addition and not available on default. Any particular reason you're still using the default theme? I switched all of my client sites over to UiKit and I don't regret it. The old one looks so... old.
  4. @matjazp I added fixes for both issues you're describing. Check out the latest commit on the develop branch. These will be part of the next release.
  5. Thanks for taking the time and splitting this up ☃️ Much appreciated. I'll try this out with my next project where it'll come in really handy.
  6. @zoeck Slow day in the office — I added the editMode and viewMode options to the PageList panel as well. See the latest release. $panels->add([ 'panel' => 'page-list', 'title' => 'Information', 'data' => [ 'parent' => 'template=basic-page, name=info', 'editMode' => 'modal', 'viewMode' => 'blank', ], ]);
  7. You're right of course ? I have a custom panel that already includes the modal script, so I never noticed. I pushed a fix that should work. Thanks for debugging!
  8. Quick question: will this module work as intended if you turn off output formatting? I really like the sub-selector functionality like date.year=2019, but won't need the subfields like $page->date->year since I use Carbon for date fields in my frontend. Or are these two dependant on each other in any way?
  9. Strange. I added that to the module itself and it only worked for me after I added it: protected function includeModalScripts() { $this->modules->get('JqueryUI')->use('modal'); } /* And then later */ if ($modal) { $this->includeModalScripts(); $button->class .= ' pw-modal pw-modal-large'; }
  10. @gmclelland I can see this getting a bit out of hand with a CMF like ProcessWire that doesn't set any boundaries on the shape content can take. The most versatile solution would be to create an at-a-glance panel, but to rely on the programmer to supply the counts that are relevant to their site. I can see the template and role counts working the way you suggested. Still, not all templates are meaningful units of content, e.g. a `country` template for populating forms is really not that interesting to site editors. The role naming / pluralization would only work in English here (e.g. vendor becomes Vendors), so there'd need to be a way of naming them in other languages. The documents and images are a bit more complicated, however. ProcessWire doesn't have a central media or file library to get a count from. So you need to run a cronjob to scan the site for images across all pages. You'd also need to figure out which images are meaningful content (photos) and which are e.g. system-created QR codes for event invitations. How do you count videos? I have a file field called videos, and a repeater field with a video_url field. There's no way of counting that without doing it yourself. Don't get me wrong, I like the idea, but I don't think automating it is feasible or the right solution in ProcessWire. I'll be happy to be convinced otherwise ?
  11. @Jens Martsch - dotnetic @Macrura Adding multiple panels via $panels->add([]) should work now.
  12. @Jens Martsch - dotnetic @Macrura Come to think of it, I could check if the config array has numerical keys, and in that case treat them as an array of configs.
  13. @Jens Martsch - dotnetic @Macrura Correct. The problem here is that the config object is an array, and the outer array is also an array. There's no way of telling if it's a config array or a collection of config arrays without it getting ugly. Luckily, WireArray has an import() method for that exact purpose. I added a release on GitHub that supports adding an array of panels via $panels->import([]);
  14. I'm planning on revamping the documentation at some point — split it into sub-pages and make it more navigable. Next on the list is an example section with code snippets for all panels, as you suggested.
  15. @gmclelland There's a few good ideas in there! I do have an at-a-glance/counter panel on the roadmap, but I'm not sure how to exactly build that since ProcessWire — as opposed to Wordpress — doesn't have any pre-configured content types, so I would have to make it a bit more configurable. I also like the idea of having different tabs, although it's not a requirement I see many pages having. It should be relatively simple to implement, though (apart from the permissions stuff).
  16. I could make that a bit more obvious in the documentation ?
  17. @zoeck I implemented modal editing for the collection panels. See the latest release. You can set the mode to modal or blank for edit or view links. The modal auto-closes on page save and the panel reloads via AJAX when an edit modal closes. /* Open edit links in modal, view links in new tab */ $panels->add([ 'panel' => 'collection', 'data' => [ 'editMode' => 'modal', 'viewMode' => 'blank', ], ]);
  18. What you said: closing the modal on save is a requirement for me. I'll have to have a look at how the core does it in the template field editor, for example. I was looking into having the PageList links open in a modal as well, but that can be a later release as well.
  19. @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 ⚙️
  20. @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?
  21. @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.
  22. 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?
  23. 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 ?
  24. @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).
  25. @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.
×
×
  • Create New...