Jump to content

d'Hinnisdaël

Members
  • Posts

    215
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by d'Hinnisdaël

  1. How does everybody feel about creating a separate language pack for official and/or popular modules which would usually be in the site folder? I just noticed the Norwegian language pack making that switch. Especially for the Pro modules (Lister, FormBuilder) it would be nice to have a drop-in solution. And if you don't need them, just install the core language pack and everything stays the same. As far as I can tell, the current de-DE language pack doesn't include module translations, right? I'd be willing to create a repo and get things rolling.
  2. Just reading through the thread now, that looks very promising! Working with event dates from the API/selector side is quite messy but it seems like it doesn't have to be ?
  3. Format Datetime fields as Carbon instances. You can find the latest release and the complete readme on Github. Installation composer require daun/datetime-carbon-format Usage All Datetime fields will now be formatted as Carbon instances instead of strings. Some examples: // $page->date is a Datetime field // Output format: j/n/Y echo $page->date; // 20/10/2020 echo $page->date->add('7 days'); // 27/10/2020 echo $page->date->format('l, F j'); // Monday, October 20 echo $page->date->year; // 2020 echo $page->date->diffForHumans(); // 28 minutes ago Frontend only The ProcessWire admin seems to expect datetime fields to be strings. This module will only return Carbon instances on frontend page views. Date output format When casting a Carbon instance to a string (usually when outputting the field in a template), the field's date output format will be respected. Links GitHub • Readme • Carbon docs PS. I remember reading about a Carbon module in a recent newsletter, but couldn't find it anywhere. Was that you, @bernhard?
  4. I think what I meant to say was that the hash (#prodDescription) is never sent to the server. ProcessWore doesn't know about it. Any redirects that are dependent on the presence or absence of a hash need to be done in JavaScript on the client.
  5. I'm pretty sure those anchor hashes never reach the server and are evaluated by the browser only.
  6. What are you using ProcessWire for in this scenario? Will you have other internal content managed in ProcessWire or will you just be using it to render the external content on the frontend? I've done the latter before (using PW only to import and display data) und wouldn't recommend doing it. Importing the data is just a lot of added complexity. A static site generator might be a better solution here.
  7. There's two ways I've tried in the past that worked: 1. Use a regex for your allowed url segments so it won't match "sitemap.xml" 2. Trigger a 404 manually from your homepage template file if the first input segment is "sitemap.xml"
  8. The code looks right to me. The fact that you're seeing a chart at all means there's probably something off in the way your options are structured. The panel itself only sets the defaults so overriding them like you're doing it should work. I'm afraid I won't be of much help here since debugging Chart.js config is a bit out of scope of this module ?
  9. Right, thanks, I left a session message in there. I pushed a patch at version 0.7.1. While it propagates to the module directory, removing line 119 of DashboardPanelCollection.module should work as well.
  10. I would second MoritzLost's viewpoint here. Most template engines auto-escape output — so as soon as you use Twig or Latte for your views, it's best to disable the entity formatter for all fields and let the template engine handle it.
  11. Release 0.7.0 adds a few features and fixes an issue reported by @MoritzLost. Collection panel: Field names as column headers The collections panel now uses the field label as column header. No need to pass them in explicitly anymore. See the docs on column headers for details. Shortcuts panel: Add option to hide shortcut summaries Disable the summaries altogether by setting the summaries option to false. Shortcuts panel: Fix undefined-index error when destructuring shortcuts
  12. You don't need to fiddle with the ports really. Pass ngrok your local origin (localhost:8888) and then it returns an https domain without a port, i.e. on port 80. Paste that portless domain into Snipcart. That should do it. If it doesn't, it might be a problem with how you declare your product data.
  13. localtunnel and ngrok work great in this type of scenario. They expose a public URL that proxies requests to your local dev server so external services like Snipcart get access to it.
  14. There's really two reasons this isn't implemented: 1 — I don't think it's all that necessary. For actual browsing of data that requires state and pagination, there's much better tools available: PageList and PageLister, among others. The pagination info, as implemented currently, is merely meant to communicate that there's more results than currently shown and avoid any confusion there. 2 — It's probably not that trivial to build. The native pagination breaks down once you do any sorting or render multiple paginated panels on a dashboard. To make it work well, it would have to be a custom-built solution that fetches results via AJAX and does the sorting server-side. I'm not currently doing any substantial work on the module, however I'm planning to implement some missing features when I find the time later this summer. In the meantime, I'll happily accept pull requests for a working pagination feature.
  15. You're right, thanks for letting me know. Links should be fixed now. I just switched to a different GitHub username and hadn't come around to updating the links yet. The docs can be found here now: daun.github.io/processwire-dashboard/
  16. @Markus (Blue Tomato) I had a chance to use this on a production site and it's working great! Looks fantastic. Quite a bit faster than expected as well — I measured 10ms per image on a low-end Digital Ocean box, so no need for atomic caching so far. Thanks again for releasing, really appreciate this one ?
  17. Very interesting! This is definitely the cleanest and most straight-forward option for generating low-quality image placeholders. Thanks for releasing ? Two questions @Markus (Blue Tomato): 1. How is performance for generating the data URIs? Do you generate them on the fly for every request or do you store the final LQIP data URI somewhere as well? My current implementation puts the tiny 200byte LQIP file alongside the source image; I wonder what's better here: generating in memory or reading from disk. 2. I remember you releasing a similar tool for generating SVG shapes — did you stop using that in favor of the blurhash or are you using both in parallel?
  18. This looks great, thanks for open-sourcing! Am I right in assuming that the callbacks will only get invoked if the matching placeholder is found in the server response?
  19. @Sevarf2 How do you manage state in your template — get variables? The template panel works best for displaying static data. For creating pages and importing data I'd suggest creating a custom panel type. That'd make it much easier to manage the required multi-step processes. Or better yet, a Process module for importing data and a separate dashboard panel that only kicks off the import and hands off the actual workload to the main module.
  20. Not sure what you're running into here. If you have a repo or gist with the code that's blowing up, I'm happy to take a look. Best bet is to make sure your templates are properly namespaced (ProcessWire).
  21. All of these are good points, actually. I'm surprised I missed the default field label thing, since it's kind of the standard behavior in most core modules and especially useful in multi-language environments. I'm currently short on time, but will tackle these as soon as things settle down.
  22. Chart.js expects an array at datasets, even if you just use a single one. It'll work once you wrap that in brackets again.
  23. The collection panel does allow for an ›Add New‹ button. It's just not documented at the moment. You can either specify the child page's template or the parent page and it'll figure it out. For the template option to work, the child template must have a default parent defined. This should work: $panels->add([ 'panel' => 'collection', 'title' => 'Widgets', 'data' => [ 'collection' => 'template=widget, limit=6', // Option A: Add to child template's defined parent page 'template' => 'widget', // Option B: Add to specific parent page (page, ID or selector) 'parent' => 'template=widget-list', ] ]);
  24. Looks great! Let me know how it's faring and I'm happy to use that instead of the page's process setting. You're doing a good job convincing me here. It does make sense conceptually and thinking about the module ecosystem as a whole. That said, the module is currently at a point where I'm not missing much in terms of functionality and am not that keen on re-writing the whole output layer with no new features to show for it. And it's not like I have the time, with everybody currently wanting to expand their online stores... If anything, I'd put that on the list for version 1.0 as a summer/fall project since it'd be a breaking change either way. If you definitely need this and need it soon, I'm happy to accept a pull request. But why would you want to re-use a dashboard panel in another module? That doesn't make sense to me. The way I see a dashboard working is the other way around: it displays a condensed form of information found elsewhere, e.g. shortcuts from all possible admin views, a single chart from a whole host of data, the most recent news pages from a whole archive of them, and so on. If anything, you'd re-use a fieldset from one of your modules in the dashboard. Using markup from an existing module in a dashboard panel is working just fine — with the exception of granular access control and conditional visibility. Which to me seem minor but might be a deal-breaker for more corporate-y types of applications.
  25. Hi @bernhard, thanks for your feedback, really appreciated. There's a few things to unpack here: Module dependencies The panel modules need to inherit from an actual class from a separate PHP file which made things more difficult than I'd like to admit. So right now I'm happy it's working properly at all. I wouldn't dwell on this issue too long since all modules are within a single folder and the naming is quite obvious. Might revisit this in the future. Exit on save I'd always expect »Exit & Save« on a page edit form to get me back to the page tree, since that's the level above. I'm happy to make that configurable, though. Admin home process Can you think of a way to permanently and consistently re-route everything to the admin homepage instead of the page tree? And then still have the page tree clickable as a stand-alone view? That would be a better solution that the current one for sure. I've had a previous version that changes the admin parent's process manually and changes it back on uninstall, but that was buggy as hell and really scared me. Asset CDN Good point about the intranet. I'm really uncomfortable bundling dependencies in projects. There's something quite icky about it and using a CDN feels like sort of a happy middle ground, but your point is valid. Panels as Inputfield I get what you're saying about not re-inventing the wheel. I'm afraid I have to disagree here, though. Input fields primarily serve the need to create complex forms, to arrange components for user input. In ProcessWire, it's become common to use them for everything under the sun since they're as close to a universal layout component as it gets. Might be a misnomer in hindsight, but I don't feel like every layout panel in the admin needs to be an input panel. It's useful for sure, but I don't see the need to have every container in the backend inherit from the base Inputfield class. They come with a lot of additional logic that doesn't apply to simple output panels, like the collapsing stuff and the conditional display logic. For context, the initial version of the module was created the way you suggested, using ProcessWire's input fields and fieldsets. There was just no way to make them look nice and behave the way the module required. Laying them out in a grid with proper spacing and responsive sizing was plain horrible. You're not only fighting a hundred separate existing CSS rules for margins and outlines but ProcessWire's internal JS for collapsing/uncollapsing/calculating of field widths on top. One of the requirements for me was to have 'renderless' panels without border, background or margin to achieve floating panels for charts. Undoing all the internal inputfield styling just wasn't something I was comfortable spending my time on. Out of curiosity: what's a possible scenario for re-using a dashboard panel in some other part of the admin?
×
×
  • Create New...